You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.5 KiB
Python

from django.urls import path
from . import views
app_name = 'mensaviewer'
urlpatterns = [
# routes for overview
path('', views.flensburg, name='flensburg'),
path('custom-location', views.custom, name='custom'),
# raw create routes
path('add-location/', views.LocationCreateView.as_view(), name='location_create'),
path('add-news-article/', views.NewsArticleCreateView.as_view(), name='news_create'),
path('add-menu/', views.MenuCreateView.as_view(), name='menu_create'),
path('add-comment/', views.CommentCreateView.as_view(), name='comment_create'),
# relation-dependent create routes
path('location/<int:pk>/add-news-article/', views.NewsArticleCreateView.as_view(), name='news_add'),
path('location/<int:pk>/add-menu/', views.MenuCreateView.as_view(), name='menu_add'),
path('menu/<int:pk>/add-comment/', views.CommentCreateView.as_view(), name='comment_add'),
# list-view routes
path('locations/', views.LocationListView.as_view(), name='location_list'),
path('news-articles/', views.NewsArticleListView.as_view(), name='news_list'),
path('menus/', views.MenuListView.as_view(), name='menu_list'),
path('comments/', views.CommentListView.as_view(), name='comment_list'),
# detail-view routes
path('location/<int:pk>/', views.LocationDetailView.as_view(), name='location_detail'),
path('news-article/<int:pk>/', views.NewsArticleDetailView.as_view(), name='news_detail'),
path('menu/<int:pk>/', views.MenuDetailView.as_view(), name='menu_detail'),
path('comment/<int:pk>/', views.CommentDetailView.as_view(), name='comment_detail'),
# update-view routes
path('location/<int:pk>/edit/', views.LocationUpdateView.as_view(), name='location_update'),
path('news-artice/<int:pk>/edit/', views.NewsArticleUpdateView.as_view(), name='news_update'),
path('menu/<int:pk>/edit/', views.MenuUpdateView.as_view(), name='menu_update'),
path('comment/<int:pk>/edit/', views.CommentUpdateView.as_view(), name='comment_update'),
# delete-view routes
path('location/<int:pk>/delete/', views.LocationDeleteView.as_view(), name='location_delete'),
path('news-artice/<int:pk>/delete/', views.NewsArticleDeleteView.as_view(), name='news_delete'),
path('menu/<int:pk>/delete/', views.MenuDeleteView.as_view(), name='menu_delete'),
path('comment/<int:pk>/delete/', views.CommentDeleteView.as_view(), name='comment_delete'),
# like / dislike routes
path('menu/<int:pk>/like/', views.like, name='like'),
path('menu/<int:pk>/dislike/', views.dislike, name='dislike'),
]