197 lines
7.2 KiB
Python
197 lines
7.2 KiB
Python
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
|
from django.urls import path, include, re_path
|
|
from django.views.i18n import JavaScriptCatalog
|
|
|
|
|
|
from .views import *
|
|
|
|
urlpatterns = [
|
|
path("", home, name="home"),
|
|
path("semaine/<int:year>/<int:week>/", week_view, name="week_view"),
|
|
path("mois/<int:year>/<int:month>/", month_view, name="month_view"),
|
|
path("jour/<int:year>/<int:month>/<int:day>/", day_view, name="day_view"),
|
|
path("aujourdhui/", day_view, name="aujourdhui"),
|
|
path("cette-semaine/", week_view, name="cette_semaine"),
|
|
path("ce-mois-ci", month_view, name="ce_mois_ci"),
|
|
path("tag/<t>/", view_tag, name="view_tag"),
|
|
path("tags/", tag_list, name="view_all_tags"),
|
|
path("moderation/", moderation, name="moderation"),
|
|
path(
|
|
"event/<int:year>/<int:month>/<int:day>/<int:pk>-<extra>",
|
|
EventDetailView.as_view(),
|
|
name="view_event",
|
|
),
|
|
path("event/<int:pk>/edit", EventUpdateView.as_view(), name="edit_event"),
|
|
path(
|
|
"event/<int:pk>/change-status/<status>",
|
|
change_status_event,
|
|
name="change_status_event",
|
|
),
|
|
path("event/<int:pk>/delete", EventDeleteView.as_view(), name="delete_event"),
|
|
path(
|
|
"event/<int:year>/<int:month>/<int:day>/<int:pk>/set_duplicate",
|
|
set_duplicate,
|
|
name="set_duplicate",
|
|
),
|
|
path("event/<int:pk>/moderate", EventModerateView.as_view(), name="moderate_event"),
|
|
path("ajouter", import_event_proxy, name="add_event"),
|
|
path("ajouter/url", import_from_url, name="add_event_url"),
|
|
path("ajouter/urls", import_from_urls, name="add_event_urls"),
|
|
path("ajouter/details", EventCreateView.as_view(), name="add_event_details"),
|
|
path("admin/", admin.site.urls),
|
|
path("accounts/", include("django.contrib.auth.urls")),
|
|
path("test_app/", include("test_app.urls")),
|
|
path(
|
|
"static-content/create",
|
|
StaticContentCreateView.as_view(),
|
|
name="create_static_content",
|
|
),
|
|
path(
|
|
"static-content/<int:pk>/edit",
|
|
StaticContentUpdateView.as_view(),
|
|
name="edit_static_content",
|
|
),
|
|
path("rechercher", event_search, name="event_search"),
|
|
path("rechercher/complet/", event_search_full, name="event_search_full"),
|
|
path("mentions-legales", mentions_legales, name="mentions_legales"),
|
|
path("a-propos", about, name="about"),
|
|
path("merci", thank_you, name="thank_you"),
|
|
path("contact", ContactMessageCreateView.as_view(), name="contact"),
|
|
path("contactmessages", contactmessages, name="contactmessages"),
|
|
path(
|
|
"contactmessage/<int:pk>",
|
|
ContactMessageUpdateView.as_view(),
|
|
name="contactmessage",
|
|
),
|
|
path("imports/", imports, name="imports"),
|
|
path("imports/add", add_import, name="add_import"),
|
|
path("imports/<int:pk>/cancel", cancel_import, name="cancel_import"),
|
|
path("rimports/", recurrent_imports, name="recurrent_imports"),
|
|
path("rimports/run", run_all_rimports, name="run_all_rimports"),
|
|
path("rimports/add", RecurrentImportCreateView.as_view(), name="add_rimport"),
|
|
path("rimports/<int:pk>/view", view_rimport, name="view_rimport"),
|
|
path(
|
|
"rimports/<int:pk>/edit",
|
|
RecurrentImportUpdateView.as_view(),
|
|
name="edit_rimport",
|
|
),
|
|
path(
|
|
"rimports/<int:pk>/delete",
|
|
RecurrentImportDeleteView.as_view(),
|
|
name="delete_rimport",
|
|
),
|
|
path("rimports/<int:pk>/run", run_rimport, name="run_rimport"),
|
|
path("catrules/", categorisation_rules, name="categorisation_rules"),
|
|
path("catrules/add", CategorisationRuleCreateView.as_view(), name="add_catrule"),
|
|
path(
|
|
"catrules/<int:pk>/edit",
|
|
CategorisationRuleUpdateView.as_view(),
|
|
name="edit_catrule",
|
|
),
|
|
path(
|
|
"catrules/<int:pk>/delete",
|
|
CategorisationRuleDeleteView.as_view(),
|
|
name="delete_catrule",
|
|
),
|
|
path("catrules/apply", apply_categorisation_rules, name="apply_catrules"),
|
|
path("duplicates/", duplicates, name="duplicates"),
|
|
path(
|
|
"duplicates/<int:pk>",
|
|
DuplicatedEventsDetailView.as_view(),
|
|
name="view_duplicate",
|
|
),
|
|
path("duplicates/<int:pk>/fix", fix_duplicate, name="fix_duplicate"),
|
|
path("duplicates/<int:pk>/merge", merge_duplicate, name="merge_duplicate"),
|
|
path("mquestions/", ModerationQuestionListView.as_view(), name="view_mquestions"),
|
|
path(
|
|
"mquestions/add", ModerationQuestionCreateView.as_view(), name="add_mquestion"
|
|
),
|
|
path(
|
|
"mquestions/<int:pk>/",
|
|
ModerationQuestionDetailView.as_view(),
|
|
name="view_mquestion",
|
|
),
|
|
path(
|
|
"mquestions/<int:pk>/edit",
|
|
ModerationQuestionUpdateView.as_view(),
|
|
name="edit_mquestion",
|
|
),
|
|
path(
|
|
"mquestions/<int:pk>/delete",
|
|
ModerationQuestionDeleteView.as_view(),
|
|
name="delete_mquestion",
|
|
),
|
|
path(
|
|
"mquestions/<int:qpk>/answers/add",
|
|
ModerationAnswerCreateView.as_view(),
|
|
name="add_manswer",
|
|
),
|
|
path(
|
|
"mquestions/<int:qpk>/answers/<int:pk>/edit",
|
|
ModerationAnswerUpdateView.as_view(),
|
|
name="edit_manswer",
|
|
),
|
|
path(
|
|
"mquestions/<int:qpk>/answers/<int:pk>/delete",
|
|
ModerationAnswerDeleteView.as_view(),
|
|
name="delete_manswer",
|
|
),
|
|
path("404/", page_not_found, name="page_not_found"),
|
|
path("500/", internal_server_error, name="internal_server_error"),
|
|
path("place/<int:pk>", PlaceDetailView.as_view(), name="view_place"),
|
|
path("place/<int:pk>/edit", PlaceUpdateView.as_view(), name="edit_place"),
|
|
path("place/<int:pk>/delete", PlaceDeleteView.as_view(), name="delete_place"),
|
|
path("places/", PlaceListView.as_view(), name="view_places"),
|
|
path("places/list", PlaceListAdminView.as_view(), name="view_places_admin"),
|
|
path("places/add", PlaceCreateView.as_view(), name="add_place"),
|
|
path(
|
|
"places/add/<int:pk>",
|
|
PlaceFromEventCreateView.as_view(),
|
|
name="add_place_from_event",
|
|
),
|
|
path(
|
|
"events/unknown-places",
|
|
UnknownPlacesListView.as_view(),
|
|
name="view_unknown_places",
|
|
),
|
|
path("events/unknown-places/fix", fix_unknown_places, name="fix_unknown_places"),
|
|
path(
|
|
"event/<int:pk>/addplace",
|
|
UnknownPlaceAddView.as_view(),
|
|
name="add_place_to_event",
|
|
),
|
|
path(
|
|
"event/<int:year>/<int:month>/<int:day>/<int:pk>/ical",
|
|
export_event_ical,
|
|
name="export_event_ical"),
|
|
path(
|
|
"ical",
|
|
export_ical,
|
|
name="export_ical"),
|
|
re_path(r'^robots\.txt', include('robots.urls')),
|
|
path("__debug__/", include("debug_toolbar.urls")),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += staticfiles_urlpatterns()
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
# If you already have a js_info_dict dictionary, just add
|
|
# 'recurrence' to the existing 'packages' tuple.
|
|
js_info_dict = {
|
|
"packages": ("recurrence",),
|
|
}
|
|
|
|
# jsi18n can be anything you like here
|
|
urlpatterns += [
|
|
path(
|
|
"jsi18n.js", JavaScriptCatalog.as_view(packages=["recurrence"]), name="jsi18n"
|
|
),
|
|
]
|
|
|
|
handler404 = "agenda_culturel.views.page_not_found"
|
|
handler500 = "agenda_culturel.views.internal_server_error"
|