mamweb/seminar/urls.py

110 lines
4.3 KiB
Python
Raw Normal View History

2019-06-20 21:00:23 +02:00
from django.urls import path, include
from django.contrib.auth.decorators import user_passes_test
2015-05-06 17:07:32 +02:00
from . import views, export
from .utils import staff_member_required
2016-05-08 11:26:10 +02:00
from django.views.generic.base import RedirectView
2015-03-14 22:52:45 +01:00
staff_member_required = user_passes_test(lambda u: u.is_staff)
2016-01-09 17:28:20 +01:00
urlpatterns = [
2019-05-11 01:15:05 +02:00
# REDIRECTy
2019-06-20 21:00:23 +02:00
path('jak-resit/', RedirectView.as_view(url='/co-je-MaM/jak-resit/')),
2016-05-08 11:26:10 +02:00
2019-05-11 01:15:05 +02:00
# Organizatori
2019-06-20 21:00:23 +02:00
path('co-je-MaM/organizatori/', views.CojemamOrganizatoriView.as_view(), name='organizatori'),
path('co-je-MaM/organizatori/organizovali/', views.CojemamOrganizatoriStariView.as_view(), name='stari_organizatori'),
2015-06-03 14:16:30 +02:00
2019-05-11 01:15:05 +02:00
# Archiv
2019-06-20 21:00:23 +02:00
path('archiv/cisla/', views.ArchivView.as_view()),
path('archiv/temata/', views.ArchivTemataView.as_view()),
2015-06-08 22:38:13 +02:00
2019-06-20 21:00:23 +02:00
path('rocnik/<int:rocnik>/', views.RocnikView.as_view(), name='seminar_rocnik'),
#path('cislo/<int:rocnik>.<int:cislo>/', views.CisloView.as_view(), name='seminar_cislo'),
path('problem/<int:pk>/', views.ProblemView.as_view(), name='seminar_problem'),
#path('problem/(?P<pk>\d+)/(?P<prispevek>\d+)/', views.PrispevekView.as_view(), name='seminar_problem_prispevek'),
2015-06-04 10:13:52 +02:00
2019-05-11 01:15:05 +02:00
# Soustredeni
2019-06-20 21:00:23 +02:00
path(
'soustredeni/probehlo/',
2019-05-11 01:15:05 +02:00
views.SoustredeniListView.as_view(),
name='seminar_seznam_soustredeni'
),
2019-06-20 21:00:23 +02:00
path(
'soustredeni/probehlo/<int:soustredeni>/',
2019-05-11 01:15:05 +02:00
views.SoustredeniView.as_view(),
name='seminar_soustredeni'
),
2019-06-20 21:00:23 +02:00
path(
'soustredeni/<int:soustredeni>/seznam_ucastniku',
2019-05-11 01:15:05 +02:00
staff_member_required(views.SoustredeniUcastniciView.as_view()),
name='soustredeni_ucastnici'
),
2019-06-20 21:00:23 +02:00
path(
'soustredeni/<int:soustredeni>/maily_ucastniku',
2019-05-11 01:15:05 +02:00
staff_member_required(views.SoustredeniMailyUcastnikuView.as_view()),
name='maily_ucastniku'
),
2019-06-20 21:00:23 +02:00
path(
'soustredeni/<int:soustredeni>/export_ucastniku',
2019-05-11 01:15:05 +02:00
staff_member_required(views.soustredeniUcastniciExportView),
name='soustredeni_ucastnici_export'
),
2019-06-20 21:00:23 +02:00
path(
'soustredeni/<int:soustredeni>/fotogalerie/',
2019-05-11 01:15:05 +02:00
include('galerie.urls')
),
2019-05-11 01:15:05 +02:00
# Zadani
2019-06-20 21:00:23 +02:00
path('zadani/aktualni/', views.AktualniZadaniView, name='seminar_aktualni_zadani'),
path('zadani/temata/', views.ZadaniTemataView, name='seminar_temata'),
#path('zadani/vysledkova-listina/', views.ZadaniAktualniVysledkovkaView, name='seminar_vysledky'),
path('stare-novinky/', views.StareNovinkyView.as_view(), name='stare_novinky'),
2015-05-06 17:07:32 +02:00
2019-05-11 01:15:05 +02:00
# Clanky
2019-06-20 21:00:23 +02:00
path('clanky/resitel/', views.ClankyResitelView.as_view(), name='clanky_resitel'),
#path('clanky/org/', views.ClankyOrganizatorView.as_view(), name='clanky_organizator'),
2015-09-13 15:31:34 +02:00
2019-05-11 01:15:05 +02:00
# Aesop
2019-06-20 21:00:23 +02:00
path('aesop-export/mam-rocnik-<int:prvni_rok>.csv', export.ExportRocnikView.as_view(), name='seminar_export_rocnik'),
path('aesop-export/mam-sous-<str:datum_zacatku>.csv', export.ExportSousView.as_view(), name='seminar_export_sous'),
path('aesop-export/index.csv', export.ExportIndexView.as_view(), name='seminar_export_index'),
2015-11-15 16:14:07 +01:00
2019-05-11 01:15:05 +02:00
# Stranky viditelne pouze pro orgy:
2019-06-20 21:00:23 +02:00
#path(
# 'rocnik/(?P<rocnik>\d+)/vysledkovka.tex',
2019-05-11 01:15:05 +02:00
# staff_member_required(views.RocnikVysledkovkaView.as_view()),
# name='seminar_cislo_vysledkovka'
#),
2019-06-20 21:00:23 +02:00
#path('cislo/(?P<rocnik>\d+).(?P<cislo>[0-9-]+)/vysledkovka.tex',
2019-05-11 01:15:05 +02:00
# staff_member_required(views.CisloVysledkovkaView.as_view()), name='seminar_cislo_vysledkovka'),
2019-06-20 21:00:23 +02:00
path('cislo/<int:rocnik>.<int:cislo>/obalky.pdf',
2019-05-11 01:15:05 +02:00
staff_member_required(views.cisloObalkyView), name='seminar_cislo_obalky'),
2019-06-20 21:00:23 +02:00
#path('cislo/(?P<rocnik>\d+).(?P<cislo>[0-9-]+)/tituly.tex',
2019-05-11 01:15:05 +02:00
# staff_member_required(views.TitulyView), name='seminar_cislo_titul'),
2019-06-20 21:00:23 +02:00
path('stav',
2019-05-11 01:15:05 +02:00
staff_member_required(views.StavDatabazeView), name='stav_databaze'),
2019-06-20 21:00:23 +02:00
path('cislo/<int:rocnik>.<int:cislo>/obalkovani',
2019-05-11 01:15:05 +02:00
staff_member_required(views.obalkovaniView), name='seminar_cislo_resitel_obalkovani'),
2019-06-20 21:00:23 +02:00
path('cislo/<int:rocnik>.<int:cislo>/tex-download.json',
2019-05-11 01:15:05 +02:00
staff_member_required(views.texDownloadView), name='seminar_tex_download'),
2019-06-20 21:00:23 +02:00
path('soustredeni/<int:soustredeni>/obalky.pdf',
2019-05-11 01:15:05 +02:00
staff_member_required(views.soustredeniObalkyView), name='seminar_soustredeni_obalky'),
2019-06-20 21:00:23 +02:00
path('tex-upload/login/', views.LoginView, name='seminar_login'),
path(
'tex-upload/',
2019-05-11 01:15:05 +02:00
staff_member_required(views.texUploadView),
name='seminar_tex_upload'
),
2019-06-20 21:00:23 +02:00
path('prihlaska/',views.get_name),
path('', views.TitulniStranaView.as_view(), name='titulni_strana'),
2019-05-11 01:15:05 +02:00
# Ceka na autocomplete v3
2019-06-20 21:00:23 +02:00
# path('autocomplete/organizatori/',
2019-05-11 01:15:05 +02:00
# staff_member_required(views.OrganizatorAutocomplete.as_view()),
# name='seminar_autocomplete_organizator')
2016-01-09 17:28:20 +01:00
]