Ne pas limiter le login à 30 caractères
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / urls.py
1 # -*- encoding: utf-8 -*-
2
3 from django.conf.urls.defaults import patterns, include, handler500, handler404, url
4 from django.conf import settings
5 from django.contrib import admin
6 from savoirs.rss import FilActualite, FilEvenement, FilAppels
7
8 admin.autodiscover()
9
10 handler500 = "views.page_500"
11 handler404 = "views.page_404"
12
13 site_feeds = {'actualites': FilActualite,
14 'agenda': FilEvenement,
15 'appels': FilAppels
16 }
17
18
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.
21 sep_patterns = patterns(
22 '',
23
24 # accueil
25 (r'^$', 'savoirs.views.index', {}, 'accueil'),
26
27 # recherche
28 (r'^recherche/$', 'savoirs.views.recherche'),
29 )
30
31 urlpatterns = sep_patterns + patterns(
32 '',
33
34 (r'^informations/$', 'savoirs.views.informations'),
35
36 # agenda
37 (r'^agenda/$', 'savoirs.views.evenement_index', {}, 'agenda'),
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'),
42 (r'^agenda/evenements/utilisation/$', 'savoirs.views.page_statique', dict(id='conditions-agenda'), 'conditions-agenda'),
43 (r'^agenda/evenements/creer/$', 'savoirs.views.evenement_ajout', {}, 'evenement-ajout'),
44 (r'^agenda/evenements/creer/options_fuseau_horaire/$', 'savoirs.views.options_fuseau_horaire'),
45
46 # sous-menu droite
47 (r'^a-propos/$', 'savoirs.views.page_statique', dict(id='a-propos'), 'a-propos'),
48 (r'^aide/$', 'savoirs.views.page_statique', dict(id='aide'), 'aide'),
49 (r'^domaines-de-recherche/$', 'savoirs.views.page_statique', dict(id='domaines-de-recherche'), 'domaines-de-recherche'),
50 (r'^legal/$', 'savoirs.views.page_statique', dict(id='legal'), 'legal'),
51 (r'^nous-contacter/$', 'savoirs.views.page_statique', dict(id='contact'), 'contact'),
52
53 # ressources
54 (r'^ressources/$', 'savoirs.views.ressource_index', {}, 'ressources'),
55 (r'^ressources/(?P<id>\d+)/$', 'savoirs.views.ressource_retrieve'),
56
57 # actualités
58 (r'^actualites/$', 'savoirs.views.actualite_index', {}, 'actualites'),
59 (r'^actualites/(?P<id>\d+)/$', 'savoirs.views.actualite', {}, 'actualite'),
60 (r'^appels/$', 'savoirs.views.actualite_index', dict(type='appels'), 'appels'),
61
62 # sites
63 (r'^sites/$', 'sitotheque.views.index', {}, 'sites'),
64 (r'^sites/(?P<id>\d+)/$', 'sitotheque.views.retrieve'),
65 (r'^sites/google.xml$', 'sitotheque.views.config_google'),
66
67 # sites AUF
68 (r'^sites-auf/$', 'savoirs.views.sites_auf', {}, 'sites-auf'),
69
70 # chercheurs
71 (r'^chercheurs/$', 'chercheurs.views.index', {}, 'chercheurs'),
72 (r'^chercheurs/(?P<id>\d+)/$', 'chercheurs.views.retrieve'),
73 (r'^chercheurs/inscription/$', 'chercheurs.views.inscription', {}, 'inscription'),
74 (r'^chercheurs/inscription_faite/$', 'django.views.generic.simple.direct_to_template', dict(
75 template='chercheurs/inscription_faite.html'
76 ), 'chercheurs-inscription-faite'),
77 (r'^chercheurs/activation/(?P<id_base36>.*)/(?P<token>.*)/$', 'chercheurs.views.activation', {}, 'chercheurs-activation'),
78 (r'^chercheurs/desinscription/$', 'chercheurs.views.desinscription'),
79 (r'^chercheurs/perso/$', 'chercheurs.views.perso'),
80 (r'^chercheurs/edit/$', 'chercheurs.views.edit'),
81 (r'^chercheurs/conversion$', 'savoirs.views.page_statique', dict(id='table-de-passage'), 'conversion'),
82 (r'^chercheurs/connexion/$', 'chercheurs.views.login', dict(
83 template_name='chercheurs/login.html'
84 ), 'chercheurs-login'),
85 (r'^chercheurs/deconnexion/$', 'django.contrib.auth.views.logout', dict(
86 template_name='chercheurs/logged_out.html'
87 ), 'chercheurs-logout'),
88 (r'^chercheurs/changement-mdp/$', 'django.contrib.auth.views.password_change', dict(
89 template_name='chercheurs/password_change_form.html',
90 post_change_redirect='/chercheurs/changement-mdp-fini/'
91 ), 'chercheurs-password-change'),
92 (r'^chercheurs/changement-mdp-fini/$', 'django.contrib.auth.views.password_change_done', dict(
93 template_name='chercheurs/password_change_done.html'
94 ), 'chercheurs-password-change-done'),
95 (r'^chercheurs/oubli-mdp/$', 'django.contrib.auth.views.password_reset', dict(
96 template_name='chercheurs/password_reset_form.html',
97 email_template_name='chercheurs/password_reset_email.txt',
98 post_reset_redirect='/chercheurs/oubli-mdp-envoye/'
99 ), 'chercheurs-password-reset'),
100 (r'^chercheurs/oubli-mdp-envoye/$', 'django.contrib.auth.views.password_reset_done', dict(
101 template_name='chercheurs/password_reset_done.html'
102 ), 'chercheurs-password-reset-done'),
103 (r'^chercheurs/oubli-mdp-retour/(?P<uidb36>.*)/(?P<token>.*)/$', 'django.contrib.auth.views.password_reset_confirm', dict(
104 template_name='chercheurs/password_reset_confirm.html'
105 ), 'chercheurs-password-reset-confirm'),
106 (r'^chercheurs/oubli-mdp-fini/$', 'django.contrib.auth.views.password_reset_complete', dict(
107 template_name='chercheurs/password_reset_complete.html'
108 )),
109 (r'^etablissements/autocomplete/$', 'chercheurs.views.etablissements_autocomplete'),
110 (r'^etablissements/autocomplete/(?P<pays>.*)/$', 'chercheurs.views.etablissements_autocomplete'),
111
112 # section par discipline et/ou région
113 (r'^discipline/(?P<discipline>\d+)/', include(sep_patterns)),
114 (r'^region/(?P<region>\d+)/', include(sep_patterns)),
115 (r'^discipline/(?P<discipline>\d+)/region/(?P<region>\d+)/', include(sep_patterns)),
116
117 # traduction disponible dans le frontend sans permissons
118 url(r'^jsi18n/$', admin.site.i18n_javascript,),
119
120 url(r'^admin_tools/', include('admin_tools.urls')),
121 (r'^admin/', include(admin.site.urls)),
122 (r'^admin/confirmation/(.*)', 'savoirs.admin_views.confirmation'),
123 (r'^admin/assigner_pays', 'savoirs.admin_views.assigner_pays'),
124 (r'^admin/assigner_thematiques', 'savoirs.admin_views.assigner_thematiques'),
125 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_regions', 'savoirs.admin_views.assigner_regions', {}, 'assigner_regions'),
126 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_disciplines', 'savoirs.admin_views.assigner_disciplines', {}, 'assigner_disciplines'),
127 (r'^admin/(.*)', admin.site.root),
128
129
130 # rss
131 (r'^rss/(.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict':site_feeds}),
132 (r'^json/get/$', 'savoirs.views.json_get'),
133 (r'^json/set/$', 'savoirs.views.json_set'),
134
135 )
136
137 if settings.DEBUG:
138 urlpatterns += patterns('',
139 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
140 {'document_root': settings.MEDIA_ROOT}),
141 )