2013-10-08 19:37:22 +00:00
|
|
|
from django.conf.urls.defaults import *
|
|
|
|
from django.core.urlresolvers import reverse
|
|
|
|
from django.views.generic.simple import direct_to_template
|
2013-11-28 03:14:52 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2013-10-13 02:39:47 +00:00
|
|
|
from . import views, models
|
2013-10-08 19:37:22 +00:00
|
|
|
|
|
|
|
urlpatterns = patterns(
|
|
|
|
"",
|
2013-11-28 03:14:52 +00:00
|
|
|
url(r"^libraryauth/(?P<library_id>\d+)/join/$", views.join_library, name="join_library"),
|
|
|
|
url(r"^libraryauth/(?P<library_id>\d+)/deny/$", direct_to_template, {'template':'libraryauth/denied.html'}, name="bad_library"),
|
|
|
|
url(r"^libraryauth/(?P<library_id>\d+)/users/$", views.library, {'template':'libraryauth/users.html'}, name="library_users"),
|
|
|
|
url(r"^libraryauth/(?P<library_id>\d+)/admin/$", login_required(views.UpdateLibraryView.as_view()), name="library_admin"),
|
|
|
|
url(r"^libraryauth/(?P<library_id>\d+)/login/$", views.login_as_library, name="library_login"),
|
|
|
|
url(r"^libraryauth/create/$", login_required(views.CreateLibraryView.as_view()), name="library_create"),
|
2013-10-13 02:39:47 +00:00
|
|
|
url(r"^libraryauth/list/$", direct_to_template, {
|
|
|
|
'template':'libraryauth/list.html',
|
2013-12-02 00:20:42 +00:00
|
|
|
'extra_context':{'libraries':models.Library.objects.filter(approved=True).order_by('name')}
|
2013-10-13 02:39:47 +00:00
|
|
|
}, name="library_list"),
|
2013-12-02 00:20:42 +00:00
|
|
|
url(r"^libraryauth/unapproved/$", direct_to_template, {
|
|
|
|
'template':'libraryauth/list.html',
|
|
|
|
'extra_context':{'libraries':models.Library.objects.filter(approved=False).order_by('name')}
|
|
|
|
}, name="new_libraries"),
|
2013-10-11 21:24:06 +00:00
|
|
|
url(r'^accounts/superlogin/$', views.superlogin, name='superlogin'),
|
2013-10-08 19:37:22 +00:00
|
|
|
)
|