Assigner les disciplines et régions en bloc dans l'admin
[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
19 # traduction disponible dans le frontend sans permissons
20 url(r'^jsi18n/$', admin.site.i18n_javascript,),
21
22 url(r'^admin_tools/', include('admin_tools.urls')),
23 (r'^admin/', include(admin.site.urls)),
24 (r'^admin/confirmation/(.*)', 'savoirs.admin_views.confirmation'),
25 (r'^admin/assigner_pays', 'savoirs.admin_views.assigner_pays'),
26 (r'^admin/assigner_thematiques', 'savoirs.admin_views.assigner_thematiques'),
27 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_regions', 'savoirs.admin_views.assigner_regions', {}, 'assigner_regions'),
28 (r'^admin/(?P<app_name>[^/]*)/(?P<model_name>[^/]*)/assigner_disciplines', 'savoirs.admin_views.assigner_disciplines', {}, 'assigner_disciplines'),
29 (r'^admin/(.*)', admin.site.root),
30
31 (r'^accounts/login/$', 'chercheurs.views.chercheur_login', {'template_name': 'accounts/login.html'}),
32 (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'accounts/logout.html'}),
33 (r'^accounts/change_password/$', 'chercheurs.views.change_password'),
34 (r'^accounts/send_password/$', 'chercheurs.views.send_password'),
35 (r'^accounts/new_password/(.+)/(.+)/$', 'chercheurs.views.new_password'),
36
37 # sous-menu gauche
38 (r'^$', 'savoirs.views.index'),
39
40 # sous-menu droite
41 (r'^a-propos/$', 'savoirs.views.a_propos'),
42 (r'^legal/$', 'savoirs.views.legal'),
43 (r'^nous-contacter/$', 'savoirs.views.nous_contacter'),
44
45 # recherche
46 (r'^recherche/$', 'savoirs.views.recherche'),
47
48 # ressources
49 (r'^ressources/$', 'savoirs.views.ressource_index'),
50 (r'^ressources/(?P<id>\d+)/$', 'savoirs.views.ressource_retrieve'),
51 (r'^informations/$', 'savoirs.views.informations'),
52
53 # actualités
54 (r'^actualites/$', 'savoirs.views.actualite_index'),
55
56 # agenda
57 (r'^agenda/$', 'savoirs.views.evenement_index'),
58 (r'^agenda/evenements/utilisation/$', 'savoirs.views.evenement_utilisation'),
59 (r'^agenda/evenements/creer/$', 'savoirs.views.evenement_ajout'),
60 (r'^agenda/evenements/moderer/$', 'savoirs.views.evenement_moderation'),
61 (r'^agenda/evenements/moderer/(.+)/accepter/$', 'savoirs.views.evenement_accepter'),
62 (r'^agenda/evenements/moderer/(.+)/refuser/$', 'savoirs.views.evenement_refuser'),
63 (r'^agenda/evenements/(.+)/$', 'savoirs.views.evenement'),
64
65 # chercheurs
66 (r'^chercheurs/$', 'chercheurs.views.index'),
67 (r'^chercheurs/(?P<id>\d+)/$', 'chercheurs.views.retrieve'),
68 (r'^chercheurs/inscription/$', 'chercheurs.views.inscription'),
69 (r'^chercheurs/perso/$', 'chercheurs.views.perso'),
70 (r'^chercheurs/edit/$', 'chercheurs.views.edit'),
71 (r'^chercheurs/conversion$', 'chercheurs.views.conversion'),
72
73 # sites
74 (r'^sites/$', 'sitotheque.views.index'),
75 (r'^sites/(?P<id>\d+)/$', 'sitotheque.views.retrieve'),
76
77 # sites AUF
78 (r'^sites-auf/$', 'savoirs.views.sites_auf'),
79
80 (r'^rss/(.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict':site_feeds}),
81 (r'^json/get/$', 'savoirs.views.json_get'),
82 (r'^json/set/$', 'savoirs.views.json_set'),
83
84 )
85
86 if settings.DEBUG:
87 urlpatterns += patterns('',
88 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
89 {'document_root': settings.MEDIA_ROOT}),
90 )