summaryrefslogtreecommitdiffstats
path: root/hyperkitty/views
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2012-10-09 18:04:40 +0200
committerAurélien Bompard <aurelien@bompard.org>2012-10-09 18:04:40 +0200
commit1cc470db0151443fda2ba06e450d6a6cc82a2d90 (patch)
tree468c503017fc482f091cb515530f4dfd7d242416 /hyperkitty/views
parente100457ddce07e3546bde6144c7095c56aebc691 (diff)
downloadhyperkitty-1cc470db0151443fda2ba06e450d6a6cc82a2d90.tar.gz
hyperkitty-1cc470db0151443fda2ba06e450d6a6cc82a2d90.tar.xz
hyperkitty-1cc470db0151443fda2ba06e450d6a6cc82a2d90.zip
Add thread navigation buttons
Diffstat (limited to 'hyperkitty/views')
-rw-r--r--hyperkitty/views/thread.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py
index 397a158..558e51d 100644
--- a/hyperkitty/views/thread.py
+++ b/hyperkitty/views/thread.py
@@ -43,12 +43,7 @@ def thread_index (request, mlist_fqdn, threadid):
messages = store.get_messages_in_thread(mlist_fqdn, threadid)
if not messages:
raise Http404
- prev_thread = []
- if len(prev_thread) > 30:
- prev_thread = '%s...' % prev_thread[:31]
- next_thread = []
- if len(next_thread) > 30:
- next_thread = '%s...' % next_thread[:31]
+ prev_thread, next_thread = store.get_thread_neighbors(mlist_fqdn, threadid)
participants = {}
cnt = 0
@@ -112,10 +107,7 @@ def thread_index (request, mlist_fqdn, threadid):
'answers': cnt,
'first_mail': messages[0],
'replies': messages[1:],
- 'next_thread': next_thread,
- 'next_thread_id': 0,
- 'prev_thread': prev_thread,
- 'prev_thread_id': 0,
+ 'neighbors': (prev_thread, next_thread),
'archives_length': archives_length,
'days_inactive': days_inactive.days,
'days_old': days_old.days,