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