Typo
[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
79b400f0 6from savoirs.rss import FilActualite, FilEvenement
5ecd5424 7
155a7c62
CR
8admin.autodiscover()
9
1e28a70a 10handler500 = "views.page_500"
11handler404 = "views.page_404"
155a7c62 12
79b400f0 13site_feeds = {'actualites': FilActualite,
14 'agenda': FilEvenement }
37c3ba94 15
16
bae03b7b
EMS
17# Les URLs suivantes peuvent être préfixées de la discipline et/ou la
18# région. Nous les regroupons donc dans un module qu'on incluera plus bas.
19sep_patterns = patterns(
155a7c62 20 '',
713e8613 21
bae03b7b
EMS
22 # accueil
23 (r'^$', 'savoirs.views.index'),
f24e513e 24
f8c16b3d 25 # recherche
92c7413b 26 (r'^recherche/$', 'savoirs.views.recherche'),
f0692c02
EMS
27)
28
29urlpatterns = sep_patterns + patterns(
30 '',
31
32 (r'^informations/$', 'savoirs.views.informations'),
33
34 # agenda
35 (r'^agenda/$', 'savoirs.views.evenement_index'),
36 (r'^agenda/evenements/(?P<id>\d+)/$', 'savoirs.views.evenement'),
37 (r'^agenda/evenements/moderer/$', 'savoirs.views.evenement_moderation'),
38 (r'^agenda/evenements/moderer/(.+)/accepter/$', 'savoirs.views.evenement_accepter'),
39 (r'^agenda/evenements/moderer/(.+)/refuser/$', 'savoirs.views.evenement_refuser'),
1719bf4e
EMS
40 (r'^agenda/evenements/utilisation/$', 'savoirs.views.evenement_utilisation'),
41 (r'^agenda/evenements/creer/$', 'savoirs.views.evenement_ajout'),
42 (r'^agenda/evenements/creer/options_fuseau_horaire/$', 'savoirs.views.options_fuseau_horaire'),
f0692c02
EMS
43
44 # sous-menu droite
45 (r'^a-propos/$', 'savoirs.views.a_propos'),
46 (r'^legal/$', 'savoirs.views.legal'),
47 (r'^nous-contacter/$', 'savoirs.views.nous_contacter'),
c1b134f8 48
f8c16b3d 49 # ressources
50 (r'^ressources/$', 'savoirs.views.ressource_index'),
91e0aefb 51 (r'^ressources/(?P<id>\d+)/$', 'savoirs.views.ressource_retrieve'),
f0692c02 52
f8c16b3d 53 # actualités
54 (r'^actualites/$', 'savoirs.views.actualite_index'),
c30f12c5 55 (r'^actualites/(?P<id>\d+)/$', 'savoirs.views.actualite'),
c1b134f8 56
f0692c02
EMS
57 # sites
58 (r'^sites/$', 'sitotheque.views.index'),
59 (r'^sites/(?P<id>\d+)/$', 'sitotheque.views.retrieve'),
60
61 # sites AUF
62 (r'^sites-auf/$', 'savoirs.views.sites_auf'),
f8c16b3d 63
64 # chercheurs
65 (r'^chercheurs/$', 'chercheurs.views.index'),
da091176 66 (r'^chercheurs/(?P<id>\d+)/$', 'chercheurs.views.retrieve'),
932eef9a 67 (r'^chercheurs/inscription/$', 'chercheurs.views.inscription'),
8baa2a56 68 (r'^chercheurs/desinscription/$', 'chercheurs.views.desinscription'),
9af73c99 69 (r'^chercheurs/perso/$', 'chercheurs.views.perso'),
b3e1079e 70 (r'^chercheurs/edit/$', 'chercheurs.views.edit'),
d9885bf7 71 (r'^chercheurs/conversion$', 'chercheurs.views.conversion'),
d4736474
EMS
72 (r'^chercheurs/connexion/$', 'django.contrib.auth.views.login', dict(
73 template_name='chercheurs/login.html'
74 ), 'chercheurs-login'),
75 (r'^chercheurs/deconnexion/$', 'django.contrib.auth.views.logout', dict(
76 template_name='chercheurs/logged_out.html'
77 ), 'chercheurs-logout'),
78 (r'^chercheurs/changement-mdp/$', 'django.contrib.auth.views.password_change', dict(
79 template_name='chercheurs/password_change_form.html',
80 post_change_redirect='/chercheurs/changement-mdp-fini/'
81 ), 'chercheurs-password-change'),
82 (r'^chercheurs/changement-mdp-fini/$', 'django.contrib.auth.views.password_change_done', dict(
83 template_name='chercheurs/password_change_done.html'
84 ), 'chercheurs-password-change-done'),
85 (r'^chercheurs/oubli-mdp/$', 'django.contrib.auth.views.password_reset', dict(
86 template_name='chercheurs/password_reset_form.html',
87 email_template_name='chercheurs/password_reset_email.txt',
88 post_reset_redirect='/chercheurs/oubli-mdp-envoye/'
89 ), 'chercheurs-password-reset'),
90 (r'^chercheurs/oubli-mdp-envoye/$', 'django.contrib.auth.views.password_reset_done', dict(
91 template_name='chercheurs/password_reset_done.html'
92 ), 'chercheurs-password-reset-done'),
93 (r'^chercheurs/oubli-mdp-retour/(?P<uidb36>.*)/(?P<token>.*)/$', 'django.contrib.auth.views.password_reset_confirm', dict(
94 template_name='chercheurs/password_reset_confirm.html'
95 ), 'chercheurs-password-reset-confirm'),
96 (r'^chercheurs/oubli-mdp-fini/$', 'django.contrib.auth.views.password_reset_complete', dict(
97 template_name='chercheurs/password_reset_complete.html'
98 )),
219710da 99 (r'^etablissements/autocomplete/$', 'chercheurs.views.etablissements_autocomplete'),
e836f6f7 100 (r'^etablissements/autocomplete/(?P<pays>.*)/$', 'chercheurs.views.etablissements_autocomplete'),
9af73c99 101
bae03b7b
EMS
102 # section par discipline et/ou région
103 (r'^discipline/(?P<discipline>\d+)/', include(sep_patterns)),
104 (r'^region/(?P<region>\d+)/', include(sep_patterns)),
105 (r'^discipline/(?P<discipline>\d+)/region/(?P<region>\d+)/', include(sep_patterns)),
106
107 # traduction disponible dans le frontend sans permissons
108 url(r'^jsi18n/$', admin.site.i18n_javascript,),
109
110 url(r'^admin_tools/', include('admin_tools.urls')),
111 (r'^admin/', include(admin.site.urls)),
112 (r'^admin/confirmation/(.*)', 'savoirs.admin_views.confirmation'),
113 (r'^admin/assigner_pays', 'savoirs.admin_views.assigner_pays'),
114 (r'^admin/assigner_thematiques', 'savoirs.admin_views.assigner_thematiques'),
115 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_regions', 'savoirs.admin_views.assigner_regions', {}, 'assigner_regions'),
116 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_disciplines', 'savoirs.admin_views.assigner_disciplines', {}, 'assigner_disciplines'),
117 (r'^admin/(.*)', admin.site.root),
118
bae03b7b 119
bae03b7b 120 # rss
37c3ba94 121 (r'^rss/(.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict':site_feeds}),
f8c16b3d 122 (r'^json/get/$', 'savoirs.views.json_get'),
123 (r'^json/set/$', 'savoirs.views.json_set'),
1719bf4e 124
155a7c62
CR
125)
126
127if settings.DEBUG:
128 urlpatterns += patterns('',
129 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
130 {'document_root': settings.MEDIA_ROOT}),
131 )