Skip to content

Instantly share code, notes, and snippets.

@crosalot
Created September 24, 2012 09:56
Show Gist options
  • Save crosalot/3775229 to your computer and use it in GitHub Desktop.
Save crosalot/3775229 to your computer and use it in GitHub Desktop.
MTD notify template
{% load common_tags %}
{% load i18n %}
<li class="notification-item service-{{ notification.service|to_ }}{% if notification.status == notification.STATUS_NEW %} notification-new{% endif %} clearfix">
{% if notification.service == 'Relationship' %}
{{ notification.src_user|fullnamelink }} {% trans 'followed you' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'Goal' %}
{{ notification.src_user|fullnamelink }} {% trans 'created' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'New Goal' %} </a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalSuccess' %}
{{ notification.src_user|fullnamelink }} {% trans 'success' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Goal' %}</a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'Todo' %}
{{ notification.src_user|fullnamelink }} {% trans 'updated' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Todo' %}</a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'TodoSuccess' %}
{{ notification.src_user|fullnamelink }} {% trans 'success' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Todo' %}</a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'CheerGoal' %}
{{ notification.src_user|fullnamelink }} {% trans 'cheer in' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Your Goal' %}</a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'ApproveGoal' %}
{{ notification.src_user|fullnamelink }} {% trans 'approve in' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Your Goal' %}</a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'CommentGoal' %}
{{ notification.src_user|fullnamelink }} {% trans 'commented in' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Your Goal' %}</a>:<br /> "{{ notification.data }}" <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'CommentGoalComment' %}
{{ notification.src_user|fullnamelink }} {% trans 'commented in' %} <a href="{% url goal_view notification.reference_id %}">{% trans 'Your Comment' %}</a>:<br /> "{{ notification.data }}" <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'Reward' %}
{% trans 'You have earn' %} <a href="{% url account_profile_reward notification.dst_user.username %}">{{ notification.medal.title }}</a> <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalDueDateSixMonth' %}
<a href="{% url goal_view notification.object_id %}">{% trans 'Your Goal' %}</a> {% trans 'near to due dates in' %} {% trans 'six months' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalDueDateTreeMonth' %}
<a href="{% url goal_view notification.object_id %}">{% trans 'Your Goal' %}</a> {% trans 'near to due dates in' %} {% trans 'tree months' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalDueDateMonth' %}
<a href="{% url goal_view notification.object_id %}">{% trans 'Your Goal' %}</a> {% trans 'near to due dates in' %} {% trans 'next month' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalDueDateWeek' %}
<a href="{% url goal_view notification.object_id %}">{% trans 'Your Goal' %}</a> {% trans 'near to due dates in' %} {% trans 'next week' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalDueDateTomorrow' %}
<a href="{% url goal_view notification.object_id %}">{% trans 'Your Goal' %}</a> {% trans 'near to due dates on' %} {% trans 'tomorrow' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'GoalFail' %}
<a href="{% url goal_view notification.object_id %}">{% trans 'Your Goal' %}</a> {% trans 'fail' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% endif %}
</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment