diff --git a/src/postorius/doc/news.rst b/src/postorius/doc/news.rst index 0f52eca..ad70a9e 100644 --- a/src/postorius/doc/news.rst +++ b/src/postorius/doc/news.rst @@ -48,6 +48,7 @@ * renamed some menu items. Contributed by Richard Wackerbarth. * changed static file inclusion. Contributed by Richard Wackerbarth. * added delete domain feature. +* url conf refactoring. Contributed by Richard Wackerbarth. diff --git a/src/postorius/urls.py b/src/postorius/urls.py index 463c6ff..c5404f0 100644 --- a/src/postorius/urls.py +++ b/src/postorius/urls.py @@ -24,6 +24,40 @@ from postorius.views.generic import * +per_list_urlpatterns = patterns('postorius.views', + url(r'^members/(?P\d+)/$', + ListMembersView.as_view(), name='list_members_paged'), + url(r'^members/$', + ListMembersView.as_view(), name='list_members'), + url(r'^metrics$', + ListMetricsView.as_view(), name='list_metrics'), + url(r'^$', + ListSummaryView.as_view(), name='list_summary'), + url(r'^subscribe$', + ListSubsribeView.as_view(), name='list_subscribe'), + url(r'^unsubscribe/(?P[^/]+)$', + ListUnsubscribeView.as_view(), name='list_unsubscribe'), + url(r'^subscriptions$', + 'list_subscriptions', name='list_subscriptions'), + url(r'^mass_subscribe/$', + ListMassSubsribeView.as_view(), name='mass_subscribe'), + url(r'^delete$', + 'list_delete', name='list_delete'), + url(r'^held_messages/(?P[^/]+)/' + 'accept$', 'accept_held_message', name='accept_held_message'), + url(r'^held_messages/(?P[^/]+)/' + 'discard$', 'discard_held_message', name='discard_held_message'), + url(r'^held_messages/(?P[^/]+)/' + 'defer$', 'defer_held_message', name='defer_held_message'), + url(r'^held_messages/(?P[^/]+)/' + 'reject$', 'reject_held_message', name='reject_held_message'), + url(r'^held_messages$', + 'list_held_messages', name='list_held_messages'), + url(r'^settings/(?P[^/]+)?' + '(?:/(?P.*))?$', 'list_settings', + name='list_settings'), +) + urlpatterns = patterns( 'postorius.views', (r'^$', 'list_index'), @@ -46,41 +80,10 @@ # /lists/ url(r'^lists/$', 'list_index', name='list_index'), url(r'^lists/new/$', 'list_new', name='list_new'), - url(r'^lists/(?P[^/]+)/members/(?P\d+)/$', - ListMembersView.as_view(), name='list_members_paged'), - url(r'^lists/(?P[^/]+)/members/$', - ListMembersView.as_view(), name='list_members'), - url(r'^lists/(?P[^/]+)/metrics$', - ListMetricsView.as_view(), name='list_metrics'), - url(r'^lists/(?P[^/]+)/$', - ListSummaryView.as_view(), name='list_summary'), - url(r'^lists/(?P[^/]+)/subscribe$', - ListSubsribeView.as_view(), name='list_subscribe'), - url(r'^lists/(?P[^/]+)/unsubscribe/(?P[^/]+)$', - ListUnsubscribeView.as_view(), name='list_unsubscribe'), - url(r'^lists/(?P[^/]+)/subscriptions$', - 'list_subscriptions', name='list_subscriptions'), - url(r'^lists/(?P[^/]+)/mass_subscribe/$', - ListMassSubsribeView.as_view(), name='mass_subscribe'), - url(r'^lists/(?P[^/]+)/delete$', - 'list_delete', name='list_delete'), - url(r'^lists/(?P[^/]+)/held_messages/(?P[^/]+)/' - 'accept$', 'accept_held_message', name='accept_held_message'), - url(r'^lists/(?P[^/]+)/held_messages/(?P[^/]+)/' - 'discard$', 'discard_held_message', name='discard_held_message'), - url(r'^lists/(?P[^/]+)/held_messages/(?P[^/]+)/' - 'defer$', 'defer_held_message', name='defer_held_message'), - url(r'^lists/(?P[^/]+)/held_messages/(?P[^/]+)/' - 'reject$', 'reject_held_message', name='reject_held_message'), - url(r'^lists/(?P[^/]+)/held_messages$', - 'list_held_messages', name='list_held_messages'), url(r'^user_settings/$', 'user_settings', kwargs={"tab": "user"}, name='user_settings'), - url(r'^lists/(?P[^/]+)/settings/(?P[^/]+)?' - '(?:/(?P.*))?$', 'list_settings', - name='list_settings'), url(r'^more_info/(?P[^/]+)/(?P[^/]+)$', 'more_info_tab', name='more_info_tab'), - + url(r'^lists/(?P[^/]+)/', include(per_list_urlpatterns)), # /users/ url(r'^users/(?P\d+)/$', 'user_index', name='user_index_paged'), url(r'^users/$', 'user_index', name='user_index'),