Skip to content
Browse files

add back django-notification templates

  • Loading branch information...
1 parent c15b68b commit ad3b8a68a3537b241023239c55159dad61e18918 @lukeman lukeman committed Nov 29, 2011
View
5 pinax_theme_bootstrap/templates/notification/base.html
@@ -2,11 +2,16 @@
{% load i18n %}
+{% block extra_head %}
+ <link rel="alternate" type="application/atom+xml" title="Notices Feed" href="{% url notification_feed_for_user %}" />
+{% endblock %}
+
{% block body_class %}notices{% endblock %}
{% block subnav %}
<h1>{% trans "Notices" %}</h1>
<ul>
+ <li><a href="{% url notification_notices %}">{% trans "Notices" %}</a></li>
<li><a href="{% url notification_notice_settings %}">{% trans "Settings" %}</a></li>
</ul>
{% endblock %}
View
42 pinax_theme_bootstrap/templates/notification/notices.html
@@ -0,0 +1,42 @@
+{% extends "notification/base.html" %}
+
+{% load humanize %}
+{% load i18n %}
+{% load pagination_tags %}
+{% load timezone_filters %}
+
+{% block head_title %}{% trans "Notices" %}{% endblock %}
+
+{% block body %}
+
+ {% autopaginate notices %}
+
+ {% if notices %}
+ <a href="{% url notification_mark_all_seen %}">{% trans "Mark all unseen notices seen" %}</a>
+
+ {# TODO: get timezone support working with regroup #}
+ {% regroup notices by added.date as notices_by_date %}
+
+ {% for date in notices_by_date %}
+ <h2 class="notice_date">{{ date.grouper|naturalday:_("MONTH_DAY_FORMAT")|capfirst }}</h2>
+
+ {% for notice in date.list %}
+ {% if notice.is_unseen %}
+ <div class="unseen_notice">
+ {% else %}
+ <div class="notice">
+ {% endif %}
+ <span class="notice_type">[{% trans notice.notice_type.display %}]</span>
+ <span class="notice_message">{{ notice.message|safe }}</span>
+ <span class="notice_time">{{ notice.added|localtime:account.timezone|time:"P" }}</span>
+ </div>
+ {% endfor %}
+ {% endfor %}
+
+ {% paginate %}
+
+ {% else %}
+ <p>{% trans "No notices." %}</p>
+ {% endif %}
+
+{% endblock %}

0 comments on commit ad3b8a6

Please sign in to comment.
Something went wrong with that request. Please try again.