|
|
@ -987,7 +987,7 @@ def StavDatabazeView(request): |
|
|
|
|
|
|
|
class ResitelView(LoginRequiredMixin,generic.DetailView): |
|
|
|
model = Resitel |
|
|
|
template_name = 'seminar/resitel.html' |
|
|
|
template_name = 'seminar/profil/resitel.html' |
|
|
|
|
|
|
|
def get_object(self, queryset=None): |
|
|
|
print(self.request.user) |
|
|
@ -1002,7 +1002,7 @@ class AddSolutionView(LoginRequiredMixin, FormView): |
|
|
|
|
|
|
|
class NahrajReseniView(LoginRequiredMixin, CreateView): |
|
|
|
model = s.Reseni |
|
|
|
template_name = 'seminar/nahraj_reseni.html' |
|
|
|
template_name = 'seminar/profil/nahraj_reseni.html' |
|
|
|
form_class = f.NahrajReseniForm |
|
|
|
success_url = '/' |
|
|
|
|
|
|
@ -1049,19 +1049,19 @@ def loginView(request): |
|
|
|
return HttpResponseRedirect('/') |
|
|
|
else: |
|
|
|
return render(request, |
|
|
|
'seminar/login.html', |
|
|
|
'seminar/profil/login.html', |
|
|
|
{'form': form, 'login_error': 'Neplatné jméno nebo heslo'}) |
|
|
|
|
|
|
|
else: |
|
|
|
form = LoginForm() |
|
|
|
return render(request, 'seminar/login.html', {'form': form}) |
|
|
|
return render(request, 'seminar/profil/login.html', {'form': form}) |
|
|
|
|
|
|
|
def logoutView(request): |
|
|
|
form = LoginForm() |
|
|
|
if request.user.is_authenticated: |
|
|
|
logout(request) |
|
|
|
return render(request, 'seminar/login.html', {'form': form, 'login_error': 'Byli jste úspěšně odhlášeni'}) |
|
|
|
return render(request, 'seminar/login.html', {'form': form}) |
|
|
|
return render(request, 'seminar/profil/login.html', {'form': form, 'login_error': 'Byli jste úspěšně odhlášeni'}) |
|
|
|
return render(request, 'seminar/profil/login.html', {'form': form}) |
|
|
|
|
|
|
|
|
|
|
|
def prihlaska_log_gdpr_safe(logger, gdpr_logger, msg, form_data): |
|
|
@ -1121,7 +1121,7 @@ def resitelEditView(request): |
|
|
|
return HttpResponseRedirect('/thanks/') |
|
|
|
else: |
|
|
|
## Stránka před odeslaním formuláře = předvyplněný formulář |
|
|
|
return render(request, 'seminar/edit.html', {'form': form}) |
|
|
|
return render(request, 'seminar/profil/edit.html', {'form': form}) |
|
|
|
|
|
|
|
def prihlaskaView(request): |
|
|
|
generic_logger = logging.getLogger('seminar.prihlaska') |
|
|
@ -1192,12 +1192,12 @@ def prihlaskaView(request): |
|
|
|
else: |
|
|
|
form = PrihlaskaForm() |
|
|
|
|
|
|
|
return render(request, 'seminar/prihlaska.html', {'form': form}) |
|
|
|
return render(request, 'seminar/profil/prihlaska.html', {'form': form}) |
|
|
|
|
|
|
|
# FIXME: Tohle asi vlastně vůbec nepatří do aplikace 'seminar' |
|
|
|
class LoginView(auth_views.LoginView): |
|
|
|
# Jen vezmeme vestavěný a dáme mu vhodný template a přesměrovací URL |
|
|
|
template_name = 'seminar/login.html' |
|
|
|
template_name = 'seminar/profil/login.html' |
|
|
|
|
|
|
|
# Přesměrovací URL má být v kontextu: |
|
|
|
def get_context_data(self, **kwargs): |
|
|
@ -1207,7 +1207,7 @@ class LoginView(auth_views.LoginView): |
|
|
|
|
|
|
|
class LogoutView(auth_views.LogoutView): |
|
|
|
# Jen vezmeme vestavěný a dáme mu vhodný template a přesměrovací URL |
|
|
|
template_name = 'seminar/logout.html' |
|
|
|
template_name = 'seminar/profil/logout.html' |
|
|
|
# Pavel: Vůbec nevím, proč to s _lazy funguje, ale bez toho to bylo rozbité. |
|
|
|
next_page = reverse_lazy('titulni_strana') |
|
|
|
|
|
|
|