diff --git a/odevzdavatko/views.py b/odevzdavatko/views.py index 8b454e6c..2dd8e6c2 100644 --- a/odevzdavatko/views.py +++ b/odevzdavatko/views.py @@ -23,7 +23,7 @@ from personalni.models import Resitel, Organizator, Osoba from . import forms as f from .forms import OdevzdavatkoTabulkaFiltrForm as FiltrForm from personalni.utils import resi_v_rocniku -from seminar.views import formularOKView +from various.views import formularOKView logger = logging.getLogger(__name__) diff --git a/personalni/views.py b/personalni/views.py index e71dbf5c..9fad44a9 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -20,7 +20,7 @@ from datetime import date import logging import csv -from seminar.views import formularOKView +from various.views import formularOKView from various.autentizace.views import LoginView from various.autentizace.utils import posli_reset_hesla diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 94d9af08..17f83fb8 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -1,5 +1,4 @@ from django.shortcuts import get_object_or_404, render -from django.urls import reverse from django.core.exceptions import ObjectDoesNotExist from django.views import generic from django.views.generic.base import RedirectView @@ -11,7 +10,6 @@ from personalni.models import Organizator from vysledkovky.utils import VysledkovkaRocniku from django.utils import timezone -from collections.abc import Sequence # ze starého modelu @@ -39,7 +37,7 @@ from collections.abc import Sequence # nastaveni = get_object_or_404(Nastaveni) # context = super().get_context_data(**kwargs) # verejne = nastaveni.aktualni_cislo.verejne() -# context['verejne'] = verejne +# context['verejne'] = verejne # return context def AktualniZadaniView(request): @@ -224,21 +222,6 @@ class CojemamOrganizatoriStariView(generic.ListView): id__in=aktivniOrganizatori()).order_by('-organizuje_do') - -# Interní, nemá se nikdy objevit v urls (jinak to účastníci vytrolí) -def formularOKView(request, text='', dalsi_odkazy: Sequence[tuple[str, str]] = ()): - template_name = 'seminar/formular_ok.html' - odkazy = list(dalsi_odkazy) + [ - # (Text, odkaz) - ('Vrátit se na titulní stránku', reverse('titulni_strana')), - ('Zobrazit aktuální zadání', reverse('seminar_aktualni_zadani')), - ] - context = { - 'odkazy': odkazy, - 'text': text, - } - return render(request, template_name, context) - #------------------ Jak řešit - možná má být udělané úplně jinak class JakResitView(generic.ListView): diff --git a/seminar/templates/seminar/formular_ok.html b/various/templates/various/formular_ok.html similarity index 100% rename from seminar/templates/seminar/formular_ok.html rename to various/templates/various/formular_ok.html diff --git a/seminar/templates/seminar/pracuje_se.html b/various/templates/various/pracuje_se.html similarity index 85% rename from seminar/templates/seminar/pracuje_se.html rename to various/templates/various/pracuje_se.html index 1a396534..e80fea23 100644 --- a/seminar/templates/seminar/pracuje_se.html +++ b/various/templates/various/pracuje_se.html @@ -10,7 +10,7 @@
Na této stránce velmi intenzivně pracujeme. Za dočasnou nedostupnost se omlouváme. - Zkuste přejít na titulní stránku + Zkuste přejít na titulní stránku nebo se podívat na aktuální zadání.
diff --git a/various/views.py b/various/views.py index 782e2e66..b9fe0f96 100644 --- a/various/views.py +++ b/various/views.py @@ -1,9 +1,27 @@ +from collections.abc import Sequence + from django.shortcuts import render +from django.urls import reverse from various import utils from personalni.models import Resitel +# Interní, nemá se nikdy objevit v urls (jinak to účastníci vytrolí) +def formularOKView(request, text='', dalsi_odkazy: Sequence[tuple[str, str]] = ()): + template_name = 'seminar/formular_ok.html' + odkazy = list(dalsi_odkazy) + [ + # (Text, odkaz) + ('Vrátit se na titulní stránku', reverse('titulni_strana')), + ('Zobrazit aktuální zadání', reverse('seminar_aktualni_zadani')), + ] + context = { + 'odkazy': odkazy, + 'text': text, + } + return render(request, template_name, context) + + def StavDatabazeView(request): # nastaveni = Nastaveni.objects.get() problemy = utils.seznam_problemu() diff --git a/vyroci/views.py b/vyroci/views.py index 50070a26..c565a0d6 100644 --- a/vyroci/views.py +++ b/vyroci/views.py @@ -1,7 +1,7 @@ from django.views.generic import FormView, ListView from personalni.models import Osoba -from seminar.views import formularOKView +from various.views import formularOKView from .forms import UcastnikVyrociForm from .models import UcastnikVyroci