summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hyperkitty/static/css/hyperkitty.css2
-rw-r--r--hyperkitty/templates/index.html11
-rw-r--r--hyperkitty/templates/messages/like_form.html3
-rw-r--r--hyperkitty/templates/recent_activities.html2
-rw-r--r--hyperkitty/urls.py81
-rw-r--r--hyperkitty/views/list.py4
-rw-r--r--hyperkitty/views/message.py3
-rw-r--r--hyperkitty/views/pages.py4
8 files changed, 50 insertions, 60 deletions
diff --git a/hyperkitty/static/css/hyperkitty.css b/hyperkitty/static/css/hyperkitty.css
index c12111c..c6aefa1 100644
--- a/hyperkitty/static/css/hyperkitty.css
+++ b/hyperkitty/static/css/hyperkitty.css
@@ -36,10 +36,12 @@ ul.lists li a {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
+ color: black;
}
ul.lists li a:hover {
text-decoration: none;
background-color: #eee;
+ color: black;
}
diff --git a/hyperkitty/templates/index.html b/hyperkitty/templates/index.html
index 909675a..dee58a5 100644
--- a/hyperkitty/templates/index.html
+++ b/hyperkitty/templates/index.html
@@ -14,9 +14,14 @@
<ul class="lists unstyled">
{% for mlist in lists %}
<li>
- <a href="{% url list_overview mlist_fqdn=mlist %}">
- <p class="list-name">{{ mlist }}</p>
- <p>overview{% if mlist.display_name %} of {{ mlist.display_name }}{% endif %}</p>
+ <a href="{% url list_overview mlist_fqdn=mlist.name %}">
+ <p class="list-name">{{ mlist.name }}</p>
+ {% if mlist.display_name %}
+ <p>{{ mlist.display_name }}</p>
+ {% endif %}
+ {% if mlist.description %}
+ <p>{{ mlist.description }}</p>
+ {% endif %}
</a>
</li>
{% endfor %}
diff --git a/hyperkitty/templates/messages/like_form.html b/hyperkitty/templates/messages/like_form.html
index ba78ede..3b99987 100644
--- a/hyperkitty/templates/messages/like_form.html
+++ b/hyperkitty/templates/messages/like_form.html
@@ -1,6 +1,5 @@
<form method="post" class="likeform"
- action="{% url message_vote mlist_fqdn=list_address %}">
- <input type="hidden" name="hashid" value="{{ hashid }}" />
+ action="{% url message_vote mlist_fqdn=list_address, hashid=hashid %}">
{% csrf_token %}
<li class="likestatus {{ object.likestatus }}">
+<span class="likecount">{{ object.likes }}</span>/-<span class="dislikecount">{{ object.dislikes }}</span>
diff --git a/hyperkitty/templates/recent_activities.html b/hyperkitty/templates/recent_activities.html
index 70d944a..37b0693 100644
--- a/hyperkitty/templates/recent_activities.html
+++ b/hyperkitty/templates/recent_activities.html
@@ -24,7 +24,7 @@
activity_graph(
["{{dates_string|join:'","'}}"],
{{evolution}},
- "{% url archives mlist_fqdn=list_address %}"
+ "{% url archives_latest mlist_fqdn=list_address %}"
);
</script>
</div>
diff --git a/hyperkitty/urls.py b/hyperkitty/urls.py
index 032a2a1..591ad41 100644
--- a/hyperkitty/urls.py
+++ b/hyperkitty/urls.py
@@ -44,74 +44,57 @@ urlpatterns = patterns('hyperkitty.views',
url(r'^/$', 'pages.index', name='index'),
url(r'^$', 'pages.index', name='root'),
- # Archives
- url(r'^archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)/(?P<day>\d\d?)/$',
+ # List archives and overview
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/(?P<year>\d{4})/(?P<month>\d\d?)/(?P<day>\d\d?)/$',
'list.archives', name='archives_with_day'),
- url(r'^archives/(?P<mlist_fqdn>.*@.*)/(?P<year>\d{4})/(?P<month>\d\d?)/$',
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/(?P<year>\d{4})/(?P<month>\d\d?)/$',
'list.archives', name='archives_with_month'),
- url(r'^archives/(?P<mlist_fqdn>.*@.*)/$',
- 'list.archives', name='archives'),
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/latest$',
+ 'list.archives', name='archives_latest'),
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/$',
+ 'list.overview', name='list_overview'),
- # Lists
- url(r'^list/$', 'pages.index'), # Can I remove this URL?
- url(r'^list/(?P<mlist_fqdn>.*@.*)/$',
- 'list.list', name='list_overview'),
-
- # Search Tag
- url(r'^tag/(?P<mlist_fqdn>.*@.*)\/(?P<tag>.*)\/(?P<page>\d+)/$',
- 'list.search_tag'),
- url(r'^tag/(?P<mlist_fqdn>.*@.*)\/(?P<tag>.*)/$',
- 'list.search_tag', name='search_tag'),
-
- # Search
- # If page number is present in URL
- url(r'^search/(?P<mlist_fqdn>.*@.*)\/(?P<target>.*)\/(?P<keyword>.*)\/(?P<page>\d+)/$',
- 'list.search_keyword'),
- # Show the first page as default when no page number is present in URL
- url(r'^search/(?P<mlist_fqdn>.*@.*)\/(?P<target>.*)\/(?P<keyword>.*)/$',
- 'list.search_keyword', name="search_keyword"),
- url(r'^search/(?P<mlist_fqdn>.*@.*)/$',
- 'list.search', name="search_list"),
-
-
- ### MESSAGE LEVEL VIEWS ###
- url(r'^message/(?P<mlist_fqdn>.*@.*)/(?P<hashid>\w+)/$',
+ # Message
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/message/(?P<hashid>\w+)/$',
'message.index', name='message_index'),
-
- url(r'^message/(?P<mlist_fqdn>.*@.*)/(?P<hashid>\w+)/attachment/(?P<counter>\d+)/(?P<filename>.+)$',
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/message/(?P<hashid>\w+)/attachment/(?P<counter>\d+)/(?P<filename>.+)$',
'message.attachment', name='message_attachment'),
-
- url(r'^vote/(?P<mlist_fqdn>.*@.*)/$',
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/message/(?P<hashid>\w+)/vote$',
'message.vote', name='message_vote'),
-
- url(r'^message/(?P<mlist_fqdn>.*@.*)/(?P<message_id>\w+)/reply$',
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/message/(?P<message_id>\w+)/reply$',
'message.reply', name='message_reply'),
- ### MESSAGE LEVEL VIEW ENDS ###
-
-
- ### THREAD LEVEL VIEWS ###
- # Thread view page
- url(r'^thread/(?P<mlist_fqdn>.*@.*)/(?P<threadid>.+)/$',
+ # Thread
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/thread/(?P<threadid>\w+)/$',
'thread.thread_index', name='thread'),
- # Add Tag to a thread
- url(r'^thread/(?P<mlist_fqdn>.*@.*)\/(?P<threadid>.*)/addtag$',
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/thread/(?P<threadid>\w+)/addtag$',
'thread.add_tag', name='add_tag'),
- # Thread favorites
- url(r'^thread/(?P<mlist_fqdn>.*@.*)\/(?P<threadid>.*)/favorite$',
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/thread/(?P<threadid>\w+)/favorite$',
'thread.favorite', name='favorite'),
- ### THREAD LEVEL VIEW ENDS ###
+ # Search Tag
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/tag/(?P<tag>.*)/(?P<page>\d+)/$',
+ 'list.search_tag'),
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/tag/(?P<tag>.*)/$',
+ 'list.search_tag', name='search_tag'),
+
+ # Search
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/search/(?P<target>.*)/(?P<keyword>.*)/(?P<page>\d+)/$',
+ 'list.search_keyword'),
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/search/(?P<target>.*)/(?P<keyword>.*)/$',
+ 'list.search_keyword', name="search_keyword"),
+ url(r'^list/(?P<mlist_fqdn>[^/@]+@[^/@]+)/search/$',
+ 'list.search', name="search_list"),
# REST API
url(r'^api/$', 'api.api'),
- url(r'^api/email\/(?P<mlist_fqdn>.*@.*)\/(?P<hashid>.*)/',
+ url(r'^api/email\/(?P<mlist_fqdn>[^/@]+@[^/@]+)\/(?P<hashid>.*)/',
EmailResource.as_view(), name="api_email"),
- url(r'^api/thread\/(?P<mlist_fqdn>.*@.*)\/(?P<threadid>.*)/',
+ url(r'^api/thread\/(?P<mlist_fqdn>[^/@]+@[^/@]+)\/(?P<threadid>.*)/',
ThreadResource.as_view(), name="api_thread"),
- url(r'^api/search\/(?P<mlist_fqdn>.*@.*)\/(?P<field>.*)\/(?P<keyword>.*)/',
+ url(r'^api/search\/(?P<mlist_fqdn>[^/@]+@[^/@]+)\/(?P<field>.*)\/(?P<keyword>.*)/',
SearchResource.as_view(), name="api_search"),
# Uncomment the admin/doc line below to enable admin documentation:
diff --git a/hyperkitty/views/list.py b/hyperkitty/views/list.py
index dc846cc..9e7a90a 100644
--- a/hyperkitty/views/list.py
+++ b/hyperkitty/views/list.py
@@ -177,7 +177,9 @@ def archives(request, mlist_fqdn, year=None, month=None, day=None):
})
return HttpResponse(t.render(c))
-def list(request, mlist_fqdn=None):
+
+
+def overview(request, mlist_fqdn=None):
if not mlist_fqdn:
return HttpResponseRedirect('/')
t = loader.get_template('recent_activities.html')
diff --git a/hyperkitty/views/message.py b/hyperkitty/views/message.py
index c278ac5..509205c 100644
--- a/hyperkitty/views/message.py
+++ b/hyperkitty/views/message.py
@@ -124,14 +124,13 @@ def attachment(request, mlist_fqdn, hashid, counter, filename):
return response
-def vote(request, mlist_fqdn):
+def vote(request, mlist_fqdn, hashid):
""" Add a rating to a given message identified by messageid. """
if not request.user.is_authenticated():
return HttpResponse('You must be logged in to vote',
content_type="text/plain", status=403)
value = int(request.POST['vote'])
- hashid = request.POST['hashid']
# Checks if the user has already voted for a this message.
try:
diff --git a/hyperkitty/views/pages.py b/hyperkitty/views/pages.py
index c444cfd..4fc27d4 100644
--- a/hyperkitty/views/pages.py
+++ b/hyperkitty/views/pages.py
@@ -49,10 +49,10 @@ def index(request):
'username': settings.MAILMAN_USER, 'password': settings.MAILMAN_PASS}
store = get_store(request)
- list_data = store.get_list_names()
+ lists = store.get_lists()
c = RequestContext(request, {
- 'lists': list_data,
+ 'lists': lists,
'search_form': search_form,
})
return HttpResponse(t.render(c))