summaryrefslogtreecommitdiffstats
path: root/forum/skins/default/templates/instant_notification.html
blob: 1bab99cfe8f7d189c384146eae47ddcab11cd298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{% comment %}
Called from forum.models.__init__.maybe_send_instant_notifications()
Template paramaters:

receiving_user - User
update_author - User
updated_post - Comment|Answer|Question
related_origin_post - origin post related to the update
update_url - absolute url (including http://... to updated post
update_type - question_comment|answer_comment|answer_update|question_update
revision_number - integer (first revision is 1)
has_mention - Boolean 
{% endcomment %}
{% load i18n %} 
{% load smart_if %}
{% blocktrans with receiving_user.get_best_name as user_name %}Dear {{user_name}},{% endblocktrans %}

{% if has_mention %}
    {% if update_type == 'question_comment' or update_type == 'answer_comment' %}
    {% blocktrans with post_author.get_profile_link as author_link and related_origin_post.get_absolute_url as origin_post_url and related_origin_post.title as origin_post_title %}
    {{author_link}} has left you a <a href="{{update_url}}">comment</a>
    related to question <a href="{{origin_post_url}}">{{origin_post_title}}</a>
    {% endblocktrans %}
    {% endif %}
{% else %}{# updated post has no mention of user #}
    {% if update_type == 'question_comment' or update_type == 'answer_comment' %}
    {% blocktrans with post_author.get_profile_link as author_link and related_origin_post.get_absolute_url as origin_post_url and related_origin_post.title as origin_post_title %}
    {{author_link}} has left a new <a href="{{update_url}}">comment</a>
    related to question <a href="{{origin_post_url}}">{{origin_post_title}}</a>
    {% endblocktrans %}
    {% endif %}
{% endif %}