pong
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / urls.py
CommitLineData
f8c16b3d 1# -*- encoding: utf-8 -*-
bae03b7b 2
155a7c62 3from django.conf import settings
31249cf3
EMS
4from django.conf.urls import patterns, include, url
5from django.conf.urls.static import static
155a7c62 6from django.contrib import admin
31249cf3
EMS
7from django.views.generic import TemplateView
8
9from savoirs.rss import \
10 FilChercheurs, FilRessources, FilActualites, \
11 FilAppels, FilEvenements, FilSites, FilMessages
31249cf3 12
ff752682
PP
13from chercheurs.forms import ReactiverForm
14
15
155a7c62
CR
16admin.autodiscover()
17
1e28a70a 18handler500 = "views.page_500"
19handler404 = "views.page_404"
155a7c62 20
bae03b7b
EMS
21# Les URLs suivantes peuvent être préfixées de la discipline et/ou la
22# région. Nous les regroupons donc dans un module qu'on incluera plus bas.
31249cf3 23sep_patterns = patterns(
155a7c62 24 '',
713e8613 25
bae03b7b 26 # accueil
31249cf3 27 url(r'^$', 'savoirs.views.index', name='accueil'),
f24e513e 28
f8c16b3d 29 # recherche
31249cf3 30 url(r'^recherche/$', 'savoirs.views.recherche'),
f0692c02
EMS
31)
32
33urlpatterns = sep_patterns + patterns(
34 '',
35
31249cf3 36 url(r'^informations/$', 'savoirs.views.informations'),
f0692c02
EMS
37
38 # agenda
31249cf3
EMS
39 url(r'^agenda/$', 'savoirs.views.evenement_index', name='agenda'),
40 url(r'^agenda/evenements/(?P<id>\d+)/$', 'savoirs.views.evenement',
41 name='evenement'),
42 url(r'^agenda/evenements/moderer/$', 'savoirs.views.evenement_moderation'),
43 url(r'^agenda/evenements/moderer/(.+)/accepter/$',
44 'savoirs.views.evenement_accepter'),
45 url(r'^agenda/evenements/moderer/(.+)/refuser/$',
46 'savoirs.views.evenement_refuser'),
47 url(r'^agenda/evenements/utilisation/$', 'savoirs.views.page_statique',
48 kwargs={'id': 'conditions-agenda'}, name='conditions-agenda'),
49 url(r'^agenda/evenements/creer/$', 'savoirs.views.evenement_ajout',
50 name='evenement-ajout'),
51 url(r'^agenda/evenements/creer/options_fuseau_horaire/$',
52 'savoirs.views.options_fuseau_horaire'),
f0692c02
EMS
53
54 # sous-menu droite
31249cf3
EMS
55 url(r'^a-propos/$', 'savoirs.views.page_statique',
56 kwargs={'id': 'a-propos'}, name='a-propos'),
57 url(r'^aide/$', 'savoirs.views.page_statique',
58 kwargs={'id': 'aide'}, name='aide'),
59 url(r'^domaines-de-recherche/$', 'savoirs.views.page_statique',
60 kwargs={'id': 'domaines-de-recherche'}, name='domaines-de-recherche'),
61 url(r'^legal/$', 'savoirs.views.page_statique',
62 kwargs={'id': 'legal'}, name='legal'),
63 url(r'^nous-contacter/$', 'savoirs.views.page_statique',
64 kwargs={'id': 'contact'}, name='contact'),
c1b134f8 65
f8c16b3d 66 # ressources
31249cf3
EMS
67 url(r'^ressources/$', 'savoirs.views.ressource_index', name='ressources'),
68 url(r'^ressources/(?P<id>\d+)/$', 'savoirs.views.ressource_retrieve',
69 name='ressource'),
f0692c02 70
f8c16b3d 71 # actualités
31249cf3
EMS
72 url(r'^actualites/$', 'savoirs.views.actualite_index', name='actualites'),
73 url(r'^actualites/(?P<id>\d+)/$', 'savoirs.views.actualite',
74 name='actualite'),
75 url(r'^appels/$', 'savoirs.views.actualite_index',
76 kwargs={'type': 'appels'}, name='appels'),
c1b134f8 77
f0692c02 78 # sites
31249cf3
EMS
79 url(r'^sites/$', 'sitotheque.views.index', name='sites'),
80 url(r'^sites/(?P<id>\d+)/$', 'sitotheque.views.retrieve', name='site'),
81 url(r'^sites/google.xml$', 'sitotheque.views.config_google'),
f0692c02
EMS
82
83 # sites AUF
31249cf3 84 url(r'^sites-auf/$', 'savoirs.views.sites_auf', name='sites-auf'),
f8c16b3d 85
86 # chercheurs
31249cf3
EMS
87 url(r'^chercheurs/$', 'chercheurs.views.index', name='chercheurs'),
88 url(r'^chercheurs/(?P<id>\d+)/$', 'chercheurs.views.retrieve',
89 name='chercheur'),
90 url(r'^chercheurs/inscription/$', 'chercheurs.views.inscription',
91 name='inscription'),
92 url(r'^chercheurs/inscription_faite/$',
93 TemplateView.as_view(
94 template_name='chercheurs/inscription_faite.html'
95 ),
96 name='chercheurs-inscription-faite'),
97 url(r'^chercheurs/activation/(?P<id_base36>.*)/(?P<token>.*)/$',
98 'chercheurs.views.activation',
99 name='chercheurs-activation'),
100 url(r'^chercheurs/desinscription/$', 'chercheurs.views.desinscription'),
101 url(r'^chercheurs/perso/$', 'chercheurs.views.perso'),
102 url(r'^chercheurs/edit/$', 'chercheurs.views.edit'),
103 url(r'^chercheurs/conversion$', 'savoirs.views.page_statique',
104 kwargs={'id': 'table-de-passage'}, name='conversion'),
ff752682 105
31249cf3
EMS
106 url(r'^chercheurs/connexion/$', 'chercheurs.views.login',
107 kwargs={'template_name': 'chercheurs/login.html'},
108 name='chercheurs-login'),
109 url(r'^chercheurs/deconnexion/$', 'django.contrib.auth.views.logout',
110 kwargs={'template_name': 'chercheurs/logged_out.html'},
111 name='chercheurs-logout'),
ff752682 112
31249cf3
EMS
113 url(r'^chercheurs/changement-mdp/$', 'chercheurs.views.password_change',
114 kwargs={
115 'template_name': 'chercheurs/password_change_form.html',
116 'post_change_redirect': '/chercheurs/changement-mdp-fini/'
117 },
118 name='chercheurs-password-change'),
119 url(r'^chercheurs/changement-mdp-fini/$',
120 'django.contrib.auth.views.password_change_done',
121 kwargs={'template_name': 'chercheurs/password_change_done.html'},
122 name='chercheurs-password-change-done'),
ff752682
PP
123
124 # Oublié mot de passe
31249cf3
EMS
125 url(r'^chercheurs/oubli-mdp/$', 'django.contrib.auth.views.password_reset',
126 kwargs={
127 'template_name': 'chercheurs/password_reset_form.html',
128 'email_template_name': 'chercheurs/password_reset_email.txt',
129 'post_reset_redirect': '/chercheurs/oubli-mdp-envoye/'
130 },
131 name='chercheurs-password-reset'),
132 url(r'^chercheurs/oubli-mdp-envoye/$',
133 'django.contrib.auth.views.password_reset_done',
134 kwargs={'template_name': 'chercheurs/password_reset_done.html'},
135 name='chercheurs-password-reset-done'),
136 url(r'^chercheurs/oubli-mdp-retour/(?P<uidb36>.*)/(?P<token>.*)/$',
137 'django.contrib.auth.views.password_reset_confirm',
138 kwargs={'template_name': 'chercheurs/password_reset_confirm.html'},
139 name='chercheurs-password-reset-confirm'),
140 url(r'^chercheurs/oubli-mdp-fini/$',
141 'django.contrib.auth.views.password_reset_complete',
142 kwargs={'template_name': 'chercheurs/password_reset_complete.html'}),
ff752682
PP
143
144 # Réactiver fiche
145 url(r'^chercheurs/reactiver/$', 'django.contrib.auth.views.password_reset',
146 kwargs={
147 'template_name': 'chercheurs/reactiver_form.html',
148 'email_template_name': 'chercheurs/reactiver_email.txt',
149 'post_reset_redirect': '/chercheurs/reactiver-envoye/'
150 },
151 name='chercheurs-reactiver'),
152 url(r'^chercheurs/reactiver-envoye/$',
153 'django.contrib.auth.views.password_reset_done',
154 kwargs={'template_name': 'chercheurs/reactiver_done.html'},
155 name='chercheurs-reactiver-done'),
156 url(r'^chercheurs/reactiver-retour/(?P<uidb36>.*)/(?P<token>.*)/$',
157 'django.contrib.auth.views.password_reset_confirm',
158 kwargs={'template_name': 'chercheurs/reactiver_confirm.html',
159 'set_password_form': ReactiverForm},
160 name='chercheurs-reactiver-confirm'),
161 url(r'^chercheurs/reactiver-fini/$',
162 'django.contrib.auth.views.password_reset_complete',
163 kwargs={'template_name': 'chercheurs/reactiver_complete.html'}),
164
165 # auto complete
31249cf3
EMS
166 url(r'^etablissements/autocomplete/$',
167 'chercheurs.views.etablissements_autocomplete'),
168 url(r'^etablissements/autocomplete/(?P<pays>.*)/$',
169 'chercheurs.views.etablissements_autocomplete'),
9af73c99 170
bf563475 171 # API chercheurs
31249cf3
EMS
172 url(r'^api/chercheurs/(?P<chercheur_id>\d+)/$', 'chercheurs.api.api'),
173 url(r'^api/chercheurs/pays/(?P<pays>.*)/$', 'chercheurs.api.api'),
174 url(r'^api/chercheurs/region/(?P<region>.*)/$', 'chercheurs.api.api'),
68d2688e 175 url(r'^api/chercheurs/recherche', 'chercheurs.api.recherche'),
bf563475 176
b33d7b0a
OL
177 # API Pong
178 url(r'^api/pong/', include('auf.django.pong.urls')),
179
bf563475 180
cdaadee3 181 # groupes
31249cf3
EMS
182 url(r'^groupes/$', 'chercheurs.views.groupe_index'),
183 url(r'^groupes/(?P<id>\d+)/$', 'chercheurs.views.groupe_retrieve',
184 name='groupe_retrieve'),
185 url(r'^groupes/(?P<id>\d+)/adhesion/$', 'chercheurs.views.groupe_adhesion',
186 name='groupe_adhesion'),
187 url(r'^groupes/(?P<id>\d+)/membres/$', 'chercheurs.views.groupe_membres',
188 name='groupe_membres'),
189 url(r'^groupes/(?P<id>\d+)/messages/$', 'chercheurs.views.groupe_messages',
190 name='groupe_messages'),
cdaadee3 191
bae03b7b 192 # section par discipline et/ou région
31249cf3
EMS
193 url(r'^discipline/(?P<discipline>\d+)/', include(sep_patterns)),
194 url(r'^region/(?P<region>\d+)/', include(sep_patterns)),
195 url(r'^discipline/(?P<discipline>\d+)/region/(?P<region>\d+)/',
196 include(sep_patterns)),
bae03b7b
EMS
197
198 # traduction disponible dans le frontend sans permissons
31249cf3 199 url(r'^jsi18n/$', admin.site.i18n_javascript),
bae03b7b 200
c4312cce 201 # Rappels
31249cf3
EMS
202 url(r'^admin/rappels/$', 'rappels.views.admin_rappels',
203 name='admin-rappels'),
c4312cce
PP
204
205 # Admin
bae03b7b 206 url(r'^admin_tools/', include('admin_tools.urls')),
31249cf3
EMS
207 url(r'^admin/', include(admin.site.urls)),
208 url(r'^admin/confirmation/(.*)', 'savoirs.admin_views.confirmation'),
209 url(r'^admin/assigner_pays', 'savoirs.admin_views.assigner_pays'),
210 url(r'^admin/assigner_thematiques',
211 'savoirs.admin_views.assigner_thematiques'),
212 url(r'^admin/assigner_categorie',
213 'savoirs.admin_views.assigner_categorie'),
214 url(r'^admin/assigner_cgstatut',
215 'chercheurs.admin_views.assigner_cgstatut'),
216 url(r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_regions',
217 'savoirs.admin_views.assigner_regions',
218 name='assigner_regions'),
219 url(r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/'
220 r'assigner_disciplines',
221 'savoirs.admin_views.assigner_disciplines',
222 name='assigner_disciplines'),
223 url(r'^admin/chercheurs/chercheur/export',
224 'chercheurs.admin_views.export'),
225 url(r'^admin/', include(admin.site.urls)),
bae03b7b 226
9c29b8d4 227 # stats
31249cf3 228 url(r'^stats/$', 'savoirs.admin_views.stats', name='stats'),
bae03b7b 229
c4312cce 230
bae03b7b 231 # rss
31249cf3
EMS
232 url(r'^rss/chercheurs/$', FilChercheurs(), name='rss_chercheurs'),
233 url(r'^rss/ressources/$', FilRessources(), name='rss_ressources'),
234 url(r'^rss/actualites/$', FilActualites(), name='rss_actualites'),
235 url(r'^rss/appels/$', FilAppels(), name='rss_appels'),
236 url(r'^rss/agenda/$', FilEvenements(), name='rss_agenda'),
237 url(r'^rss/sites/$', FilSites(), name='rss_sites'),
238 url(r'^rss/messages/(?P<groupe_id>\d+)/$', FilMessages(),
239 name='rss_messages'),
240 url(r'^json/get/$', 'savoirs.views.json_get'),
241 url(r'^json/set/$', 'savoirs.views.json_set'),
1719bf4e 242
fdcf5874 243 # recherches sauvegardées
31249cf3
EMS
244 url(r'^recherches/$', 'savoirs.views.recherches', name='recherches'),
245 url(r'^recherches/(?P<type>[^/]*)/sauvegarder/$',
246 'savoirs.views.sauvegarder_recherche',
247 name='sauvegarder_recherche'),
248 url(r'^recherches/(?P<id>\d+)/supprimer/$',
249 'savoirs.views.supprimer_recherche',
250 name='supprimer_recherche'),
251 url(r'^recherches/(?P<id>\d+)/editer/$',
252 'savoirs.views.editer_recherche',
253 name='editer_recherche'),
254 url(r'^recherches/(?P<id>\d+)/activer-alerte/$',
255 'savoirs.views.activer_alerte',
256 name='activer_alerte'),
257 url(r'^recherches/(?P<id>\d+)/desactiver-alerte/$',
258 'savoirs.views.desactiver_alerte',
259 name='desactiver_alerte'),
b8af106e
PP
260
261 # API Interface (FAUN)
31249cf3
EMS
262 url(r'^faun/auteurs/(?P<id>\d+)', 'interfaces.views.faun_auteurs',
263 name='faun_auteurs'),
57004576
PP
264
265 # Django-selectable
266 (r'^djselectable/', include('selectable.urls')),
2a35a9cd
PP
267
268 # Page statique ?
269 url(r'^(?P<id>.*)/$', 'savoirs.views.page_statique'),
270
31249cf3 271) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)