gestioCOF/cof/urls.py

115 lines
4.7 KiB
Python
Raw Normal View History

2016-07-15 00:02:56 +02:00
# -*- coding: utf-8 -*-
2016-07-09 19:49:38 +02:00
2016-11-06 15:39:14 +01:00
"""
Fichier principal de configuration des urls du projet GestioCOF
"""
2016-07-09 19:49:38 +02:00
from django.conf import settings
from django.conf.urls import include, url
2018-02-03 22:34:37 +01:00
from django.conf.urls.i18n import i18n_patterns
2016-07-09 19:49:38 +02:00
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic.base import TemplateView
from django.contrib.auth import views as django_views
from django_cas_ng import views as django_cas_views
2016-11-06 15:39:14 +01:00
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from gestioncof import views as gestioncof_views, csv_views
from gestioncof.urls import export_patterns, petitcours_patterns, \
surveys_patterns, events_patterns, calendar_patterns, \
clubs_patterns
from gestioncof.autocomplete import autocomplete
admin.autodiscover()
urlpatterns = [
# Page d'accueil
2018-02-03 22:34:37 +01:00
url(r'^gestion/$', gestioncof_views.home, name='home'),
# Le BdA
2018-02-03 22:34:37 +01:00
url(r'^gestion/bda/', include('bda.urls')),
# Les exports
2018-02-03 22:34:37 +01:00
url(r'^gestion/export/', include(export_patterns)),
# Les petits cours
2018-02-03 22:34:37 +01:00
url(r'^gestion/petitcours/', include(petitcours_patterns)),
# Les sondages
2018-02-03 22:34:37 +01:00
url(r'^gestion/survey/', include(surveys_patterns)),
# Evenements
2018-02-03 22:34:37 +01:00
url(r'^gestion/event/', include(events_patterns)),
# Calendrier
2018-02-03 22:34:37 +01:00
url(r'^gestion/calendar/', include(calendar_patterns)),
# Clubs
2018-02-03 22:34:37 +01:00
url(r'^gestion/clubs/', include(clubs_patterns)),
# Authentification
2018-02-03 22:34:37 +01:00
url(r'^gestion/cof/denied$', TemplateView.as_view(template_name='cof-denied.html'),
name="cof-denied"),
2018-02-03 22:34:37 +01:00
url(r'^gestion/cas/login$', django_cas_views.login, name="cas_login_view"),
url(r'^gestion/cas/logout$', django_cas_views.logout),
url(r'^gestion/outsider/login$', gestioncof_views.login_ext,
name="ext_login_view"),
2018-02-03 22:34:37 +01:00
url(r'^gestion/outsider/logout$', django_views.logout, {'next_page': 'home'}),
url(r'^gestion/login$', gestioncof_views.login, name="cof-login"),
url(r'^gestion/logout$', gestioncof_views.logout, name="cof-logout"),
# Infos persos
2018-02-03 22:34:37 +01:00
url(r'^gestion/profile$', gestioncof_views.profile,
name='profile'),
2018-02-03 22:34:37 +01:00
url(r'^gestion/outsider/password-change$', django_views.password_change,
name='password_change'),
2018-02-03 22:34:37 +01:00
url(r'^gestion/outsider/password-change-done$',
django_views.password_change_done,
2016-06-09 01:58:03 +02:00
name='password_change_done'),
# Inscription d'un nouveau membre
2018-02-03 22:34:37 +01:00
url(r'^gestion/registration$', gestioncof_views.registration,
name='registration'),
2018-02-03 22:34:37 +01:00
url(r'^gestion/registration/clipper/(?P<login_clipper>[\w-]+)/'
r'(?P<fullname>.*)$',
gestioncof_views.registration_form2, name="clipper-registration"),
2018-02-03 22:34:37 +01:00
url(r'^gestion/registration/user/(?P<username>.+)$',
gestioncof_views.registration_form2, name="user-registration"),
2018-02-03 22:34:37 +01:00
url(r'^gestion/registration/empty$', gestioncof_views.registration_form2,
name="empty-registration"),
# Autocompletion
2018-02-03 22:34:37 +01:00
url(r'^gestion/autocomplete/registration$', autocomplete),
url(r'^gestion/user/autocomplete$', gestioncof_views.user_autocomplete,
name='cof-user-autocomplete'),
# Interface admin
2018-02-03 22:34:37 +01:00
url(r'^gestion/admin/logout/', gestioncof_views.logout),
url(r'^gestion/admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^gestion/admin/(?P<app_label>[\d\w]+)/(?P<model_name>[\d\w]+)/csv/',
csv_views.admin_list_export,
{'fields': ['username', ]}),
2018-02-03 22:34:37 +01:00
url(r'^gestion/admin/', include(admin.site.urls)),
# Liens utiles du COF et du BdA
2018-02-03 22:34:37 +01:00
url(r'^gestion/utile_cof$', gestioncof_views.utile_cof,
name='utile_cof'),
2018-02-03 22:34:37 +01:00
url(r'^gestion/utile_bda$', gestioncof_views.utile_bda,
name='utile_bda'),
2018-02-03 22:34:37 +01:00
url(r'^gestion/utile_bda/bda_diff$', gestioncof_views.liste_bdadiff),
url(r'^gestion/utile_cof/diff_cof$', gestioncof_views.liste_diffcof),
url(r'^gestion/utile_bda/bda_revente$', gestioncof_views.liste_bdarevente),
url(r'^gestion/k-fet/', include('kfet.urls')),
url(r'^gestion/cms/', include(wagtailadmin_urls)),
url(r'^gestion/documents/', include(wagtaildocs_urls)),
2017-05-26 00:58:59 +02:00
# djconfig
2018-02-03 22:34:37 +01:00
url(r"^gestion/config", gestioncof_views.ConfigUpdate.as_view()),
]
if 'debug_toolbar' in settings.INSTALLED_APPS:
2016-11-06 15:39:14 +01:00
import debug_toolbar
2016-11-06 19:44:05 +01:00
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
2016-11-06 15:39:14 +01:00
]
if settings.DEBUG:
# Si on est en production, MEDIA_ROOT est servi par Apache.
# Il faut dire à Django de servir MEDIA_ROOT lui-même en développement.
2016-11-18 01:09:39 +01:00
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)
# Wagtail for uncatched
2018-02-03 22:34:37 +01:00
urlpatterns += i18n_patterns(
url(r'', include(wagtail_urls)),
2018-02-03 22:34:37 +01:00
)