summaryrefslogtreecommitdiffstats
path: root/views/pages.py
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2012-04-11 21:49:04 +0200
committerPierre-Yves Chibon <pingou@pingoured.fr>2012-04-11 21:49:04 +0200
commitacafdc28ea59196dbdfb69dacc29b0d440fa8de1 (patch)
tree40adc169b296e8c1fd89e487f3919c676a431ee9 /views/pages.py
parent263d3cd1bd59548f70b151db7a7f5263978b23ca (diff)
downloadhyperkitty-acafdc28ea59196dbdfb69dacc29b0d440fa8de1.tar.gz
hyperkitty-acafdc28ea59196dbdfb69dacc29b0d440fa8de1.tar.xz
hyperkitty-acafdc28ea59196dbdfb69dacc29b0d440fa8de1.zip
Add an overview of the recent activities on the list
Diffstat (limited to 'views/pages.py')
-rw-r--r--views/pages.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/views/pages.py b/views/pages.py
index f2d0fb2..d7ef140 100644
--- a/views/pages.py
+++ b/views/pages.py
@@ -140,9 +140,15 @@ def list(request, mlist_fqdn=None):
end=end_date)
participants = set()
+ dates = {}
cnt = 0
for msg in threads:
msg = Bunch(msg)
+ key = '%s%s%s' % (msg.Date.year, msg.Date.month, msg.Date.day)
+ if key in dates:
+ dates[key] = dates[key] + 1
+ else:
+ dates[key] = 1
# Statistics on how many participants and threads this month
participants.add(msg['From'])
msg.participants = mongo.get_thread_participants(list_name,
@@ -166,6 +172,11 @@ def list(request, mlist_fqdn=None):
authors = sorted(authors, key=lambda author: author.kudos)
authors.reverse()
+ # Get the list activity per day
+ days = dates.keys()
+ days.sort()
+ evolution = [dates[key] for key in days]
+
# threads per category is the top thread titles in each category
threads_per_category = generate_thread_per_category()
c = RequestContext(request, {
@@ -181,6 +192,7 @@ def list(request, mlist_fqdn=None):
'top_author': authors,
'threads_per_category': threads_per_category,
'archives_length': archives_length,
+ 'evolution' : evolution,
})
return HttpResponse(t.render(c))