summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-05-23 15:45:22 +0200
committerAurélien Bompard <aurelien@bompard.org>2013-05-23 17:48:16 +0200
commitea032ba8b321fad5e896750eae508456676041c1 (patch)
tree026c8af089391ecddd9dcae5a05d5ee9e07ad3a0 /hyperkitty/templates
parente9e92bf1ac15421b9a29c366b9ef6bf2c1b94943 (diff)
downloadhyperkitty-ea032ba8b321fad5e896750eae508456676041c1.tar.gz
hyperkitty-ea032ba8b321fad5e896750eae508456676041c1.tar.xz
hyperkitty-ea032ba8b321fad5e896750eae508456676041c1.zip
Display the last viewed threads in the user profile
Diffstat (limited to 'hyperkitty/templates')
-rw-r--r--hyperkitty/templates/ajax/last_views.html40
-rw-r--r--hyperkitty/templates/paginator.html4
-rw-r--r--hyperkitty/templates/user_profile.html16
3 files changed, 58 insertions, 2 deletions
diff --git a/hyperkitty/templates/ajax/last_views.html b/hyperkitty/templates/ajax/last_views.html
new file mode 100644
index 0000000..5455413
--- /dev/null
+++ b/hyperkitty/templates/ajax/last_views.html
@@ -0,0 +1,40 @@
+{% load url from future %}
+{% load i18n %}
+{% load hk_generic %}
+
+ {% if last_views %}
+ <table class="table table-striped table-bordered table-condensed">
+ <thead>
+ <tr>
+ <th></th>
+ <th>Subject</th>
+ <th>Original author</th>
+ <th>Start date</th>
+ <th>Last activity</th>
+ <th>Replies</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for lv in last_views %}
+ <tr>
+ <td>
+ {% if thread.unread %}
+ <i class="unread icon-eye-close" title="New comments"></i>
+ {% endif %}
+ </td>
+ <td><a href="{% url 'thread' mlist_fqdn=lv.list_address threadid=lv.threadid %}"
+ >{{ lv.thread.starting_email.subject }}</a></td>
+ <td>{{ lv.thread.starting_email.sender_name }}</td>
+ <td>{{ lv.thread.starting_email|viewer_date|date:"l, j F Y H:i:s" }}</td>
+ <td>{{ lv.thread|viewer_date|timesince }}</td>
+ <td>{{ lv.thread|length }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% include "paginator.html" with pager=last_views page_key="lvpage" %}
+ {% else %}
+ <p>Nothing read yet.</p>
+ {% endif %}
+
+{# vim: set noet: #}
diff --git a/hyperkitty/templates/paginator.html b/hyperkitty/templates/paginator.html
index a7559ec..358ae5d 100644
--- a/hyperkitty/templates/paginator.html
+++ b/hyperkitty/templates/paginator.html
@@ -2,7 +2,7 @@
<ul class="pager">
{% if pager.has_previous %}
<li>
- <a href="?page={{ pager.previous_page_number }}">
+ <a href="?{{ page_key|default:'page' }}={{ pager.previous_page_number }}">
{% else %}
<li class="disabled">
<a href="#">
@@ -12,7 +12,7 @@
{% if pager.has_next %}
<li>
- <a href="?page={{ pager.next_page_number }}">
+ <a href="?{{ page_key|default:'page' }}={{ pager.next_page_number }}">
{% else %}
<li class="disabled">
<a href="#">
diff --git a/hyperkitty/templates/user_profile.html b/hyperkitty/templates/user_profile.html
index f6a4d16..e84c72f 100644
--- a/hyperkitty/templates/user_profile.html
+++ b/hyperkitty/templates/user_profile.html
@@ -69,6 +69,11 @@
{% endif %}
+ <h3>Threads you have read</h3>
+ <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}img/ajax-loader.gif" />
+ <div class="views"></div>
+
+
<h3>Votes</h3>
<h4>Up Votes</h4>
{% if votes_up %}
@@ -112,4 +117,15 @@
{% endblock %}
+{% block additionaljs %}
+
+<script type="text/javascript">
+ $(document).ready(function() {
+ // Load the last views
+ update_last_views("{% url 'user_last_views' %}");
+ });
+</script>
+
+{% endblock %}
+
{# vim: set noet: #}