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