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 #   Loic Baron  <loic.baron@lip6.fr>
9 #   Mohammed Yasin Rahman <mohammed-yasin.rahman@lip6.fr>
10 #   Ciro Scognamiglio   <ciro.scognamiglio@lip6.fr>
11 # Copyright 2013, UPMC Sorbonne UniversitĂ©s / LIP6
12 #
13 # This program is free software; you can redistribute it and/or modify it under
14 # the terms of the GNU General Public License as published by the Free Software
15 # Foundation; either version 3, or (at your option) any later version.
16
17 # This program is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
20 # details.
21
22 # You should have received a copy of the GNU General Public License along with
23 # this program; see the file COPYING.  If not, write to the Free Software
24 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 from django.views.generic.base      import TemplateView
27 from django.conf.urls               import patterns, include, url
28
29 from portal.about                   import AboutView
30 from portal.institution             import InstitutionView
31 from portal.usersview               import UsersView
32 from portal.manageuserview          import UserView, user_process    
33 from portal.platformsview           import PlatformsView
34 from portal.platformview            import PlatformView
35 from portal.resourceview            import ResourceView
36 from portal.dashboardview           import DashboardView
37 from portal.accountview             import AccountView, account_process
38 from portal.contactview             import ContactView
39 from portal.slicerequestview        import SliceRequestView
40 from portal.registrationview        import RegistrationView
41 from portal.joinview                import JoinView
42 from portal.sliceviewold            import SliceView
43 from portal.validationview          import ValidatePendingView
44 #from portal.experimentview         import ExperimentView
45 from portal.termsview               import TermsView
46 from portal.univbrisview            import UnivbrisView
47 from portal.univbrisvtam            import UnivbrisVtam
48
49 from portal.manualdelegationview    import ManualDelegationView
50
51 from portal.servicedirectory        import ServiceDirectoryView
52
53 from portal.documentationview       import DocumentationView
54 from portal.supportview             import SupportView
55 from portal.emailactivationview     import ActivateEmailView
56 # hopefully these should move in dedicated source files too
57 from portal.views                   import PresViewView, pres_view_static, pres_view_methods, pres_view_animation
58 from portal.django_passresetview    import password_reset, password_reset_done, password_reset_confirm, password_reset_complete 
59
60 from portal.reputationview      import ReputationView
61
62 # DEPRECATED #named_register_forms = (
63 # DEPRECATED #    ("step1", RegisterUserForm),
64 # DEPRECATED #    ("step2", RegisterUserStep2Form)
65 # DEPRECATED #)
66 # DEPRECATED #
67 # DEPRECATED #register_wizard = RegisterUserWizardView.as_view(named_register_forms,
68 # DEPRECATED #    url_name="register_wizard_step")
69
70 urlpatterns = patterns('',
71     # User registration
72     #url(r'^user/register/?$', UserRegisterView.as_view(), name='user_register'),
73     url(r'^user/register/complete/$',
74         TemplateView.as_view(template_name='user_register_complete.html'),
75         name='user_register_complete'),
76     # User validation
77     #url(r'^user/validate/?$', UserValidateView.as_view(), name='user_validate'),
78     url(r'^dashboard/?$', DashboardView.as_view(), name='dashboard'),
79     #url(r'^my_account/?$', MyAccountView.as_view(), name='my_account'),
80     url(r'^account/?$', AccountView.as_view(), name='account'),
81     url(r'^institution/?$', InstitutionView.as_view(), name='institution'),
82     url(r'^about/?$', AboutView.as_view(), name='about'),
83     url(r'^users/?$', UsersView.as_view(), name='user_list'),
84     url(r'^user/(?P<email>[\w\s.@\-]+)/?$', UserView.as_view(), name='user'),
85     url(r'^user/(?P<email>[\w\s.@\-]+)/user_process/?$', user_process),
86     url(r'^platforms/?$', PlatformsView.as_view(), name='platforms'),
87     url(r'^platform/(?P<platformname>[\w\.\-]+)/?$', PlatformView.as_view(), name='platform'),
88     url(r'^resource/(?P<urn>[\w\.\-\+\:]+)/?$', ResourceView.as_view(), name='resource'),
89     url(r'^slice/?$',SliceView.as_view(),name='slice'),
90     url(r'^slice/(?P<slicename>[\w\.]+)/?$', SliceView.as_view(),name='slice'),
91     url(r'^account/account_process/?$', account_process),
92     url(r'^register/?$', RegistrationView.as_view(), name='registration'),
93     url(r'^join/?$', JoinView.as_view(), name='join'),
94     url(r'^contact/?$', ContactView.as_view(), name='contact'),
95     #url(r'^experiment?$', ExperimentView.as_view(), name='experiment'),
96     url(r'^support/?$', SupportView.as_view(), name='support'),
97     url(r'^support/documentation?$', DocumentationView.as_view(), name='FAQ'),
98     #url(r'^pass_reset/?$', PassResetView.as_view(), name='pass_rest'),
99     # Slice request
100     url(r'^slice_request/?$', SliceRequestView.as_view(), name='slice_request'),
101     url(r'^terms/?$', TermsView.as_view(), name='terms'),
102     url(r'^manual_delegation/?$', ManualDelegationView.as_view(), name='manual_delegation'),
103     # Validate pending requests
104     url(r'^validate/?$', ValidatePendingView.as_view()),
105     # http://stackoverflow.com/questions/2360179/django-urls-how-to-pass-a-list-of-items-via-clean-urls
106     # (r'^validate_action/(?P<constraints>[^/]+)/(?P<id>\w+)/?$', 'portal.views.pres_view_static'),
107     url(r'^validate_action(?P<id>(?:/\w+)+)/?$', 'portal.actions.validate_action'),
108     url(r'^reject_action(?P<id>(?:/\w+)+)/?$', 'portal.actions.reject_action'),
109     url(r'^pres_view/?$', PresViewView.as_view(), name='pres_view'),
110     (r'^methods/(?P<type>\w+)/?$', 'portal.views.pres_view_methods'),
111     (r'^animation/(?P<constraints>[^/]+)/(?P<id>\w+)/?$', 'portal.views.pres_view_animation'),
112     (r'^static/(?P<constraints>[^/]+)/(?P<id>\w+)/?$', 'portal.views.pres_view_static'),
113     #url(r'^slice/request/?$',  views.slice_request,  name='slice_request'),
114     # Slice confirmation
115     #url(r'^slice/validate/?$', views.slice_validate, name='slice_validate'),
116     url(r'^email_activation/(?P<hash_code>[\w\W\-]+)/?$', ActivateEmailView.as_view(), name='email_activate'), 
117     url(r'^pass_reset/$', 
118         'portal.django_passresetview.password_reset', 
119         {'post_reset_redirect' : '/portal/password/reset/done/'}),
120     (r'^password/reset/done/$',
121         'portal.django_passresetview.password_reset_done'),
122     (r'^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 
123         'portal.django_passresetview.password_reset_confirm', 
124         {'post_reset_redirect' : '/portal/password/done/'}),
125     (r'^password/done/$', 
126         'portal.django_passresetview.password_reset_complete'),
127
128     url(r'^univbris/?$', UnivbrisView.as_view(), name='univbris'),
129     url(r'^univbrisvtam/?$', UnivbrisVtam.as_view(), name='univbrisvtam'),   
130
131     url(r'^servicedirectory/?$', ServiceDirectoryView.as_view(), name='servicedirectory'),
132
133
134     url(r'^reputation/?$', ReputationView.as_view(), name='reputation'),
135     url(r'^reputation/submit_eval/?$', ReputationView.as_view(), name='reputation_submit_eval'),
136     
137     
138 )
139 # (r'^accounts/', include('registration.backends.default.urls')),
140
141
142 # DEPRECATED #    url(r'^$', views.index, name='index'),
143 # DEPRECATED #    url(r"^registerwizard/(?P<step>[-\w]+)/$", register_wizard,
144 # DEPRECATED #        name="register_wizard_step"),
145 # DEPRECATED #    url(r"^registerwizard/$", regster_wizard, name="register_wizard")