Rend à gestiocof ce qui est à gestiocof

This commit is contained in:
Ludovic Stephan 2020-08-11 17:19:32 +02:00 committed by Martin Pépin
parent 12d3ef0c02
commit 858a0c61e2
No known key found for this signature in database
GPG key ID: E7520278B1774448
2 changed files with 107 additions and 97 deletions

View file

@ -5,14 +5,10 @@ from django.conf import settings
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as django_auth_views
from django.urls import include, path
from django.views.generic.base import TemplateView
from django_cas_ng import views as django_cas_views
# Website administration (independent from installed apps)
admin.autodiscover()
urlpatterns = [
path("admin/doc/", include("django.contrib.admindocs.urls")),
path("admin/", admin.site.urls),
@ -23,14 +19,6 @@ if "gestioncof" in settings.INSTALLED_APPS:
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from gestioncof import csv_views, views as gestioncof_views
from gestioncof.urls import (
calendar_patterns,
clubs_patterns,
events_patterns,
export_patterns,
surveys_patterns,
)
# Also includes BdA, K-Fêt, etc.
urlpatterns += [
@ -44,93 +32,11 @@ if "gestioncof" in settings.INSTALLED_APPS:
path("", gestioncof_views.HomeView.as_view(), name="home"),
# Le BdA
path("bda/", include("bda.urls")),
# Les exports
path("export/", include(export_patterns)),
# Les petits cours
path("petitcours/", include("petitscours.urls")),
# Les sondages
path("survey/", include(surveys_patterns)),
# Evenements
path("event/", include(events_patterns)),
# Calendrier
path("calendar/", include(calendar_patterns)),
# Clubs
path("clubs/", include(clubs_patterns)),
# Authentification
path(
"cof/denied",
TemplateView.as_view(template_name="cof-denied.html"),
name="cof-denied",
),
path("cas/login", django_cas_views.LoginView.as_view(), name="cas_login_view"),
path("cas/logout", django_cas_views.LogoutView.as_view()),
path(
"outsider/login",
gestioncof_views.LoginExtView.as_view(),
name="ext_login_view",
),
path(
"outsider/logout",
django_auth_views.LogoutView.as_view(),
{"next_page": "home"},
),
path("login", gestioncof_views.login, name="cof-login"),
path("logout", gestioncof_views.logout, name="cof-logout"),
# Infos persos
path("profile", gestioncof_views.profile, name="profile"),
path(
"outsider/password-change",
django_auth_views.PasswordChangeView.as_view(),
name="password_change",
),
path(
"outsider/password-change-done",
django_auth_views.PasswordChangeDoneView.as_view(),
name="password_change_done",
),
# Inscription d'un nouveau membre
path("registration", gestioncof_views.registration, name="registration"),
path(
"registration/clipper/<slug:login_clipper>/<fullname>",
gestioncof_views.registration_form2,
name="clipper-registration",
),
path(
"registration/user/<username>",
gestioncof_views.registration_form2,
name="user-registration",
),
path(
"registration/empty",
gestioncof_views.registration_form2,
name="empty-registration",
),
# Autocompletion
path(
"autocomplete/registration",
gestioncof_views.RegistrationAutocompleteView.as_view(),
name="cof.registration.autocomplete",
),
path(
"user/autocomplete",
gestioncof_views.UserAutocompleteView.as_view(),
name="cof-user-autocomplete",
),
# Liens utiles du COF et du BdA
path("utile_cof", gestioncof_views.utile_cof, name="utile_cof"),
path("utile_bda", gestioncof_views.utile_bda, name="utile_bda"),
path("utile_bda/bda_diff", gestioncof_views.liste_bdadiff, name="ml_diffbda"),
path("utile_cof/diff_cof", gestioncof_views.liste_diffcof, name="ml_diffcof"),
path(
"utile_bda/bda_revente",
gestioncof_views.liste_bdarevente,
name="ml_bda_revente",
),
path("k-fet/", include("kfet.urls")),
path("cms/", include(wagtailadmin_urls)),
path("documents/", include(wagtaildocs_urls)),
# djconfig
path("config", gestioncof_views.ConfigUpdate.as_view(), name="config.edit"),
# js-reverse
path("jsreverse/", urls_js, name="js_reverse"),
]

View file

@ -1,6 +1,9 @@
from django.urls import path
from django.contrib.auth import views as django_auth_views
from django.urls import include, path
from django.views.generic.base import TemplateView
from django_cas_ng import views as django_cas_views
from gestioncof import views
from gestioncof import csv_views, views
export_patterns = [
path("members", views.export_members, name="cof.membres_export"),
@ -42,3 +45,104 @@ clubs_patterns = [
name="change-respo",
),
]
registration_patterns = [
# Inscription d'un nouveau membre
path("", views.registration, name="registration"),
path(
"clipper/<slug:login_clipper>/<fullname>",
views.registration_form2,
name="clipper-registration",
),
path("user/<username>", views.registration_form2, name="user-registration",),
path("empty", views.registration_form2, name="empty-registration",),
# Autocompletion
path(
"autocomplete",
views.RegistrationAutocompleteView.as_view(),
name="cof.registration.autocomplete",
),
]
urlpatterns = [
path(
"admin/<slug:app_label>/<slug:model_name>/csv/",
csv_views.admin_list_export,
{"fields": ["username"]},
),
# -----
# Misc
# -----
path("", views.HomeView.as_view(), name="home"),
path(
"user/autocomplete",
views.UserAutocompleteView.as_view(),
name="cof-user-autocomplete",
),
path("config", views.ConfigUpdate.as_view(), name="config.edit"),
# -----
# Authentification
# -----
path(
"cof/denied",
TemplateView.as_view(template_name="cof-denied.html"),
name="cof-denied",
),
path("cas/login", django_cas_views.LoginView.as_view(), name="cas_login_view"),
path("cas/logout", django_cas_views.LogoutView.as_view()),
path("outsider/login", views.LoginExtView.as_view(), name="ext_login_view",),
path(
"outsider/logout",
django_auth_views.LogoutView.as_view(),
{"next_page": "home"},
),
path("login", views.login, name="cof-login"),
path("logout", views.logout, name="cof-logout"),
path("admin/logout/", views.logout),
# -----
# Infos persos
# -----
path("profile", views.profile, name="profile"),
path(
"outsider/password-change",
django_auth_views.PasswordChangeView.as_view(),
name="password_change",
),
path(
"outsider/password-change-done",
django_auth_views.PasswordChangeDoneView.as_view(),
name="password_change_done",
),
# -----
# Liens utiles du COF et du BdA
# -----
path("utile_cof", views.utile_cof, name="utile_cof"),
path("utile_bda", views.utile_bda, name="utile_bda"),
path("utile_bda/bda_diff", views.liste_bdadiff, name="ml_diffbda"),
path("utile_cof/diff_cof", views.liste_diffcof, name="ml_diffcof"),
path("utile_bda/bda_revente", views.liste_bdarevente, name="ml_bda_revente",),
# -----
# Inscription d'un nouveau membre
# -----
path("registration/", include(registration_patterns)),
# -----
# Les exports
# -----
path("export/", include(export_patterns)),
# -----
# Les sondages
# -----
path("survey/", include(surveys_patterns)),
# -----
# Evenements
# -----
path("event/", include(events_patterns)),
# -----
# Calendrier
# -----
path("calendar/", include(calendar_patterns)),
# -----
# Clubs
# -----
path("clubs/", include(clubs_patterns)),
]