summaryrefslogtreecommitdiffstats
path: root/hyperkitty/views
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2012-10-05 15:01:59 +0200
committerAurélien Bompard <aurelien@bompard.org>2012-10-05 15:01:59 +0200
commitc7570addec98c4e7695d83202650b9296e47c957 (patch)
tree147cd9e6e981acdd11efd6fd3950d8f936f8ae42 /hyperkitty/views
parentcd1a2d5f2ec738ab2f17c86dcabe8733a682aa4f (diff)
downloadhyperkitty-c7570addec98c4e7695d83202650b9296e47c957.tar.gz
hyperkitty-c7570addec98c4e7695d83202650b9296e47c957.tar.xz
hyperkitty-c7570addec98c4e7695d83202650b9296e47c957.zip
Improve appearance
Diffstat (limited to 'hyperkitty/views')
-rw-r--r--hyperkitty/views/list.py8
-rw-r--r--hyperkitty/views/thread.py14
2 files changed, 11 insertions, 11 deletions
diff --git a/hyperkitty/views/list.py b/hyperkitty/views/list.py
index 134ee23..d8ea29a 100644
--- a/hyperkitty/views/list.py
+++ b/hyperkitty/views/list.py
@@ -82,11 +82,11 @@ def archives(request, mlist_fqdn, year=None, month=None, day=None):
begin_date = datetime(today.year, today.month, 1)
end_date = datetime(today.year, today.month + 1, 1)
month_string = 'Past thirty days'
- list_name = mlist_fqdn.split('@')[0]
search_form = SearchForm(auto_id=False)
t = loader.get_template('month_view.html')
store = get_store(request)
+ mlist = store.get_list(mlist_fqdn)
threads = store.get_threads(mlist_fqdn, start=begin_date,
end=end_date)
@@ -159,7 +159,7 @@ def archives(request, mlist_fqdn, year=None, month=None, day=None):
archives_length = get_months(store, mlist_fqdn)
c = RequestContext(request, {
- 'list_name' : list_name,
+ 'mlist' : mlist,
'objects': threads.object_list,
'page': pageNo,
'has_previous': threads.has_previous(),
@@ -184,7 +184,6 @@ def list(request, mlist_fqdn=None):
return HttpResponseRedirect('/')
t = loader.get_template('recent_activities.html')
search_form = SearchForm(auto_id=False)
- list_name = mlist_fqdn.split('@')[0]
# Get stats for last 30 days
today = datetime.utcnow()
@@ -192,6 +191,7 @@ def list(request, mlist_fqdn=None):
begin_date = end_date - timedelta(days=32)
store = get_store(request)
+ mlist = store.get_list(mlist_fqdn)
threads = store.get_threads(list_name=mlist_fqdn, start=begin_date,
end=end_date)
@@ -253,7 +253,7 @@ def list(request, mlist_fqdn=None):
threads_per_category = {}
c = RequestContext(request, {
- 'list_name' : list_name,
+ 'mlist' : mlist,
'list_address': mlist_fqdn,
'search_form': search_form,
'month': 'Recent activity',
diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py
index 48106d0..397a158 100644
--- a/hyperkitty/views/thread.py
+++ b/hyperkitty/views/thread.py
@@ -32,24 +32,20 @@ from django.contrib.auth.decorators import (login_required,
from hyperkitty.models import Rating, Tag
#from hyperkitty.lib.mockup import *
from forms import *
-from hyperkitty.lib import get_months, get_store
+from hyperkitty.lib import get_months, get_store, stripped_subject
def thread_index (request, mlist_fqdn, threadid):
''' Displays all the email for a given thread identifier '''
- list_name = mlist_fqdn.split('@')[0]
-
search_form = SearchForm(auto_id=False)
t = loader.get_template('thread.html')
store = get_store(request)
messages = store.get_messages_in_thread(mlist_fqdn, threadid)
if not messages:
raise Http404
- #prev_thread = mongo.get_thread_name(list_name, int(threadid) - 1)
prev_thread = []
if len(prev_thread) > 30:
prev_thread = '%s...' % prev_thread[:31]
- #next_thread = mongo.get_thread_name(list_name, int(threadid) + 1)
next_thread = []
if len(next_thread) > 30:
next_thread = '%s...' % next_thread[:31]
@@ -100,9 +96,13 @@ def thread_index (request, mlist_fqdn, threadid):
days_old = today - messages[0].date.date()
days_inactive = today - messages[-1].date.date()
+ mlist = store.get_list(mlist_fqdn)
+ subject = stripped_subject(mlist, messages[0].subject)
+
c = RequestContext(request, {
- 'list_name' : list_name,
+ 'mlist' : mlist,
'threadid' : threadid,
+ 'subject': subject,
'tags' : tags,
'list_address': mlist_fqdn,
'search_form': search_form,
@@ -137,7 +137,7 @@ def add_tag(request, mlist_fqdn, email_id):
try:
tag_obj = Tag.objects.get(threadid=email_id, list_address=mlist_fqdn, tag=tag)
except Tag.DoesNotExist:
- tag_obj = Tag(list_address=mlist_fqdn, threadid=email_id, tag=tag)
+ tag_obj = Tag(list_address=mlist_fqdn, threadid=email_id, tag=tag)
tag_obj.save()
response_dict = { }