diff --git a/com/models.py b/com/models.py index 74b30529..9775d547 100644 --- a/com/models.py +++ b/com/models.py @@ -27,11 +27,13 @@ from django.db import models, transaction from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse_lazy, reverse from django.conf import settings +from django.contrib.staticfiles.templatetags.staticfiles import static from django.core.mail import EmailMultiAlternatives from django.core.exceptions import ValidationError from core.models import User, Preferences from club.models import Club +import os class Sith(models.Model): """A one instance class storing all the modifiable infos""" @@ -133,6 +135,9 @@ class Weekmail(models.Model): 'weekmail': self, }).content.decode('utf-8') + def get_banner(self): + return "http://" + settings.SITH_URL + static("com/img/weekmail_banner.png") + def __str__(self): return "Weekmail %s (sent: %s) - %s" % (self.id, self.sent, self.title) diff --git a/com/templates/com/weekmail_renderer_html.jinja b/com/templates/com/weekmail_renderer_html.jinja index 37a9bc50..beb44db5 100644 --- a/com/templates/com/weekmail_renderer_html.jinja +++ b/com/templates/com/weekmail_renderer_html.jinja @@ -1,19 +1,25 @@ -
-
-

{{ weekmail.title }}

- +
+
+

{{ weekmail.title }}

+ {% if weekmail.intro %} -

{% trans %}Intro{% endtrans %}

+

{% trans %}Intro{% endtrans %}

{{ weekmail.intro|markdown }} {% endif %} -

{% trans %}Table of content{% endtrans %}

+

{% trans %}Table of content{% endtrans %}

    {% for a in weekmail.articles.all() %}
  • [{{ a.club }}] {{ a.title }}
  • @@ -21,22 +27,22 @@ h1, h2, h3, h4, h5, h6, p {
{%- for a in weekmail.articles.all() %} -

[{{ a.club }}] {{ a.title }}

+

[{{ a.club }}] {{ a.title }}

{{ a.content|markdown }} {%- endfor -%} {%- if weekmail.joke %} -

{% trans %}Joke{% endtrans %}

+

{% trans %}Joke{% endtrans %}

{{ weekmail.joke|markdown }} {% endif -%} {%- if weekmail.protip %} -

{% trans %}Pro tip{% endtrans %}

+

{% trans %}Pro tip{% endtrans %}

{{ weekmail.protip|markdown }} {% endif -%} {%- if weekmail.conclusion %} -

{% trans %}Final word{% endtrans %}

+

{% trans %}Final word{% endtrans %}

{{ weekmail.conclusion|markdown }} {% endif -%} diff --git a/core/static/com/img/weekmail_banner.png b/core/static/com/img/weekmail_banner.png new file mode 100644 index 00000000..b367ff89 Binary files /dev/null and b/core/static/com/img/weekmail_banner.png differ