diff --git a/src/super_archives/templates/superarchives/thread-dashboard.html b/src/super_archives/templates/superarchives/thread-dashboard.html
index 56d30f5..e51b56f 100644
--- a/src/super_archives/templates/superarchives/thread-dashboard.html
+++ b/src/super_archives/templates/superarchives/thread-dashboard.html
@@ -5,9 +5,9 @@
{% trans 'Groups'|title %}
- {% for listname, latest, most_relevant in lists %}
+ {% for listname, description, latest, most_relevant in lists %}
{% if latest or most_relevant %}
- {{ listname|title }}
+ {{ listname|title }} {% if description %} ({{ description }}){% endif %}
diff --git a/src/super_archives/views.py b/src/super_archives/views.py
index 80ff3de..4a96a43 100644
--- a/src/super_archives/views.py
+++ b/src/super_archives/views.py
@@ -20,11 +20,20 @@ from django.shortcuts import render, redirect, get_object_or_404
from haystack.query import SearchQuerySet
+from accounts.utils import mailman
from .utils.email import send_verification_email
from .models import MailingList, Thread, EmailAddress, \
EmailAddressValidation, Message
+def get_description(all_lists, listname_):
+ # if not isinstance(all_lists[0], (tuple, list, dict)):
+ # return
+ for listname, description in all_lists:
+ if listname == listname_:
+ return description
+
+
class ThreadView(View):
http_method_names = [u'get', u'post']
@@ -120,12 +129,14 @@ class ThreadDashboardView(View):
def get(self, request):
MAX = 6
context = {}
+ all_lists = mailman.all_lists(description=1)
context['lists'] = []
lists = MailingList.objects.filter()
for list_ in MailingList.objects.order_by('name'):
context['lists'].append((
list_.name,
+ get_description(all_lists, list_.name),
list_.thread_set.filter(spam=False).order_by(
'-latest_message__received_time'
)[:MAX],
--
libgit2 0.21.2