X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..df656ce4c8ae86e0be20cc6e497cbab1ae8ffb3b:/forum/skins/default/templates/notifications/digest.html
diff --git a/forum/skins/default/templates/notifications/digest.html b/forum/skins/default/templates/notifications/digest.html
index 2c98069..91757b8 100644
--- a/forum/skins/default/templates/notifications/digest.html
+++ b/forum/skins/default/templates/notifications/digest.html
@@ -1,79 +1,146 @@
-{% extends "email_base.html" %}
-{% load i18n %}
-{% load humanize %}
-{% load extra_tags %}
-
-{% block content %}
-
{% trans "Hello" %} {{ user.username }},
-
- {% blocktrans with settings.APP_SHORT_NAME as app_title %}
- This is the {{ digest_type }} activity digest for {{ app_title }}
- {% endblocktrans %}
-
- {% if new_users %}
-
- {% blocktrans with new_users|length as nusers_count and new_users|length|pluralize as nusers_count_pluralize and settings.APP_SHORT_NAME as app_title %}
- {{ nusers_count }} new user{{ nusers_count_pluralize }} joined the {{ app_title }} community:
- {% endblocktrans %}
-
-
- {% endif %}
-
- {% if activity_in_subscriptions %}
-
- {% blocktrans with activity_in_subscriptions|length as question_count and activity_in_subscriptions|length|pluralize as question_count_pluralize %}
- {{ question_count }} of your subscriptions have updates:
- {% endblocktrans %}
-
-
- {% for record in activity_in_subscriptions %}
- -
- {% trans "On question " %}{{ question_title }}" %} -
- {% if record.activity.answers %}
- {% blocktrans with record.activity.answers|length as answer_count and record.activity.answers|length|pluralize as answer_count_pluralize %}
- {{ answer_count }} new answer{{ answer_count_pluralize }}
- {% endblocktrans %},
- {% endif %}
- {% if record.activity.comments %}
- {% blocktrans with record.activity.comments|length as comment_count and record.activity.comments|length|pluralize as comment_count_pluralize %}
- {{ comment_count }} new comment{{ comment_count_pluralize }}
- {% endblocktrans %}
- {% if own_comments_only %}
- {% trans "on your own post(s)" %}
- {% endif %},
- {% endif %}
- {% if record.accepted %}
- {% trans "an answer was accepted" %}
- {% endif %}
-
- {% endfor %}
-
- {% endif %}
-
- {% if new_questions %}
-
- {% blocktrans with new_questions|length as question_count and new_questions|length|pluralize as question_count_pluralize%}
- {{ question_count }} new question{{ question_count_pluralize }}
- {% endblocktrans %}
- {% if watched_tags_only %}
- {% trans "matching your interesting tags" %}
- {% endif %}
- {% trans "posted :" %}
-
-
- {% for question in new_questions %}
- -
- {{ question.title }} -
- {% blocktrans with question.author.username as author_name and question.added_at|date:"D d M Y" as question_time %}
- Posted by {{ author_name }} in {{ question_time }}
- {% endblocktrans %}
-
- {% endfor %}
-
- {% endif %}
-
-{% endblock %}
\ No newline at end of file
+{% load i18n extra_tags email_tags %}
+
+{% declare %}
+ prefix = html.mark_safe(smart_str(settings.EMAIL_SUBJECT_PREFIX))
+ app_name = smart_unicode(settings.APP_SHORT_NAME)
+ app_url = settings.APP_URL
+
+ new_member_links = html.mark_safe(smart_unicode(", ".join([html.objlink(u, style=settings.EMAIL_ANCHOR_STYLE) for u in new_members])))
+ new_question_count = digest.count
+
+{% enddeclare %}
+
+{% email %}
+ {% subject %}{% blocktrans %}{{ prefix }} Daily digest{% endblocktrans %}{% endsubject %}
+
+ {% htmlcontent notifications/base.html %}
+ {% declare %}
+ new_questions_link = html.hyperlink(smart_unicode(app_url) + reverse('questions') + '?sort=' + _('latest'), smart_unicode(_('new questions')), style=a_style)
+ user_questions = digest.get_for_user(recipient)
+ subscribed_url = '%s%s' % (app_url, recipient.get_subscribed_url())
+ subscriptions_link = html.hyperlink(subscribed_url, _('subscriptions'), style=a_style)
+ {% enddeclare %}
+
+
+ {% blocktrans %}
+ This is a brief of what's going on the {{ app_name }} community since our last update.
+ {% endblocktrans %}
+
+
+ {% if new_member_count %}
+
+ {% if show_all_users %}
+ {% blocktrans %}
+ There are {{ new_member_count }} new members in the community. {{ new_member_links }} were the most active so far.
+ {% endblocktrans %}
+ {% else %}
+ {% blocktrans %}
+ {{ new_member_links }} have joined the {{ app_name }} community.
+ {% endblocktrans %}
+ {% endif %}
+ {% endif %}
+
+
+ {% if new_question_count %}
+
+
+ {% blocktrans %}
+ {{ new_question_count }} {{ new_questions_link }} were posted since our last update.
+ {% endblocktrans %}
+
+
+ {% if user_questions.interesting %}
+
+ {% trans "We think you might like the following questions:" %}
+
+
+ {% for q in user_questions.interesting %}
+ -
+ {{ q.title }}
+
+ {% endfor %}
+
+ {% endif %}
+
+ {% if user_questions.may_help %}
+
+ {% trans "These new questions didn't get many attention from the community, but we think you may be able to help:" %}
+
+
+ {% for q in user_questions.may_help %}
+ -
+ {{ q.title }}
+
+ {% endfor %}
+
+
+ {% if user_questions.subscriptions %}
+
+ {% blocktrans %}Meanwhile, some of your {{ subscriptions_link }} have new updates since you last visited them:{% endblocktrans %}
+
+
+ {% for q in user_questions.subscriptions %}
+ -
+ {{ q.title }}
+
+ {% endfor %}
+
+ {% endif %}
+
+ {% endif %}
+
+ {% endif %}
+
+ {% if recipient.is_superuser %}
+ {% declare %}
+ flagged_url = html.hyperlink(smart_unicode(app_url + reverse('admin_flagged_posts')), smart_unicode(str(flagged_count) + ' ' + _('posts')), style=a_style)
+ {% enddeclare %}
+
+ {% blocktrans %}
+ {{ flagged_url }} have been marked as flagged.
+ {% endblocktrans %}
+
+ {% endif %}
+
+ {% endhtmlcontent %}
+
+{% textcontent notifications/base_text.html %}
+{% blocktrans %}This is a brief of what's going on the {{ app_name }} community since our last update.{% endblocktrans %}
+
+{% if new_member_count %}
+{% if show_all_users %}
+{% blocktrans %}There are {{ new_member_count }} new members in the community. {{ new_member_links }} were the most active so far.{% endblocktrans %}
+{% else %}
+{% blocktrans %}{{ new_member_links }} have joined the {{ app_name }} community.{% endblocktrans %}
+{% endif %}
+{% endif %}
+
+{% if new_question_count %}
+{% blocktrans %}{{ new_question_count }} new questions were posted since our last update.{% endblocktrans %}
+
+{% if user_questions.interesting %}{% trans "We think you might like the following questions:" %}
+{% for q in user_questions.interesting %}
+* {{ q.title }}
+{% endfor %}
+{% endif %}
+
+{% if user_questions.may_help %}
+{% trans "These new questions didn't get many attention from the community, but we think you may be able to help:" %}
+{% for q in user_questions.may_help %}
+* {{ q.title }}
+{% endfor %}
+
+{% if user_questions.subscriptions %}
+{% blocktrans %}Meanwhile, some of your subscriptions have new updates since you last visited them:{% endblocktrans %}
+{% for q in user_questions.subscriptions %}
+* {{ q.title }}
+{% endfor %}
+{% endif %}
+{% endif %}
+{% endif %}
+
+{% if recipient.is_superuser %}
+{% blocktrans %}{{ flagged_count }} posts have been marked as flagged.{% endblocktrans %}
+{% endif %}
+{% endtextcontent %}
+{% endemail %}