Adjusted app prefix in urls.py (outsource in global urls.py). Some code formatting.

This commit is contained in:
Emanuel Schuetze 2012-04-13 21:43:16 +02:00
parent 639397028e
commit a1c5766e7a
5 changed files with 280 additions and 128 deletions

View File

@ -13,7 +13,7 @@
from django.conf.urls.defaults import *
from agenda.views import Overview, View, SetActive, SetClosed, ItemUpdate, ItemCreate, ItemDelete, ItemPDF
urlpatterns = patterns('agenda.views',
urlpatterns = patterns('',
url(r'^$',
Overview.as_view(),
name='item_overview',

View File

@ -15,82 +15,125 @@ from django.utils.translation import ugettext as _
from application.views import ViewPoll, ActivatePoll
urlpatterns = patterns('application.views',
url(r'^application/$', 'overview', \
name='application_overview'),
url(r'^$',
'overview',
name='application_overview',
),
url(r'^application/(?P<application_id>\d+)/$', 'view', \
name='application_view'),
url(r'^(?P<application_id>\d+)/$',
'view',
name='application_view',
),
url(r'^application/(?P<application_id>\d+)/newest/$', 'view', {'newest': True}, \
name='application_view_newest'),
url(r'^(?P<application_id>\d+)/newest/$',
'view',
{'newest': True},
name='application_view_newest',
),
url(r'^application/new/$', 'edit', \
name='application_new'),
url(r'^new/$',
'edit',
name='application_new',
),
url(r'^application/import/$', 'application_import', \
name='application_import'),
url(r'^import/$',
'application_import',
name='application_import',
),
url(r'^application/(?P<application_id>\d+)/edit/$', 'edit', \
name='application_edit'),
url(r'^(?P<application_id>\d+)/edit/$',
'edit',
name='application_edit',
),
url(r'^application/(?P<application_id>\d+)/del/$', 'delete', \
name='application_delete'),
url(r'^(?P<application_id>\d+)/del/$',
'delete',
name='application_delete',
),
url(r'^application/(?P<application_id>\d+)/setnumber/$', 'set_number', \
name='application_set_number'),
url(r'^(?P<application_id>\d+)/setnumber/$',
'set_number',
name='application_set_number',
),
url(r'^application/(?P<application_id>\d+)/setstatus/' \
'(?P<status>[a-z]{3})/$', 'set_status', \
name='application_set_status'),
url(r'^(?P<application_id>\d+)/setstatus/' '(?P<status>[a-z]{3})/$',
'set_status',
name='application_set_status',
),
url(r'^application/(?P<application_id>\d+)/permit/$', 'permit', \
name='application_permit'),
url(r'^(?P<application_id>\d+)/permit/$',
'permit',
name='application_permit',
),
url(r'^application/version/(?P<aversion_id>\d+)/permit/$', 'permit_version', \
name='application_version_permit'),
url(r'^version/(?P<aversion_id>\d+)/permit/$',
'permit_version',
name='application_version_permit',
),
url(r'^application/version/(?P<aversion_id>\d+)/reject/$', 'reject_version', \
name='application_version_reject'),
url(r'^version/(?P<aversion_id>\d+)/reject/$',
'reject_version',
name='application_version_reject',
),
url(r'^application/(?P<application_id>\d+)/notpermit/$', 'notpermit', \
name='application_notpermit'),
url(r'^(?P<application_id>\d+)/notpermit/$',
'notpermit',
name='application_notpermit',
),
url(r'^application/(?P<application_id>\d+)/reset/$', 'reset', \
name='application_reset'),
url(r'^(?P<application_id>\d+)/reset/$',
'reset',
name='application_reset',
),
url(r'^application/(?P<application_id>\d+)/support/$', 'support', \
name='application_support'),
url(r'^(?P<application_id>\d+)/support/$',
'support',
name='application_support',
),
url(r'^application/(?P<application_id>\d+)/unsupport/$', 'unsupport', \
name='application_unsupport'),
url(r'^(?P<application_id>\d+)/unsupport/$',
'unsupport',
name='application_unsupport',
),
url(r'^application/(?P<application_id>\d+)/set_active/$', 'set_active',
name='application_activate_item'),
url(r'^(?P<application_id>\d+)/set_active/$',
'set_active',
name='application_activate_item',
),
url(r'^application/(?P<application_id>\d+)/gen_poll/$', 'gen_poll', \
name='application_gen_poll'),
url(r'^(?P<application_id>\d+)/gen_poll/$',
'gen_poll',
name='application_gen_poll',
),
url(r'^application/print/$', 'print_application', \
name='print_applications'),
url(r'^print/$',
'print_application',
name='print_applications',
),
url(r'^application/(?P<application_id>\d+)/print/$', 'print_application', \
name='print_application'),
url(r'^(?P<application_id>\d+)/print/$',
'print_application',
name='print_application',
),
url(r'^application/poll/(?P<poll_id>\d+)/print/$', 'print_application_poll', \
name='print_application_poll'),
url(r'^poll/(?P<poll_id>\d+)/print/$',
'print_application_poll',
name='print_application_poll',
),
url(r'^application/poll/(?P<poll_id>\d+)/$',
url(r'^poll/(?P<poll_id>\d+)/$',
ViewPoll.as_view(),
name='application_poll_view',
),
url(r'^application/poll/(?P<poll_id>\d+)/activate/$',
url(r'^poll/(?P<poll_id>\d+)/activate/$',
ActivatePoll.as_view(),
name='application_poll_activate',
),
url(r'^application/poll/(?P<poll_id>\d+)/del/$', 'delete_poll', \
name='application_poll_delete'),
url(r'^poll/(?P<poll_id>\d+)/del/$',
'delete_poll',
name='application_poll_delete',
),
)

View File

@ -15,65 +15,106 @@ from django.conf.urls.defaults import *
from assignment.views import ViewPoll #, ActivatePoll
urlpatterns = patterns('assignment.views',
url(r'^assignment/$', 'get_overview', \
name='assignment_overview'),
url(r'^assignment/(?P<assignment_id>\d+)$', 'view', \
name='assignment_view'),
url(r'^assignment/new$', 'edit', \
name='assignment_new'),
url(r'^assignment/(?P<assignment_id>\d+)/edit$', 'edit', \
name='assignment_edit'),
url(r'^assignment/(?P<assignment_id>\d+)/del$', 'delete', \
name='assignment_delete'),
url(r'^assignment/(?P<assignment_id>\d+)/setstatus/(?P<status>[a-z]{3})$', 'set_status', \
name='assignment_set_status'),
url(r'^assignment/(?P<assignment_id>\d+)/run$', 'run', \
name='assignment_run'),
url(r'^assignment/(?P<assignment_id>\d+)/delrun$', 'delrun', \
name='assignment_delrun'),
url(r'^assignment/(?P<assignment_id>\d+)/delother/(?P<profile_id>\d+)$', 'delother', \
name='assignment_delother'),
url(r'^assignment/(?P<assignment_id>\d+)/set_active/$', 'set_active',
name='assignment_activate_item'),
url(r'^assignment/poll/(?P<poll_id>\d+)/print$', 'print_assignment_poll', \
name='print_assignment_poll'),
url(r'^assignment/print$', 'print_assignment', \
name='print_assignment'),
url(r'^assignment/(?P<assignment_id>\d+)/print$', 'print_assignment', \
name='print_assignment'),
url(r'^assignment/(?P<assignment_id>\d+)/gen_poll$', 'gen_poll', \
name='assignment_gen_poll'),
url(r'^assignment/poll/(?P<poll_id>\d+)$',
ViewPoll.as_view(),
name='assignment_poll_view'
url(r'^$',
'get_overview',
name='assignment_overview',
),
url(r'^assignment/poll/(?P<poll_id>\d+)/del$', 'delete_poll', \
name='assignment_poll_delete'),
url(r'^(?P<assignment_id>\d+)$',
'view',
name='assignment_view'),
url(r'^assignment/poll/(?P<poll_id>\d+)/pub/$', 'set_published', {'published': True},
name='assignment_poll_publish'),
url(r'^new$',
'edit',
name='assignment_new',
),
url(r'^assignment/poll/(?P<poll_id>\d+)/notpub/$', 'set_published', {'published': False},
name='assignment_poll_notpublish'),
url(r'^(?P<assignment_id>\d+)/edit$',
'edit',
name='assignment_edit',
),
url(r'^assignment/(?P<assignment_id>\d+)/elected/(?P<profile_id>\d+)$', 'set_elected', {'elected': True}, \
name='assignment_user_elected'),
url(r'^(?P<assignment_id>\d+)/del$',
'delete',
name='assignment_delete',
),
url(r'^assignment/(?P<assignment_id>\d+)/notelected/(?P<profile_id>\d+)$', 'set_elected', {'elected': False}, \
name='assignment_user_not_elected'),
url(r'^(?P<assignment_id>\d+)/setstatus/(?P<status>[a-z]{3})$',
'set_status',
name='assignment_set_status',
),
url(r'^(?P<assignment_id>\d+)/run$',
'run',
name='assignment_run',
),
url(r'^(?P<assignment_id>\d+)/delrun$',
'delrun',
name='assignment_delrun',
),
url(r'^(?P<assignment_id>\d+)/delother/(?P<profile_id>\d+)$',
'delother',
name='assignment_delother',
),
url(r'^(?P<assignment_id>\d+)/set_active/$',
'set_active',
name='assignment_activate_item',
),
url(r'^poll/(?P<poll_id>\d+)/print$',
'print_assignment_poll',
name='print_assignment_poll',
),
url(r'^print$',
'print_assignment',
name='print_assignment',
),
url(r'^(?P<assignment_id>\d+)/print$',
'print_assignment',
name='print_assignment',
),
url(r'^(?P<assignment_id>\d+)/gen_poll$',
'gen_poll',
name='assignment_gen_poll',
),
url(r'^poll/(?P<poll_id>\d+)$',
ViewPoll.as_view(),
name='assignment_poll_view',
),
url(r'^poll/(?P<poll_id>\d+)/del$',
'delete_poll',
name='assignment_poll_delete',
),
url(r'^poll/(?P<poll_id>\d+)/pub/$',
'set_published',
{'published': True},
name='assignment_poll_publish',
),
url(r'^poll/(?P<poll_id>\d+)/notpub/$',
'set_published',
{'published': False},
name='assignment_poll_notpublish',
),
url(r'^(?P<assignment_id>\d+)/elected/(?P<profile_id>\d+)$',
'set_elected',
{'elected': True},
name='assignment_user_elected',
),
url(r'^(?P<assignment_id>\d+)/notelected/(?P<profile_id>\d+)$',
'set_elected',
{'elected': False},
name='assignment_user_not_elected',
),
)

View File

@ -14,35 +14,103 @@ from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
urlpatterns = patterns('participant.views',
url(r'^participant/$', 'get_overview', name='user_overview'),
url(r'^participant/new$', 'edit', name='user_new'),
url(r'^participant/(?P<user_id>\d+)/edit$', 'edit', name='user_edit'),
url(r'^participant/print$', 'print_userlist', name='user_print'),
url(r'^participant/(?P<user_id>\d+)/del$', 'user_delete', name='user_delete'),
url(r'^participant/(?P<user_id>\d+)/active/$', 'user_set_active', {'active': True}, name='user_active'),
url(r'^participant/(?P<user_id>\d+)/inactive/$', 'user_set_active', {'active': False}, name='user_inactive'),
url(r'^participant/(?P<user_id>\d+)/superuser/$', 'user_set_superuser', {'superuser': True}, name='user_superuser'),
url(r'^participant/(?P<user_id>\d+)/normaluser/$', 'user_set_superuser', {'superuser': False}, name='user_normaluser'),
url(r'^$',
'get_overview',
name='user_overview',
),
url(r'^participant/import$', 'user_import', name='user_import'),
url(r'^participant/group/$', 'get_group_overview', name='user_group_overview'),
url(r'^participant/group/new$', 'group_edit', name='user_group_new'),
url(r'^participant/group/(?P<group_id>\d+)/edit$', 'group_edit', name='user_group_edit'),
url(r'^participant/group/(?P<group_id>\d+)/del$', 'group_delete', name='user_group_delete'),
url(r'^user/settings$', 'user_settings', name='user_settings'),
url(r'^participant/resetpassword/(?P<user_id>\d+)$', 'reset_password', name='user_reset_password'),
url(r'^participant/passwords/print$', 'print_passwords', name='print_passwords'),
url(r'^new$',
'edit',
name='user_new',
),
url(r'^(?P<user_id>\d+)/edit$',
'edit',
name='user_edit',
),
url(r'^print$',
'print_userlist',
name='user_print',
),
url(r'^(?P<user_id>\d+)/del$',
'user_delete',
name='user_delete',
),
url(r'^(?P<user_id>\d+)/active/$',
'user_set_active',
{'active': True},
name='user_active',
),
url(r'^(?P<user_id>\d+)/inactive/$',
'user_set_active',
{'active': False},
name='user_inactive',
),
url(r'^(?P<user_id>\d+)/superuser/$',
'user_set_superuser',
{'superuser': True},
name='user_superuser',
),
url(r'^(?P<user_id>\d+)/normaluser/$',
'user_set_superuser',
{'superuser': False},
name='user_normaluser',
),
url(r'^import$',
'user_import',
name='user_import',
),
url(r'^group/$',
'get_group_overview',
name='user_group_overview',
),
url(r'^group/new$',
'group_edit',
name='user_group_new',
),
url(r'^group/(?P<group_id>\d+)/edit$',
'group_edit',
name='user_group_edit',
),
url(r'^group/(?P<group_id>\d+)/del$',
'group_delete',
name='user_group_delete',
),
url(r'^user/settings$',
'user_settings',
name='user_settings',
),
url(r'^resetpassword/(?P<user_id>\d+)$',
'reset_password',
name='user_reset_password',
),
url(r'^passwords/print$',
'print_passwords',
name='print_passwords',
),
)
urlpatterns += patterns('django.contrib.auth.views',
url(
r'^login/$',
url(r'^login/$',
'login',
{'template_name': 'participant/login.html'},
name='user_login',
),
url(
r'^logout/$',
url(r'^logout/$',
'logout_then_login',
name='user_logout',
)

View File

@ -26,9 +26,9 @@ urlpatterns = patterns('',
)),
(r'^agenda/', include('agenda.urls')),
(r'', include('application.urls')),
(r'', include('participant.urls')),
(r'', include('assignment.urls')),
(r'^application/', include('application.urls')),
(r'^assignment/', include('assignment.urls')),
(r'^participant/', include('participant.urls')),
(r'config/', include('system.urls')),
(r'projector/', include('projector.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}),