Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.git] / portal / urls.py
1 # -*- coding: utf-8 -*-
2 #
3 # portal/urls.py: URL mappings for the portal application
4 # This file is part of the Manifold project.
5 #
6 # Authors:
7 #   Jordan AugĂ© <jordan.auge@lip6.fr>
8 # Copyright 2013, UPMC Sorbonne UniversitĂ©s / LIP6
9 #
10 # This program is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 3, or (at your option) any later version.
13
14 # This program is distributed in the hope that it will be useful, but WITHOUT
15 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17 # details.
18
19 # You should have received a copy of the GNU General Public License along with
20 # this program; see the file COPYING.  If not, write to the Free Software
21 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 from django.views.generic.base   import TemplateView
24 from django.conf.urls           import patterns, include, url
25
26 from portal.about               import AboutView
27 from portal.usersview           import UsersView
28 from portal.manageuserview      import UserView, user_process    
29 from portal.platformsview       import PlatformsView
30 from portal.platformview        import PlatformView
31 from portal.resourceview        import ResourceView
32 from portal.dashboardview       import DashboardView
33 from portal.accountview         import AccountView, account_process
34 from portal.contactview         import ContactView
35 from portal.slicerequestview    import SliceRequestView
36 from portal.registrationview    import RegistrationView
37 from portal.joinview            import JoinView
38 from portal.sliceview           import SliceView
39 from portal.validationview      import ValidatePendingView
40 from portal.experimentview      import ExperimentView
41 from portal.documentationview   import DocumentationView
42 # hopefully these should move in dedicated source files too
43 from portal.views               import PresViewView, pres_view_static, pres_view_methods, pres_view_animation
44 from portal.django_passresetview import password_reset, password_reset_done, password_reset_confirm, password_reset_complete 
45
46 # DEPRECATED #named_register_forms = (
47 # DEPRECATED #    ("step1", RegisterUserForm),
48 # DEPRECATED #    ("step2", RegisterUserStep2Form)
49 # DEPRECATED #)
50 # DEPRECATED #
51 # DEPRECATED #register_wizard = RegisterUserWizardView.as_view(named_register_forms,
52 # DEPRECATED #    url_name="register_wizard_step")
53
54 urlpatterns = patterns('',
55     # User registration
56     #url(r'^user/register/?$', UserRegisterView.as_view(), name='user_register'),
57     url(r'^user/register/complete/$',
58         TemplateView.as_view(template_name='user_register_complete.html'),
59         name='user_register_complete'),
60     # User validation
61     #url(r'^user/validate/?$', UserValidateView.as_view(), name='user_validate'),
62     url(r'^dashboard/?$', DashboardView.as_view(), name='dashboard'),
63     #url(r'^my_account/?$', MyAccountView.as_view(), name='my_account'),
64     url(r'^account/?$', AccountView.as_view(), name='account'),
65     url(r'^about/?$', AboutView.as_view(), name='about'),
66     url(r'^users/?$', UsersView.as_view(), name='user_list'),
67     url(r'^user/(?P<email>[\w\s.@\-]+)/?$', UserView.as_view(), name='user'),
68     url(r'^user/(?P<email>[\w\s.@\-]+)/user_process/?$', user_process),
69     url(r'^platforms/?$', PlatformsView.as_view(), name='platforms'),
70     url(r'^platform/(?P<platformname>[\w\.\-]+)/?$', PlatformView.as_view(), name='platform'),
71     url(r'^resource/(?P<urn>[\w\.\-\+\:]+)/?$', ResourceView.as_view(), name='resource'),
72     url(r'^slice/?$',SliceView.as_view(),name='slice'),
73     url(r'^slice/(?P<slicename>[\w\.]+)/?$', SliceView.as_view(),name='slice'),
74     url(r'^account/account_process/?$', account_process),
75     url(r'^register/?$', RegistrationView.as_view(), name='registration'),
76     url(r'^join/?$', JoinView.as_view(), name='join'),
77     url(r'^contact/?$', ContactView.as_view(), name='contact'),
78     url(r'^experiment?$', ExperimentView.as_view(), name='experiment'),
79     url(r'^support/documentation?$', DocumentationView.as_view(), name='FAQ'),
80     #url(r'^pass_reset/?$', PassResetView.as_view(), name='pass_rest'),
81     # Slice request
82     url(r'^slice_request/?$', SliceRequestView.as_view(), name='slice_request'),
83     # Validate pending requests
84     url(r'^validate/?$', ValidatePendingView.as_view()),
85     # http://stackoverflow.com/questions/2360179/django-urls-how-to-pass-a-list-of-items-via-clean-urls
86     # (r'^validate_action/(?P<constraints>[^/]+)/(?P<id>\w+)/?$', 'portal.views.pres_view_static'),
87     url(r'^validate_action(?P<id>(?:/\w+)+)/?$', 'portal.actions.validate_action'),
88
89     url(r'^pres_view/?$', PresViewView.as_view(), name='pres_view'),
90     (r'^methods/(?P<type>\w+)/?$', 'portal.views.pres_view_methods'),
91     (r'^animation/(?P<constraints>[^/]+)/(?P<id>\w+)/?$', 'portal.views.pres_view_animation'),
92     (r'^static/(?P<constraints>[^/]+)/(?P<id>\w+)/?$', 'portal.views.pres_view_static'),
93     #url(r'^slice/request/?$',  views.slice_request,  name='slice_request'),
94     # Slice confirmation
95     #url(r'^slice/validate/?$', views.slice_validate, name='slice_validate'),
96     url(r'^pass_reset/$', 
97         'portal.django_passresetview.password_reset', 
98         {'post_reset_redirect' : '/portal/password/reset/done/'}),
99     (r'^password/reset/done/$',
100         'portal.django_passresetview.password_reset_done'),
101     (r'^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 
102         'portal.django_passresetview.password_reset_confirm', 
103         {'post_reset_redirect' : '/portal/password/done/'}),
104     (r'^password/done/$', 
105         'portal.django_passresetview.password_reset_complete'),
106     # ...
107
108 )
109 # (r'^accounts/', include('registration.backends.default.urls')),
110
111
112 # DEPRECATED #    url(r'^$', views.index, name='index'),
113 # DEPRECATED #    url(r"^registerwizard/(?P<step>[-\w]+)/$", register_wizard,
114 # DEPRECATED #        name="register_wizard_step"),
115 # DEPRECATED #    url(r"^registerwizard/$", regster_wizard, name="register_wizard")