Changements divers
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / urls.py
1 # -*- encoding: utf-8 -*-
2 from django.conf.urls.defaults import patterns, include, handler500, url
3 from django.conf import settings
4 from django.contrib import admin
5 from savoirs.rss import FilActualite, FilEvenement
6
7 admin.autodiscover()
8
9 handler500 # Pyflakes
10
11 site_feeds = {'actualites': FilActualite,
12 'agenda': FilEvenement }
13
14
15 urlpatterns = patterns(
16 '',
17 url(r'^admin_tools/', include('admin_tools.urls')),
18 (r'^admin/', include(admin.site.urls)),
19 (r'^admin/confirmation/(.*)', 'savoirs.admin_views.confirmation'),
20 (r'^admin/assigner_pays', 'savoirs.admin_views.assigner_pays'),
21 (r'^admin/assigner_regions', 'savoirs.admin_views.assigner_regions'),
22 (r'^admin/assigner_thematiques', 'savoirs.admin_views.assigner_thematiques'),
23 (r'^admin/assigner_disciplines', 'savoirs.admin_views.assigner_disciplines'),
24 (r'^admin/(.*)', admin.site.root),
25
26 (r'^accounts/login/$', 'chercheurs.views.chercheur_login', {'template_name': 'accounts/login.html'}),
27 (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'accounts/logout.html'}),
28 (r'^accounts/send_password/$', 'chercheurs.views.send_password'),
29 (r'^accounts/new_password/(.+)/(.+)/$', 'chercheurs.views.new_password'),
30
31 # sous-menu gauche
32 (r'^$', 'savoirs.views.index'),
33
34 # sous-menu droite
35 (r'^a-propos/$', 'savoirs.views.a_propos'),
36 (r'^nous-contacter/$', 'savoirs.views.nous_contacter'),
37
38 # recherche
39 (r'^recherche/$', 'savoirs.views.recherche'),
40 (r'^recherche/avancee/$', 'savoirs.views.avancee'),
41 (r'^recherche/conseils/$', 'savoirs.views.conseils'),
42
43 # ressources
44 (r'^ressources/$', 'savoirs.views.ressource_index'),
45 (r'^ressources/(?P<id>\d+)/$', 'savoirs.views.ressource_retrieve'),
46 (r'^informations/$', 'savoirs.views.informations'),
47
48 # actualités
49 (r'^actualites/$', 'savoirs.views.actualite_index'),
50
51 # agenda
52 (r'^agenda/$', 'savoirs.views.evenement_index'),
53 (r'^agenda/evenements/creer/$', 'savoirs.views.evenement_ajout'),
54 (r'^agenda/evenements/moderer/$', 'savoirs.views.evenement_moderation'),
55 (r'^agenda/evenements/moderer/(.+)/accepter/$', 'savoirs.views.evenement_accepter'),
56 (r'^agenda/evenements/moderer/(.+)/refuser/$', 'savoirs.views.evenement_refuser'),
57 (r'^agenda/evenements/(.+)/$', 'savoirs.views.evenement'),
58
59 # chercheurs
60 (r'^chercheurs/$', 'chercheurs.views.index'),
61 (r'^chercheurs/(?P<id>\d+)/$', 'chercheurs.views.retrieve'),
62 (r'^chercheurs/inscription/$', 'chercheurs.views.inscription'),
63 (r'^chercheurs/perso/$', 'chercheurs.views.perso'),
64 (r'^chercheurs/edit/$', 'chercheurs.views.edit'),
65
66 # sites
67 (r'^sites/$', 'sitotheque.views.index'),
68 (r'^sites/(?P<id>\d+)/$', 'sitotheque.views.retrieve'),
69
70 (r'^rss/(.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict':site_feeds}),
71 (r'^json/get/$', 'savoirs.views.json_get'),
72 (r'^json/set/$', 'savoirs.views.json_set'),
73
74 )
75
76 if settings.DEBUG:
77 urlpatterns += patterns('',
78 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
79 {'document_root': settings.MEDIA_ROOT}),
80 )