Adhésion: Assignation d'un statut par lot
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / urls.py
CommitLineData
f8c16b3d 1# -*- encoding: utf-8 -*-
bae03b7b 2
1e28a70a 3from django.conf.urls.defaults import patterns, include, handler500, handler404, url
155a7c62
CR
4from django.conf import settings
5from django.contrib import admin
bf2904f0 6from savoirs.rss import FilChercheurs, FilRessources, FilActualites, FilAppels, FilEvenements, FilSites, FilMessages
5ecd5424 7
155a7c62
CR
8admin.autodiscover()
9
1e28a70a 10handler500 = "views.page_500"
11handler404 = "views.page_404"
155a7c62 12
bae03b7b
EMS
13# Les URLs suivantes peuvent être préfixées de la discipline et/ou la
14# région. Nous les regroupons donc dans un module qu'on incluera plus bas.
15sep_patterns = patterns(
155a7c62 16 '',
713e8613 17
bae03b7b 18 # accueil
2af3293d 19 (r'^$', 'savoirs.views.index', {}, 'accueil'),
f24e513e 20
f8c16b3d 21 # recherche
92c7413b 22 (r'^recherche/$', 'savoirs.views.recherche'),
f0692c02
EMS
23)
24
25urlpatterns = sep_patterns + patterns(
26 '',
27
28 (r'^informations/$', 'savoirs.views.informations'),
29
30 # agenda
2af3293d 31 (r'^agenda/$', 'savoirs.views.evenement_index', {}, 'agenda'),
230671ff 32 (r'^agenda/evenements/(?P<id>\d+)/$', 'savoirs.views.evenement', {}, 'evenement'),
f0692c02
EMS
33 (r'^agenda/evenements/moderer/$', 'savoirs.views.evenement_moderation'),
34 (r'^agenda/evenements/moderer/(.+)/accepter/$', 'savoirs.views.evenement_accepter'),
35 (r'^agenda/evenements/moderer/(.+)/refuser/$', 'savoirs.views.evenement_refuser'),
f09bc1c6 36 (r'^agenda/evenements/utilisation/$', 'savoirs.views.page_statique', dict(id='conditions-agenda'), 'conditions-agenda'),
2af3293d 37 (r'^agenda/evenements/creer/$', 'savoirs.views.evenement_ajout', {}, 'evenement-ajout'),
1719bf4e 38 (r'^agenda/evenements/creer/options_fuseau_horaire/$', 'savoirs.views.options_fuseau_horaire'),
f0692c02
EMS
39
40 # sous-menu droite
f09bc1c6
EMS
41 (r'^a-propos/$', 'savoirs.views.page_statique', dict(id='a-propos'), 'a-propos'),
42 (r'^aide/$', 'savoirs.views.page_statique', dict(id='aide'), 'aide'),
43 (r'^domaines-de-recherche/$', 'savoirs.views.page_statique', dict(id='domaines-de-recherche'), 'domaines-de-recherche'),
44 (r'^legal/$', 'savoirs.views.page_statique', dict(id='legal'), 'legal'),
45 (r'^nous-contacter/$', 'savoirs.views.page_statique', dict(id='contact'), 'contact'),
c1b134f8 46
f8c16b3d 47 # ressources
2af3293d 48 (r'^ressources/$', 'savoirs.views.ressource_index', {}, 'ressources'),
230671ff 49 (r'^ressources/(?P<id>\d+)/$', 'savoirs.views.ressource_retrieve', {}, 'ressource'),
f0692c02 50
f8c16b3d 51 # actualités
011804bb
EMS
52 (r'^actualites/$', 'savoirs.views.actualite_index', {}, 'actualites'),
53 (r'^actualites/(?P<id>\d+)/$', 'savoirs.views.actualite', {}, 'actualite'),
54 (r'^appels/$', 'savoirs.views.actualite_index', dict(type='appels'), 'appels'),
c1b134f8 55
f0692c02 56 # sites
2af3293d 57 (r'^sites/$', 'sitotheque.views.index', {}, 'sites'),
230671ff 58 (r'^sites/(?P<id>\d+)/$', 'sitotheque.views.retrieve', {}, 'site'),
fc2908e4 59 (r'^sites/google.xml$', 'sitotheque.views.config_google'),
f0692c02
EMS
60
61 # sites AUF
2af3293d 62 (r'^sites-auf/$', 'savoirs.views.sites_auf', {}, 'sites-auf'),
f8c16b3d 63
64 # chercheurs
2af3293d 65 (r'^chercheurs/$', 'chercheurs.views.index', {}, 'chercheurs'),
230671ff 66 (r'^chercheurs/(?P<id>\d+)/$', 'chercheurs.views.retrieve', {}, 'chercheur'),
2af3293d 67 (r'^chercheurs/inscription/$', 'chercheurs.views.inscription', {}, 'inscription'),
43ed73e7
EMS
68 (r'^chercheurs/inscription_faite/$', 'django.views.generic.simple.direct_to_template', dict(
69 template='chercheurs/inscription_faite.html'
70 ), 'chercheurs-inscription-faite'),
71 (r'^chercheurs/activation/(?P<id_base36>.*)/(?P<token>.*)/$', 'chercheurs.views.activation', {}, 'chercheurs-activation'),
8baa2a56 72 (r'^chercheurs/desinscription/$', 'chercheurs.views.desinscription'),
9af73c99 73 (r'^chercheurs/perso/$', 'chercheurs.views.perso'),
b3e1079e 74 (r'^chercheurs/edit/$', 'chercheurs.views.edit'),
f09bc1c6 75 (r'^chercheurs/conversion$', 'savoirs.views.page_statique', dict(id='table-de-passage'), 'conversion'),
fa6a2a07 76 (r'^chercheurs/connexion/$', 'chercheurs.views.login', dict(
d4736474
EMS
77 template_name='chercheurs/login.html'
78 ), 'chercheurs-login'),
79 (r'^chercheurs/deconnexion/$', 'django.contrib.auth.views.logout', dict(
80 template_name='chercheurs/logged_out.html'
81 ), 'chercheurs-logout'),
82 (r'^chercheurs/changement-mdp/$', 'django.contrib.auth.views.password_change', dict(
83 template_name='chercheurs/password_change_form.html',
84 post_change_redirect='/chercheurs/changement-mdp-fini/'
85 ), 'chercheurs-password-change'),
86 (r'^chercheurs/changement-mdp-fini/$', 'django.contrib.auth.views.password_change_done', dict(
87 template_name='chercheurs/password_change_done.html'
88 ), 'chercheurs-password-change-done'),
89 (r'^chercheurs/oubli-mdp/$', 'django.contrib.auth.views.password_reset', dict(
90 template_name='chercheurs/password_reset_form.html',
91 email_template_name='chercheurs/password_reset_email.txt',
92 post_reset_redirect='/chercheurs/oubli-mdp-envoye/'
93 ), 'chercheurs-password-reset'),
94 (r'^chercheurs/oubli-mdp-envoye/$', 'django.contrib.auth.views.password_reset_done', dict(
95 template_name='chercheurs/password_reset_done.html'
96 ), 'chercheurs-password-reset-done'),
97 (r'^chercheurs/oubli-mdp-retour/(?P<uidb36>.*)/(?P<token>.*)/$', 'django.contrib.auth.views.password_reset_confirm', dict(
98 template_name='chercheurs/password_reset_confirm.html'
99 ), 'chercheurs-password-reset-confirm'),
100 (r'^chercheurs/oubli-mdp-fini/$', 'django.contrib.auth.views.password_reset_complete', dict(
101 template_name='chercheurs/password_reset_complete.html'
102 )),
219710da 103 (r'^etablissements/autocomplete/$', 'chercheurs.views.etablissements_autocomplete'),
e836f6f7 104 (r'^etablissements/autocomplete/(?P<pays>.*)/$', 'chercheurs.views.etablissements_autocomplete'),
9af73c99 105
cdaadee3
PP
106 # groupes
107 (r'^groupes/$', 'chercheurs.views.groupe_index'),
bf2904f0 108 url(r'^groupes/(?P<id>\d+)/$', 'chercheurs.views.groupe_retrieve', name='groupe_retrieve'),
0eb2476e 109 url(r'^groupes/(?P<id>\d+)/adhesion/$', 'chercheurs.views.groupe_adhesion', name='groupe_adhesion'),
ddf7e62e 110 url(r'^groupes/(?P<id>\d+)/membres/$', 'chercheurs.views.groupe_membres', name='groupe_membres'),
c8d6b979 111 url(r'^groupes/(?P<id>\d+)/messages/$', 'chercheurs.views.groupe_messages', name='groupe_messages'),
cdaadee3 112
bae03b7b
EMS
113 # section par discipline et/ou région
114 (r'^discipline/(?P<discipline>\d+)/', include(sep_patterns)),
115 (r'^region/(?P<region>\d+)/', include(sep_patterns)),
116 (r'^discipline/(?P<discipline>\d+)/region/(?P<region>\d+)/', include(sep_patterns)),
117
118 # traduction disponible dans le frontend sans permissons
119 url(r'^jsi18n/$', admin.site.i18n_javascript,),
120
121 url(r'^admin_tools/', include('admin_tools.urls')),
122 (r'^admin/', include(admin.site.urls)),
123 (r'^admin/confirmation/(.*)', 'savoirs.admin_views.confirmation'),
124 (r'^admin/assigner_pays', 'savoirs.admin_views.assigner_pays'),
125 (r'^admin/assigner_thematiques', 'savoirs.admin_views.assigner_thematiques'),
656b9c0f 126 (r'^admin/assigner_categorie', 'savoirs.admin_views.assigner_categorie'),
1fd4a630 127 (r'^admin/assigner_cgstatut', 'chercheurs.admin_views.assigner_cgstatut'),
bae03b7b
EMS
128 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_regions', 'savoirs.admin_views.assigner_regions', {}, 'assigner_regions'),
129 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_disciplines', 'savoirs.admin_views.assigner_disciplines', {}, 'assigner_disciplines'),
130 (r'^admin/(.*)', admin.site.root),
131
9c29b8d4
EMS
132 # stats
133 (r'^stats/$', 'savoirs.admin_views.stats', {}, 'stats'),
bae03b7b 134
bae03b7b 135 # rss
7ed3ee8f
EMS
136 (r'^rss/chercheurs/$', FilChercheurs(), {}, 'rss_chercheurs'),
137 (r'^rss/ressources/$', FilRessources(), {}, 'rss_ressources'),
138 (r'^rss/actualites/$', FilActualites(), {}, 'rss_actualites'),
139 (r'^rss/appels/$', FilAppels(), {}, 'rss_appels'),
140 (r'^rss/agenda/$', FilEvenements(), {}, 'rss_agenda'),
141 (r'^rss/sites/$', FilSites(), {}, 'rss_sites'),
bf2904f0 142 (r'^rss/messages/(?P<groupe_id>\d+)/$', FilMessages(), {}, 'rss_messages'),
f8c16b3d 143 (r'^json/get/$', 'savoirs.views.json_get'),
144 (r'^json/set/$', 'savoirs.views.json_set'),
1719bf4e 145
fdcf5874
EMS
146 # recherches sauvegardées
147 (r'^recherches/$', 'savoirs.views.recherches', {}, 'recherches'),
148 (r'^recherches/(?P<type>[^/]*)/sauvegarder/$', 'savoirs.views.sauvegarder_recherche', {}, 'sauvegarder_recherche'),
149 (r'^recherches/(?P<id>\d+)/supprimer/$', 'savoirs.views.supprimer_recherche', {}, 'supprimer_recherche'),
150 (r'^recherches/(?P<id>\d+)/editer/$', 'savoirs.views.editer_recherche', {}, 'editer_recherche'),
4b89a7df
EMS
151 (r'^recherches/(?P<id>\d+)/activer-alerte/$', 'savoirs.views.activer_alerte', {}, 'activer_alerte'),
152 (r'^recherches/(?P<id>\d+)/desactiver-alerte/$', 'savoirs.views.desactiver_alerte', {}, 'desactiver_alerte'),
155a7c62
CR
153)
154
155if settings.DEBUG:
156 urlpatterns += patterns('',
157 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
158 {'document_root': settings.MEDIA_ROOT}),
159 )