society-self-service/sspromotions/jinja2/sspromotions/email/bulletin.html

115 lines
4.6 KiB
HTML

{% extends 'sspromotions/email/base.html' %}
{#
Society Self-Service
Copyright © 2018-2019 Yingtong Li (RunasSudo)
Design by SendWithUs (Apache 2.0 licence)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
#}
{% block css %}
.group-options {
width: 100px;
position: absolute;
right: 8px;
top: 8px;
color: #ccc;
text-align: right;
font-size: 8pt;
}
.group-options a {
color: inherit !important;
}
{% endblock %}
{% block content %}
<tr>
<th class="small-12 large-12 columns first last">
Hi {{ member.first_name if member else '[Name]' }}! Here's your latest news from MUMUS:
</th>
</tr>
<tr><!-- Masthead -->
<th class="small-12 large-12 columns first last">
<table>
{% set ns = namespace(last_date=None) %}
{% for event in events %}
<tr>
{#<td class="small-12 large-3">{% if ns.last_date != event.date.date() %}{{ event.date.strftime('%a %d %b') }}{% endif %}</td>{% set ns.last_date = event.date.date() %}
<td class="small-12 large-9 last small-margafter"><b>{{ event.title }}</b>{% if event.link %} · <a href="{{ event.link }}">Read more &#x203A;</a>{% endif %}</td>#}
<td class="small-12 large-3">{% if ns.last_date != event.date.date() %}{{ event.date.strftime('%a %d %b') }}{% endif %}</td>{% set ns.last_date = event.date.date() %}
<td class="small-12 large-9 last small-margafter">{% if event.link %}<a href="{{ event.link }}" style="color: inherit;">{% endif %}<b>{{ event.title }}</b>{% if event.link %}</a>{% endif %}</td>
</tr>
{% endfor %}
</table>
</th>
</tr>
{% for group in groups %}
{% if not loop.first %}
{{ gap }}
{% endif %}
<tr class="heading"> <!-- Section heading -->
<th class="small-12 large-12 columns first last">
<h2 class="text-center">{{ group.name }}</h2>
{% if group.group.subscribable %}
<div class="group-options"><a href="https://{{ settings.ALLOWED_HOSTS[0] }}{{ url('membership') }}">Unsubscribe</a></div>
{% elif group.name not in settings.PROMO_GROUPS_MANDATORY %}
<div class="group-options"><a href="https://{{ settings.ALLOWED_HOSTS[0] }}{{ url('membership') }}">Change year level</a></div>
{% endif %}
</th>
<th class="expander"></th>
</tr>
{{ gap }}
{% for item in group.bulletin_items %}
<tr> <!-- Main Digest content -->
{% if item.image %}
<th class="small-12 large-3 columns first">
{% if item.link %}<a href="{{ item.link }}">{% endif %}<img src="{{ MEDIA_URL }}{{ item.image }}" alt="{{ item.title }}">{% if item.link %}</a>{% endif %}
</th>
{% endif %}
<th class="small-12 large-{% if item.image %}8{% else %}12 first{% endif %} columns last">
<b><h5>{{ item.title }}</h5></b>
<p>{{ item.content | markdown }}</p>
{% if item.link %}<p><a href="{{ item.link }}">Read more &#x203A;</a></p>{% endif %}
</th>
</tr>
{% if not loop.last %}<hr>{% endif %}
{% endfor %}
{% endfor %}
{% if more %}
<tr class="heading"><th class="small-12 large-12 columns first last">
<p>More from MUMUS:</p>
</th></tr>
{{ gap }}
<tr> <!-- Digest Content 3 columns-->
<table class="row"><tbody><tr>
{% for item in more %}
<th class="small-12 large-4 columns{% if loop.first %} first{% endif %}{% if loop.last %} last{% endif %}">
{% if item.image %}{% if item.link %}<a href="{{ item.link }}">{% endif %}<img src="{{ MEDIA_URL }}{{ item.image }}" alt="{{ item.title }}">{% if item.link %}</a>{% endif %}<br>{% endif %}
<b><h5>{{ item.title }}</h5></b>
<p>{{ item.content|striptags|truncate(100) }}</p>
{% if item.link %}<p><a href="{{ item.link }}">Read more &#x203A;</a></p>{% endif %}
<p style="font-size: 8pt;"><a href="https://{{ settings.ALLOWED_HOSTS[0] }}{{ url('membership') }}">Subscribe to {{ item.group.name }}</a></p>
</th>
{% endfor %}
</tr></tbody></table>
</tr>
{% endif %}
{% endblock content %}
{% block footer %}
MUMUS Mail is personalised for you. <a href="https://{{ settings.ALLOWED_HOSTS[0] }}{{ url('membership') }}">Unsubscribe or manage your email subscription.</a><br>
{% endblock %}