]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/notifications/newquestion.html
Added extra check to avoid empty tags been sent in notifications.
[osqa.git] / forum / skins / default / templates / notifications / newquestion.html
1 {% load i18n extra_tags email_tags %}
2
3 {% declare %}
4     prefix = html.mark_safe(smart_str(settings.EMAIL_SUBJECT_PREFIX))
5     app_name = smart_str(settings.APP_SHORT_NAME)
6     safe_app_name = html.mark_safe(smart_str(settings.APP_SHORT_NAME))
7     question_author = html.mark_safe(smart_str(question.author.username))
8     question_url = smart_str(settings.APP_URL + question.get_absolute_url())
9     question_title = html.mark_safe(smart_str(question.title))
10     question_tags = html.mark_safe(smart_str(question.tagnames))
11     safe_body = html.html2text(smart_str(question.html))
12     author_link = html.objlink(question.author, style=settings.EMAIL_ANCHOR_STYLE)
13     question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE)
14     tag_links = html.mark_safe(smart_str(" ".join([html.objlink(t, style=settings.EMAIL_ANCHOR_STYLE) for t in question.tags.all()])))
15 {% enddeclare %}
16
17 {% email %}
18     {% subject %}{% blocktrans %}{{ prefix }} New question: {{ question_title }} on {{ safe_app_name }}{% endblocktrans %}{% endsubject %}
19
20     {% htmlcontent notifications/base.html %}
21         <p style="{{ p_style }}">
22             {% if tag_links != "" %}
23             {% blocktrans %}
24             {{ author_link }} has just posted a new question on {{ app_name }}, entitled
25             {{ question_link }}
26              and tagged "<em>{{ tag_links }}</em>". Here's what it says:
27             {% endblocktrans %}
28             {%else%}
29             {% blocktrans %}
30             {{ author_link }} has just posted a new question on {{ app_name }}, entitled
31             {{ question_link }}. Here's what it says:
32             {% endblocktrans %}
33             {%endif%}
34         </p>
35
36         <blockquote>
37             {{ question.html|safe }}
38         </blockquote>
39
40         <p style="{{ p_style }}">{% trans "Don't forget to come over and cast your vote." %}</p>        
41     {% endhtmlcontent %}
42
43 {% textcontent notifications/base_text.html %}
44 {% blocktrans %}
45 {{ question_author }} has just posted a new question on {{ safe_app_name }}, entitled
46 "{{ question_title }}" and tagged {{ question_tags }}:
47 {% endblocktrans %}
48 {{ safe_body }}
49
50 {% trans "Don't forget to come over and cast your vote." %}
51 {% endtextcontent %}
52
53 {% endemail %}
54