|
|
|
from django.urls import path, include
|
|
|
|
from django.contrib.auth.decorators import user_passes_test
|
|
|
|
from . import views, export
|
|
|
|
from .utils import staff_member_required
|
|
|
|
from django.views.generic.base import RedirectView
|
|
|
|
from django.contrib.auth import views as auth_views
|
|
|
|
|
|
|
|
staff_member_required = user_passes_test(lambda u: u.is_staff)
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
# REDIRECTy
|
|
|
|
path('jak-resit/', RedirectView.as_view(url='/co-je-MaM/jak-resit/')),
|
|
|
|
|
|
|
|
# Organizatori
|
|
|
|
path('co-je-MaM/organizatori/', views.CojemamOrganizatoriView.as_view(), name='organizatori'),
|
|
|
|
path('co-je-MaM/organizatori/organizovali/', views.CojemamOrganizatoriStariView.as_view(), name='stari_organizatori'),
|
|
|
|
|
|
|
|
# Archiv
|
|
|
|
path('archiv/cisla/', views.ArchivView.as_view()),
|
|
|
|
path('archiv/temata/', views.ArchivTemataView.as_view()),
|
|
|
|
|
|
|
|
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'),
|
|
|
|
|
|
|
|
# Soustredeni
|
|
|
|
path(
|
|
|
|
'soustredeni/probehlo/',
|
|
|
|
views.SoustredeniListView.as_view(),
|
|
|
|
name='seminar_seznam_soustredeni'
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
'soustredeni/probehlo/<int:soustredeni>/',
|
|
|
|
views.SoustredeniView.as_view(),
|
|
|
|
name='seminar_soustredeni'
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
'soustredeni/<int:soustredeni>/seznam_ucastniku',
|
|
|
|
staff_member_required(views.SoustredeniUcastniciView.as_view()),
|
|
|
|
name='soustredeni_ucastnici'
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
'soustredeni/<int:soustredeni>/maily_ucastniku',
|
|
|
|
staff_member_required(views.SoustredeniMailyUcastnikuView.as_view()),
|
|
|
|
name='maily_ucastniku'
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
'soustredeni/<int:soustredeni>/export_ucastniku',
|
|
|
|
staff_member_required(views.soustredeniUcastniciExportView),
|
|
|
|
name='soustredeni_ucastnici_export'
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
'soustredeni/<int:soustredeni>/fotogalerie/',
|
|
|
|
include('galerie.urls')
|
|
|
|
),
|
|
|
|
|
|
|
|
# Zadani
|
|
|
|
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'),
|
|
|
|
|
|
|
|
# Clanky
|
|
|
|
path('clanky/resitel/', views.ClankyResitelView.as_view(), name='clanky_resitel'),
|
|
|
|
#path('clanky/org/', views.ClankyOrganizatorView.as_view(), name='clanky_organizator'),
|
|
|
|
|
|
|
|
# Aesop
|
|
|
|
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'),
|
|
|
|
|
|
|
|
# Stranky viditelne pouze pro orgy:
|
|
|
|
#path(
|
|
|
|
# 'rocnik/(?P<rocnik>\d+)/vysledkovka.tex',
|
|
|
|
# staff_member_required(views.RocnikVysledkovkaView.as_view()),
|
|
|
|
# name='seminar_cislo_vysledkovka'
|
|
|
|
#),
|
|
|
|
#path('cislo/(?P<rocnik>\d+).(?P<cislo>[0-9-]+)/vysledkovka.tex',
|
|
|
|
# staff_member_required(views.CisloVysledkovkaView.as_view()), name='seminar_cislo_vysledkovka'),
|
|
|
|
path('cislo/<int:rocnik>.<int:cislo>/obalky.pdf',
|
|
|
|
staff_member_required(views.cisloObalkyView), name='seminar_cislo_obalky'),
|
|
|
|
|
|
|
|
#path('cislo/(?P<rocnik>\d+).(?P<cislo>[0-9-]+)/tituly.tex',
|
|
|
|
# staff_member_required(views.TitulyView), name='seminar_cislo_titul'),
|
|
|
|
path('stav',
|
|
|
|
staff_member_required(views.StavDatabazeView), name='stav_databaze'),
|
|
|
|
path('cislo/<int:rocnik>.<int:cislo>/obalkovani',
|
|
|
|
staff_member_required(views.obalkovaniView), name='seminar_cislo_resitel_obalkovani'),
|
|
|
|
path('cislo/<int:rocnik>.<int:cislo>/tex-download.json',
|
|
|
|
staff_member_required(views.texDownloadView), name='seminar_tex_download'),
|
|
|
|
path('soustredeni/<int:soustredeni>/obalky.pdf',
|
|
|
|
staff_member_required(views.soustredeniObalkyView), name='seminar_soustredeni_obalky'),
|
|
|
|
|
|
|
|
path('tex-upload/login/', views.TeXUploadLoginView, name='seminar_login'),
|
|
|
|
path(
|
|
|
|
'tex-upload/',
|
|
|
|
staff_member_required(views.texUploadView),
|
|
|
|
name='seminar_tex_upload'
|
|
|
|
),
|
|
|
|
path('auth/prihlaska/',views.prihlaskaView, name='seminar_prihlaska'),
|
|
|
|
path('auth/login/', views.loginView, name='login'),
|
|
|
|
path('auth/logout/', views.logoutView, name='logout'),
|
|
|
|
path('auth/resitel/', views.ResitelView.as_view(), name='seminar_resitel'),
|
|
|
|
path('autocomplete/skola/',views.SkolaAutocomplete.as_view(), name='autocomplete_skola'),
|
|
|
|
path('auth/reset_password', views.resetPasswordView, name='reset_password'),
|
|
|
|
path('auth/resitel_edit', views.resitelEditView, name='seminar_resitel_edit'),
|
|
|
|
path('', views.TitulniStranaView.as_view(), name='titulni_strana'),
|
|
|
|
|
|
|
|
# Ceka na autocomplete v3
|
|
|
|
# path('autocomplete/organizatori/',
|
|
|
|
# staff_member_required(views.OrganizatorAutocomplete.as_view()),
|
|
|
|
# name='seminar_autocomplete_organizator')
|
|
|
|
|
|
|
|
|
|
|
|
]
|