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

176 lines
7.5 KiB

from django.urls import path, include, re_path
4 years ago
from django.contrib.auth.decorators import login_required
from . import views, export
from .utils import org_required, resitel_required, viewMethodSwitch
from django.views.generic.base import RedirectView
urlpatterns = [
# path('aktualni/temata/', views.TemataRozcestnikView),
# path('<int:rocnik>/t<int:tematko>/', views.TematkoView),
# 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/rocniky/', views.ArchivView.as_view(), name="seminar_archiv_rocniky"),
path('archiv/temata/', views.ArchivTemataView.as_view(), name="seminar_archiv_temata"),
path('rocnik/<int:rocnik>/', views.RocnikView.as_view(), name='seminar_rocnik'),
path('cislo/<int:rocnik>.<str:cislo>/', views.CisloView.as_view(), name='seminar_cislo'),
path('problem/<int:pk>/', views.ProblemView.as_view(), name='seminar_problem'),
path('treenode/<int:pk>/', views.TreeNodeView.as_view(), name='seminar_treenode'),
path('treenode/<int:pk>/json/', views.TreeNodeJSONView.as_view(), name='seminar_treenode_json'),
path('treenode/text/<int:pk>/', views.TextWebView.as_view(), name='seminar_textnode_web'),
path('treenode/editor/pridat/<str:co>/<int:pk>/<str:kam>/', views.TreeNodePridatView.as_view(), name='treenode_pridat'),
path('treenode/editor/smazat/<int:pk>/', views.TreeNodeSmazatView.as_view(), name='treenode_smazat'),
path('treenode/editor/odvesitpryc/<int:pk>/', views.TreeNodeOdvesitPrycView.as_view(), name='treenode_odvesitpryc'),
path('treenode/editor/podvesit/<int:pk>/<str:kam>/', views.TreeNodePodvesitView.as_view(), name='treenode_podvesit'),
path('treenode/editor/prohodit/<int:pk>/', views.TreeNodeProhoditView.as_view(), name='treenode_prohodit'),
path('treenode/sirotcinec/', views.SirotcinecView.as_view(), name='seminar_treenode_sirotcinec'),
#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/<int:soustredeni>/seznam_ucastniku',
4 years ago
org_required(views.SoustredeniUcastniciView.as_view()),
name='soustredeni_ucastnici'
),
path(
'soustredeni/<int:soustredeni>/maily_ucastniku',
4 years ago
org_required(views.SoustredeniMailyUcastnikuView.as_view()),
name='maily_ucastniku'
),
path(
'soustredeni/<int:soustredeni>/export_ucastniku',
4 years ago
org_required(views.soustredeniUcastniciExportView),
name='soustredeni_ucastnici_export'
),
path(
'soustredeni/<int:soustredeni>/fotogalerie/',
include('galerie.urls')
),
# Zadani
path('zadani/aktualni/', views.AktualniZadaniView.as_view(), 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('archiv/clanky/', views.ClankyResitelView.as_view(), name='clanky_resitel'),
#path('clanky/org/', views.ClankyOrganizatorView.as_view(), name='clanky_organizator'),
# Aesop
4 years ago
path(
'aesop-export/mam-rocnik-<int:prvni_rok>.csv',
org_required(export.ExportRocnikView.as_view()),
name='seminar_export_rocnik'
),
path(
'aesop-export/mam-sous-<str:datum_zacatku>.csv',
org_required(export.ExportSousView.as_view()),
name='seminar_export_sous'
),
path(
'aesop-export/index.csv',
org_required(export.ExportIndexView.as_view()),
name='seminar_export_index'
),
9 years ago
# Stranky viditelne pouze pro orgy:
path(
4 years ago
'rocnik/<int:rocnik>/vysledkovka.tex',
org_required(views.RocnikVysledkovkaView.as_view()),
name='seminar_rocnik_vysledkovka'
),
4 years ago
path(
'cislo/<int:rocnik>.<str:cislo>/vysledkovka.tex',
4 years ago
org_required(views.CisloVysledkovkaView.as_view()),
name='seminar_cislo_vysledkovka'
),
path(
'cislo/<int:rocnik>.<str:cislo>/obalky.pdf',
4 years ago
org_required(views.cisloObalkyView),
name='seminar_cislo_obalky'
),
path(
'cislo/<int:rocnik>.<str:cislo>/tituly.tex',
4 years ago
org_required(views.TitulyView),
name='seminar_cislo_titul'
),
path(
'stav',
org_required(views.StavDatabazeView),
name='stav_databaze'
),
path(
'cislo/<int:rocnik>.<str:cislo>/obalkovani',
4 years ago
org_required(views.ObalkovaniView.as_view()),
name='seminar_cislo_resitel_obalkovani'
),
path(
'cislo/<int:trocnik>.<str:tcislo>/odmeny/<int:frocnik>.<str:fcislo>/',
org_required(views.OdmenyView.as_view()),
name="seminar_archiv_odmeny"),
4 years ago
path(
'soustredeni/<int:soustredeni>/obalky.pdf',
org_required(views.soustredeniObalkyView),
name='seminar_soustredeni_obalky'
),
# příprava na nestatický orgorozcestník
4 years ago
path(
'org/rozcestnik/',
org_required(views.OrgoRozcestnikView.as_view()),
name='seminar_org_rozcestnik'
),
path('prihlaska/',views.prihlaskaView, name='seminar_prihlaska'),
path('login/', views.LoginView.as_view(), name='login'),
path('logout/', views.LogoutView.as_view(), name='logout'),
4 years ago
path('resitel/', resitel_required(views.ResitelView.as_view()), name='seminar_resitel'),
path('reset_password/', views.PasswordResetView.as_view(), name='reset_password'),
path('change_password/', views.PasswordChangeView.as_view(), name='change_password'),
path('reset_password_done/', views.PasswordResetDoneView.as_view(), name='reset_password_done'),
path('reset_password_confirm/<uidb64>/<token>/', views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
path('reset_password_complete/', views.PasswordResetCompleteView.as_view(), name='reset_password_complete'),
4 years ago
path(
'resitel_edit',
login_required(views.resitelEditView, login_url='/login/'),
name='seminar_resitel_edit'
),
# Obecný view na profil -- orgům dá rozcestník, řešitelům jejich stránku
path('profil/', views.profilView, name='profil'),
# Autocomplete
path('autocomplete/skola/',views.SkolaAutocomplete.as_view(), name='autocomplete_skola'),
4 years ago
path('autocomplete/resitel/', org_required(views.ResitelAutocomplete.as_view()), name='autocomplete_resitel'),
path('autocomplete/problem/odevzdatelny',views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'),
4 years ago
path('temp/add_solution', org_required(views.AddSolutionView.as_view()), name='seminar_vloz_reseni'),
path('temp/nahraj_reseni', resitel_required(views.NahrajReseniView.as_view()), name='seminar_nahraj_reseni'),
re_path(r'^temp/vue/.*$',views.VueTestView.as_view(),name='vue_test_view'),
path('temp/image_upload/', views.NahrajObrazekKTreeNoduView.as_view()),
path('', views.TitulniStranaView.as_view(), name='titulni_strana'),
path('jak-resit/', views.JakResitView.as_view(), name='jak-resit'),
# Ceka na autocomplete v3
# path('autocomplete/organizatori/',
4 years ago
# org_member_required(views.OrganizatorAutocomplete.as_view()),
# name='seminar_autocomplete_organizator')
path('temp/reseni/', org_required(views.TabulkaOdevzdanychReseniView.as_view()), name='odevzdavatko_tabulka'),
path('temp/reseni/<int:problem>/<int:resitel>/', org_required(views.ReseniProblemuView.as_view()), name='odevzdavatko_reseni_resitele_k_problemu'),
path('temp/reseni/<int:pk>', org_required(viewMethodSwitch(get=views.DetailReseniView.as_view(), post=views.HodnoceniReseniView.as_view())), name='odevzdavatko_detail_reseni'),
path('temp/reseni/all', org_required(views.SeznamReseniView.as_view())),
path('temp/reseni/akt', org_required(views.SeznamAktualnichReseniView.as_view())),
]