summaryrefslogtreecommitdiffstats
path: root/hyperkitty/urls.py
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-02-04 11:55:03 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-02-04 12:57:51 +0100
commit1ab795172026bc585b890f8e53f56b68f6541fe6 (patch)
tree15acfb56077c60a946f1060e69cb979ee05d2a0b /hyperkitty/urls.py
parent238d19f7e09bfa754f4b91622f1c34d08f2ef26d (diff)
downloadhyperkitty-1ab795172026bc585b890f8e53f56b68f6541fe6.tar.gz
hyperkitty-1ab795172026bc585b890f8e53f56b68f6541fe6.tar.xz
hyperkitty-1ab795172026bc585b890f8e53f56b68f6541fe6.zip
Rethink urls to be more hierarchic and less RPC
Diffstat (limited to 'hyperkitty/urls.py')
-rw-r--r--hyperkitty/urls.py78
1 files changed, 31 insertions, 47 deletions
diff --git a/hyperkitty/urls.py b/hyperkitty/urls.py
index 10b52ba..ae38fe7 100644
--- a/hyperkitty/urls.py
+++ b/hyperkitty/urls.py
@@ -44,71 +44,55 @@ 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'),
- ### 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: