diff --git a/src/feedback/models/base.py b/src/feedback/models/base.py index 1426343..02c3095 100644 --- a/src/feedback/models/base.py +++ b/src/feedback/models/base.py @@ -658,7 +658,7 @@ def save(self, *args, **kwargs): def link_veranstalter(self): # @see http://stackoverflow.com/a/17948593 """Gibt die URL für die Bestellunng durch den Veranstalter zurück""" - link_veranstalter = 'https://www.fachschaft.informatik.tu-darmstadt.de%s' % reverse('veranstalter-login') + link_veranstalter = 'https://www.fachschaft.informatik.tu-darmstadt.de%s' % reverse('feedback:veranstalter-login') link_suffix_format = '?vid=%d&token=%s' if self.pk is not None and self.access_token is not None: return link_veranstalter + (link_suffix_format % (self.pk, self.access_token)) diff --git a/src/feedback/templatetags/translate_url.py b/src/feedback/templatetags/translate_url.py index 623256c..ee461d4 100644 --- a/src/feedback/templatetags/translate_url.py +++ b/src/feedback/templatetags/translate_url.py @@ -15,7 +15,12 @@ def translate_url(context, language): view = resolve(context['request'].path) request_language = translation.get_language() translation.activate(language) - url = reverse(view.url_name, args=view.args, kwargs=view.kwargs) + + namespace = view.namespace + view_name = f"{namespace}:{view.url_name}" if namespace else view.url_name + + url = reverse(view_name, args=view.args, kwargs=view.kwargs) + translation.activate(request_language) return url return "" \ No newline at end of file diff --git a/src/feedback/tests/__init__.py b/src/feedback/tests/__init__.py index a333674..355c554 100644 --- a/src/feedback/tests/__init__.py +++ b/src/feedback/tests/__init__.py @@ -27,6 +27,8 @@ def suite(): LOGIN_END = f'/{get_language()}/intern/' INDEX_END = f'/{get_language()}/intern/uebersicht/' +AUTH_END = f'/{get_language()}/intern/auth_user/' TESTSERVER_BEGIN = '' LOGIN_URL = TESTSERVER_BEGIN+LOGIN_END INDEX_URL = TESTSERVER_BEGIN+INDEX_END +AUTH_URL = TESTSERVER_BEGIN+AUTH_END diff --git a/src/feedback/tests/test_views_intern.py b/src/feedback/tests/test_views_intern.py index 200156b..219cfc4 100644 --- a/src/feedback/tests/test_views_intern.py +++ b/src/feedback/tests/test_views_intern.py @@ -621,7 +621,7 @@ def test_post(self): # ----- Vorschau: Check if the replacements are highlighted ----- # color_span = '{}' self.assertEqual(color_span.format('Grundlagen der Agrarphilosophie I'), response.context['veranstaltung']) - link_veranstalter = 'https://www.fachschaft.informatik.tu-darmstadt.de%s' % reverse('veranstalter-login') + link_veranstalter = 'https://www.fachschaft.informatik.tu-darmstadt.de%s' % reverse('feedback:veranstalter-login') link_suffix_format = '?vid=%d&token=%s' self.assertEqual(color_span.format(link_veranstalter + (link_suffix_format % (1337, '0123456789abcdef'))), response.context['link_veranstalter']) diff --git a/src/feedback/tests/test_views_intern_auth.py b/src/feedback/tests/test_views_intern_auth.py index d923487..2ff589e 100644 --- a/src/feedback/tests/test_views_intern_auth.py +++ b/src/feedback/tests/test_views_intern_auth.py @@ -9,12 +9,16 @@ from feedback import tests from feedback.models import Veranstaltung from django.utils.translation import get_language - +from django.contrib.auth.models import User +from django.urls import reverse class InternAuthTest(NonSuTestMixin, TestCase): def setUp(self): super(InternAuthTest, self).setUp() _, self.v = get_veranstaltung('vu') + self.username = 'supers1' + self.password = 'pw1' + self.user = User.objects.create_user(username=self.username, password=self.password) def test_login_logged_in(self): self.client.login(username='supers', password='pw') @@ -33,6 +37,35 @@ def test_login_debug_auth(self): self.assertEqual(response.status_code, 302) self.assertEqual(response['Location'], tests.INDEX_URL) + def test_auth_user(self) : + response = self.client.get(tests.AUTH_URL) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'registration/login.html') + + def test_auth_user_post_valid(self) : + response = self.client.post(tests.AUTH_URL, {'username':self.username, 'password':self.password}) + self.assertRedirects(response, tests.LOGIN_URL, target_status_code=302) + + login_required_url = reverse('feedback:intern-index') + + response = self.client.get(login_required_url) + self.assertEqual(response.status_code, 302) + + self.assertTrue(response['Location'].split('?')[0].endswith(tests.LOGIN_URL)) + self.assertTrue(response['Location'].split('?')[1].endswith(login_required_url)) + + def test_auth_post_invalid_credentials(self) : + response = self.client.post(tests.AUTH_URL,{'username': self.username,'password': 'wrongpassword'}) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'registration/login.html') + self.assertContains(response, "Invalid Password or Username") + + def test_auth_user_post_missing_data(self): + response = self.client.post(tests.AUTH_URL, {}) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'registration/login.html') + self.assertContains(response, "Invalid Password or Username") + def test_rechte_uebernehmen(self): path = f'/{get_language()}/intern/rechte_uebernehmen/' self.do_non_su_test(path) diff --git a/src/feedback/urls.py b/src/feedback/urls.py index 2be500d..ef137f7 100644 --- a/src/feedback/urls.py +++ b/src/feedback/urls.py @@ -1,7 +1,6 @@ # coding=utf-8 from django.conf.urls import include -from django.contrib.staticfiles.urls import staticfiles_urlpatterns import feedback.views.public import feedback.views.veranstalter @@ -14,16 +13,13 @@ from django.urls import reverse_lazy, re_path from django.conf import settings from feedback.views.veranstalter import VeranstalterWizard +from django.utils.translation import get_language - -if not settings.DEBUG: - default_redirect = '/feedback-new/' -else: - default_redirect = '/veranstalter/' +default_redirect = f'/{get_language()}/veranstalter/' # allgemeine Views urlpatterns = [ - re_path(r'^$', feedback.views.redirect, {'redirect_to': default_redirect}), + re_path(r'^$', feedback.views.redirect, {'redirect_to': default_redirect}, name="default"), ] # öffentliche Views @@ -80,15 +76,15 @@ urlpatterns += [ re_path(r'^intern/rechte_uebernehmen/$', feedback.views.intern.auth.rechte_uebernehmen, name='rechte-uebernehmen'), re_path(r'^intern/rechte_zuruecknehmen/$', feedback.views.intern.auth.rechte_zuruecknehmen, name='rechte_zuruecknehmen'), + re_path(r'^intern/auth_user/$', feedback.views.intern.auth.auth_user, name='auth-user'), re_path(r'^intern/$', feedback.views.intern.auth.login, name='auth-login'), ] # Logout urlpatterns += [ - re_path(r'^logout/$', django.contrib.auth.views.LogoutView.as_view(), {'next_page': reverse_lazy('public-results')}, name='logout'), + re_path(r'^logout/$', django.contrib.auth.views.LogoutView.as_view(), {'next_page': reverse_lazy('feedback:public-results')}, name='logout'), ] -urlpatterns += staticfiles_urlpatterns() if settings.DEBUG: # Ausschließlich in der Entwicklung nötig, damit statische Dateien (JS, CSS, Bilder...) diff --git a/src/feedback/views/intern/__init__.py b/src/feedback/views/intern/__init__.py index beaf1ab..23323fd 100644 --- a/src/feedback/views/intern/__init__.py +++ b/src/feedback/views/intern/__init__.py @@ -92,7 +92,7 @@ def export_veranstaltungen(request): try: semester = Semester.objects.get(semester=request.POST['semester']) except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('export_veranstaltungen')) + return HttpResponseRedirect(reverse('feedback:export_veranstaltungen')) ubung_export = False if request.POST.get("xml_ubung", None) is not None: @@ -112,19 +112,19 @@ def export_veranstaltungen(request): 'für Vorlesungen mit Übung vor!' % semester) else: messages.error(request, 'Für das ausgewählte Semester (%s) liegen keine Bestellungen vor!' % semester) - return HttpResponseRedirect(reverse('export_veranstaltungen')) + return HttpResponseRedirect(reverse('feedback:export_veranstaltungen')) missing_verantwortlich = veranst.filter(verantwortlich=None) if missing_verantwortlich.count() > 0: txt = ', '.join([v.name for v in missing_verantwortlich]) messages.error(request, 'Für die folgenden Veranstaltungen ist kein Verantwortlicher eingetragen: %s' % txt) - return HttpResponseRedirect(reverse('export_veranstaltungen')) + return HttpResponseRedirect(reverse('feedback:export_veranstaltungen')) missing_sprache = veranst.filter(sprache=None) if missing_sprache.count() > 0: txt = ', '.join([v.name for v in missing_sprache]) messages.error(request, 'Für die folgenden Veranstaltungen ist keine Sprache eingetragen: %s' % txt) - return HttpResponseRedirect(reverse('export_veranstaltungen')) + return HttpResponseRedirect(reverse('feedback:export_veranstaltungen')) person_set = set() @@ -190,12 +190,12 @@ def generate_letters(request): try: semester = Semester.objects.get(semester=request.POST['semester']) except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('generate_letters')) + return HttpResponseRedirect(reverse('feedback:generate_letters')) try: vorlage = request.POST['vorlage'] except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('generate_letters')) + return HttpResponseRedirect(reverse('feedback:generate_letters')) if vorlage == 'Anschreiben': latexpath = settings.LATEX_PATH @@ -209,7 +209,7 @@ def generate_letters(request): try: abgabedatum = request.POST['erhebungswoche'].replace('\\', '') except KeyError: - return HttpResponseRedirect(reverse('generate_letters')) + return HttpResponseRedirect(reverse('feedback:generate_letters')) with open(datefilename, 'w') as f: f.write(abgabedatum) @@ -228,14 +228,14 @@ def generate_letters(request): if not veranst.count(): messages.error(request, 'Für das ausgewählte Semester (%s) liegen ' 'keine Bestellungen vor oder die Mindesteilnehmeranzahl ist zu hoch!' % semester) - return HttpResponseRedirect(reverse('generate_letters')) + return HttpResponseRedirect(reverse('feedback:generate_letters')) lines = [] for v in veranst: if not v.verantwortlich.printable(): messages.error(request, mark_safe(f"Der Veranstalter {v.verantwortlich.full_name} ist nicht druckbar, da das Personenprofil nicht vollständig ist. Du kannst das unter hier beheben.")) - return HttpResponseRedirect(reverse('generate_letters')) + return HttpResponseRedirect(reverse('feedback:generate_letters')) eva_id = v.get_barcode_number() empfaenger = str(v.verantwortlich.full_name()) line = '\\adrentry{%s}{%s}{%s}{%s}{%s}{%s}{%s}{%s}{%s}\n' % ( @@ -300,7 +300,7 @@ def get_demo_context(request): :return: RequestContext, String, String """ color_span = '{}' - link_veranstalter = 'https://www.fachschaft.informatik.tu-darmstadt.de%s' % reverse('veranstalter-login') + link_veranstalter = 'https://www.fachschaft.informatik.tu-darmstadt.de%s' % reverse('feedback:veranstalter-login') link_suffix_format = '?vid=%d&token=%s' demo_context = RequestContext(request, { 'veranstaltung': color_span.format('Grundlagen der Agrarphilosophie I'), @@ -367,7 +367,7 @@ def sendmail(request): return render(request, 'intern/sendmail.html', data) except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('sendmail')) + return HttpResponseRedirect(reverse('feedback:sendmail')) data['semester_selected'] = semester data['subject_rendered'] = "Evaluation: %s" % data['subject'] @@ -379,7 +379,7 @@ def sendmail(request): data['body'] = vorlage.body except (Mailvorlage.DoesNotExist, KeyError, ValueError): - return HttpResponseRedirect(reverse('sendmail')) + return HttpResponseRedirect(reverse('feedback:sendmail')) return render(request, 'intern/sendmail.html', data) veranstaltungen = get_relevant_veranstaltungen(data['recipient'], semester) @@ -445,7 +445,7 @@ def sendmail(request): '%d Veranstaltungen wurden erfolgreich, samt Tutoren, benachrichtigt.' % (len(mails) - 1)) else: messages.success(request, '%d Veranstaltungen wurden erfolgreich benachrichtigt.' % (len(mails) - 1)) - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) return render(request, 'intern/sendmail.html', data) @@ -459,7 +459,7 @@ def import_ergebnisse(request): try: semester = Semester.objects.get(semester=request.POST['semester']) except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('import_ergebnisse')) + return HttpResponseRedirect(reverse('feedback:import_ergebnisse')) form = UploadFileForm(request.POST, request.FILES) if form.is_valid(): @@ -480,7 +480,7 @@ def import_ergebnisse(request): messages.warning(request, w) for e in errors: messages.error(request, e) - return HttpResponseRedirect(reverse('sync_ergebnisse')) + return HttpResponseRedirect(reverse('feedback:sync_ergebnisse')) else: messages.error(request, 'Fehler beim Upload') else: @@ -500,7 +500,7 @@ def sync_ergebnisse(request): try: semester = Semester.objects.get(semester=request.POST['semester']) except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('sync_ergebnisse')) + return HttpResponseRedirect(reverse('feedback:sync_ergebnisse')) fragebogen = get_model('Fragebogen', semester) ergebnis = get_model('Ergebnis', semester) @@ -542,7 +542,7 @@ def sync_ergebnisse(request): messages.warning(request, 'Für das %s liegen keine Ergebnisse vor.' % semester) else: messages.success(request, 'Das Ranking für das %s wurde erfolgreich berechnet.' % semester) - return HttpResponseRedirect(reverse('sync_ergebnisse')) + return HttpResponseRedirect(reverse('feedback:sync_ergebnisse')) @user_passes_test(lambda u: u.is_superuser) @@ -586,7 +586,7 @@ def form_valid(self, form): return super(CloseOrderFormView, self).form_valid(form) def form_invalid(self, form): - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) def get_queryset(self): try: @@ -594,10 +594,10 @@ def get_queryset(self): return veranstaltungen except (Veranstaltung.DoesNotExist, KeyError): messages.warning(self.request, 'Keine passenden Veranstaltungen für das aktuelle Semester gefunden.') - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) def get_success_url(self): - return reverse('intern-index') + return reverse('feedback:intern-index') def test_func(self): return self.request.user.is_superuser @@ -662,7 +662,7 @@ def done(self, form_list, **kwargs): self.request, '{} Veranstaltungen wurden erfolgreich benachrichtigt.'.format( len(mails))) - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) def get_template_names(self): return [self.template_name] if self.steps.step0 != 3 else [ diff --git a/src/feedback/views/intern/auth.py b/src/feedback/views/intern/auth.py index a3b9fa0..0b629a2 100644 --- a/src/feedback/views/intern/auth.py +++ b/src/feedback/views/intern/auth.py @@ -30,7 +30,7 @@ def rechte_uebernehmen(request): request.session['vid'] = v request.session['veranstaltung'] = str(veranst) - return HttpResponseRedirect(reverse('veranstalter-index')) + return HttpResponseRedirect(reverse('feedback:veranstalter-index')) except KeyError: pass @@ -48,12 +48,31 @@ def rechte_zuruecknehmen(request): u = User.objects.get(id=uid) user = auth.authenticate(reset=True, user=u) auth.login(request, user, backend='feedback.auth.TakeoverBackend') - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) # Redirect to intern.index view to get a clear session except KeyError: - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) +def auth_user(request) : + if request.method == "POST" : + username = request.POST.get("username") + password = request.POST.get("password") + + user = auth.authenticate(username=username, password=password) + + if user is None : + messages.error(request, "Invalid Password or Username") + return render(request, 'registration/login.html') + else : + auth.login(request, user) + return HttpResponseRedirect(reverse('feedback:auth-login')) + + elif request.method == "GET" and not request.user.is_authenticated : + return render(request, 'registration/login.html') + + return HttpResponseRedirect(reverse('feedback:auth-login')) + @require_safe def login(request): if settings.DEBUG and not request.user.is_superuser: @@ -63,6 +82,9 @@ def login(request): response['WWW-Authenticate'] = 'Basic realm="Feedback"' return response + if not settings.DEBUG and not request.user.is_authenticated : + return HttpResponseRedirect(reverse('feedback:auth-user')) + # Apache fordert User zum Login mit FS-Account auf, von daher muss hier nur noch weitergeleitet # werden. - return HttpResponseRedirect(reverse('intern-index')) + return HttpResponseRedirect(reverse('feedback:intern-index')) diff --git a/src/feedback/views/intern/vv.py b/src/feedback/views/intern/vv.py index 26c4ce0..36fffd2 100644 --- a/src/feedback/views/intern/vv.py +++ b/src/feedback/views/intern/vv.py @@ -33,7 +33,7 @@ def import_vv(request): if form.is_valid(): # TODO: Fehlerbehandlung vv_parser.parse_vv_xml(request.FILES['file']) - return HttpResponseRedirect(reverse('import_vv_edit')) + return HttpResponseRedirect(reverse('feedback:import_vv_edit')) else: messages.error(request, 'Fehler beim Upload') else: @@ -68,14 +68,14 @@ def import_vv_edit(request): messages.error(request, 'Bevor zu importierende Veranstaltungen ausgewählt werden ' + 'können, muss zunächst eine VV-XML-Datei hochgeladen werden.') - return HttpResponseRedirect(reverse('import_vv')) + return HttpResponseRedirect(reverse('feedback:import_vv')) else: # gewählte Veranstaltungen übernehmen und Personen zuordnen # Liste der ausgewählten Veranstaltungen holen v_str = [ele[1] for ele in request.POST.lists() if ele[0] == 'v'] if not len(v_str): messages.warning(request, 'Es wurden keine Veranstaltungen für den Import ausgewählt!') - return HttpResponseRedirect(reverse('import_vv_edit')) + return HttpResponseRedirect(reverse('feedback:import_vv_edit')) # IDs von unicode nach int konvertieren v_ids = [int(ele) for ele in v_str[0]] @@ -84,7 +84,7 @@ def import_vv_edit(request): try: semester = Semester.objects.get(semester=request.POST['semester']) except (Semester.DoesNotExist, KeyError): - return HttpResponseRedirect(reverse('import_vv_edit')) + return HttpResponseRedirect(reverse('feedback:import_vv_edit')) # Veranstaltungen übernehmen data['v'] = [] @@ -103,7 +103,7 @@ def import_vv_edit(request): # temporäre Daten löschen vv_parser.parse_vv_clear() - return HttpResponseRedirect(reverse('import_vv_edit_users')) + return HttpResponseRedirect(reverse('feedback:import_vv_edit_users')) class PersonFormView(RedirectUserPassesTestMixin, ListView): @@ -158,9 +158,9 @@ def form_invalid(self, form): def get_success_url(self): next_id, prev_id = self.get_id() if next_id: - return reverse('import_vv_edit_users_update', args=[next_id]) + return reverse('feedback:import_vv_edit_users_update', args=[next_id]) else: - return reverse('import_vv_edit_users') + return reverse('feedback:import_vv_edit_users') def test_func(self): return self.request.user.is_superuser @@ -194,7 +194,7 @@ def post(self, request, *args, **kwargs): if not Person.is_veranstalter(new_person): new_person.delete() - return HttpResponseRedirect(reverse('import_vv_edit_users')) + return HttpResponseRedirect(reverse('feedback:import_vv_edit_users')) def get_context_data(self, **kwargs): context = super(SimilarNamesView, self).get_context_data(**kwargs) diff --git a/src/feedback/views/veranstalter.py b/src/feedback/views/veranstalter.py index a0c9ecc..3d3e3e3 100644 --- a/src/feedback/views/veranstalter.py +++ b/src/feedback/views/veranstalter.py @@ -30,7 +30,7 @@ def login(request): request.session['vid'] = v.id request.session['veranstaltung'] = str(v) - return HttpResponseRedirect(reverse('veranstalter-index')) + return HttpResponseRedirect(reverse('feedback:veranstalter-index')) return render(request, 'veranstalter/login_failed.html') @@ -181,7 +181,7 @@ def get(self, request, *args, **kwargs): if veranstaltung.allow_order(): return super(VeranstalterWizard, self).get(request, *args, **kwargs) else: - return HttpResponseRedirect(reverse('veranstalter-index')) + return HttpResponseRedirect(reverse('feedback:veranstalter-index')) def get_context_data(self, form, **kwargs): context = super(VeranstalterWizard, self).get_context_data(form=form, **kwargs) diff --git a/src/locale/de/LC_MESSAGES/django.po b/src/locale/de/LC_MESSAGES/django.po index a61ca7c..6d11ebe 100644 --- a/src/locale/de/LC_MESSAGES/django.po +++ b/src/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-23 19:50+0100\n" +"POT-Creation-Date: 2024-12-22 11:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,50 +76,50 @@ msgid "" "geschlossen." msgstr "" -#: feedback/forms.py:123 +#: feedback/forms.py:126 msgid "Datei" msgstr "" -#: feedback/forms.py:138 +#: feedback/forms.py:141 msgid "Das Feld für die Anrede oder Email ist leer." msgstr "" -#: feedback/forms.py:168 feedback/models/base.py:406 +#: feedback/forms.py:171 feedback/models/base.py:406 msgid "Ja" msgstr "" -#: feedback/forms.py:168 feedback/models/base.py:407 +#: feedback/forms.py:171 feedback/models/base.py:407 msgid "Nein" msgstr "" -#: feedback/forms.py:173 +#: feedback/forms.py:176 msgid "Auswahl" msgstr "" -#: feedback/forms.py:203 +#: feedback/forms.py:206 msgid "CSV Datei aus Evasys" msgstr "" -#: feedback/forms.py:203 +#: feedback/forms.py:206 msgid "Im Evasysseitenmenü unter dem Punkt \"Teilnahmeübersicht\" generierbar." msgstr "" -#: feedback/forms.py:206 +#: feedback/forms.py:209 msgid "Versende TANs per E-Mail" msgstr "" -#: feedback/forms.py:206 +#: feedback/forms.py:209 msgid "Verarbeitungsart" msgstr "" -#: feedback/forms.py:210 +#: feedback/forms.py:213 msgid "" "Hier wird eine E-Mail an alle Veranstalter*innen ohne Anhang versendet. Es " "werden die selben Ersetzungen wie beim Standardmailsystem unterstützt und " "zusätzlich das Feld {{ losung }}." msgstr "" -#: feedback/forms.py:211 +#: feedback/forms.py:214 msgid "" "Hier wird die gewählte Vorlage an alle Veranstalter*innen mit einer CSV " "Datei versendet. Es werden die selben Ersetzungen wie beim " @@ -468,7 +468,7 @@ msgstr "" #: feedback/models/base.py:717 #: templates/formtools/wizard/email_zusammenfassung.html:74 -#: templates/veranstalter/dashboard.html:109 +#: templates/veranstalter/dashboard.html:110 msgid "Anmerkung" msgstr "" @@ -479,7 +479,7 @@ msgstr "" #: feedback/models/base.py:729 #: templates/formtools/wizard/email_zusammenfassung.html:66 #: templates/formtools/wizard/zusammenfassung.html:61 -#: templates/veranstalter/dashboard.html:101 +#: templates/veranstalter/dashboard.html:102 msgid "Tutoren" msgstr "" @@ -714,7 +714,7 @@ msgid "" msgstr "" #: templates/feedback/person_form.html:4 -#: templates/veranstalter/dashboard.html:5 templates/veranstalter/index.html:4 +#: templates/veranstalter/dashboard.html:6 templates/veranstalter/index.html:4 msgid "Veranstalterbereich" msgstr "" @@ -818,7 +818,7 @@ msgid "Die Bestellung wurde entgegengenommen" msgstr "" #: templates/formtools/wizard/bestellung_done.html:7 -#: templates/intern/index.html:16 templates/veranstalter/dashboard.html:64 +#: templates/intern/index.html:16 templates/veranstalter/dashboard.html:65 msgid "Ausloggen" msgstr "" @@ -832,22 +832,22 @@ msgid "Zusammenfassung der Fragebogenbestellung für %(veranstaltung)s" msgstr "" #: templates/formtools/wizard/email_zusammenfassung.html:70 -#: templates/veranstalter/dashboard.html:105 +#: templates/veranstalter/dashboard.html:106 msgid "Num" msgstr "" #: templates/formtools/wizard/email_zusammenfassung.html:71 -#: templates/veranstalter/dashboard.html:106 +#: templates/veranstalter/dashboard.html:107 msgid "Vorname" msgstr "" #: templates/formtools/wizard/email_zusammenfassung.html:72 -#: templates/veranstalter/dashboard.html:107 +#: templates/veranstalter/dashboard.html:108 msgid "Nachname" msgstr "" #: templates/formtools/wizard/email_zusammenfassung.html:73 -#: templates/veranstalter/dashboard.html:108 +#: templates/veranstalter/dashboard.html:109 msgid "Email" msgstr "" @@ -1650,32 +1650,48 @@ msgstr "" msgid "weiter zu den Ergebnissen" msgstr "" -#: templates/veranstalter/dashboard.html:61 +#: templates/registration/login.html:5 templates/registration/login.html:8 +msgid "Anmeldung" +msgstr "" + +#: templates/registration/login.html:13 +msgid "Benutzername" +msgstr "" + +#: templates/registration/login.html:17 +msgid "Password" +msgstr "" + +#: templates/registration/login.html:20 +msgid "Anmelden" +msgstr "" + +#: templates/veranstalter/dashboard.html:62 msgid "Dashboard" msgstr "" -#: templates/veranstalter/dashboard.html:66 -#: templates/veranstalter/dashboard.html:73 +#: templates/veranstalter/dashboard.html:67 +#: templates/veranstalter/dashboard.html:74 msgid "Status" msgstr "" -#: templates/veranstalter/dashboard.html:69 +#: templates/veranstalter/dashboard.html:70 msgid "Log" msgstr "" -#: templates/veranstalter/dashboard.html:72 +#: templates/veranstalter/dashboard.html:73 msgid "Datum" msgstr "" -#: templates/veranstalter/dashboard.html:85 +#: templates/veranstalter/dashboard.html:86 msgid "Aktuelle Bestellung" msgstr "" -#: templates/veranstalter/dashboard.html:87 +#: templates/veranstalter/dashboard.html:88 msgid "Bestellung ändern" msgstr "" -#: templates/veranstalter/dashboard.html:128 +#: templates/veranstalter/dashboard.html:129 msgid "Bestellung durchführen" msgstr "" diff --git a/src/locale/en/LC_MESSAGES/django.mo b/src/locale/en/LC_MESSAGES/django.mo index 89991c5..124beff 100644 Binary files a/src/locale/en/LC_MESSAGES/django.mo and b/src/locale/en/LC_MESSAGES/django.mo differ diff --git a/src/locale/en/LC_MESSAGES/django.po b/src/locale/en/LC_MESSAGES/django.po index 2a78f70..29e1e9b 100644 --- a/src/locale/en/LC_MESSAGES/django.po +++ b/src/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-23 19:50+0100\n" +"POT-Creation-Date: 2024-12-22 11:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -78,44 +78,44 @@ msgstr "" "The results will be sent out on this date. After this date, no more " "evaluation forms can be submitted and the digital evaluation will be closed." -#: feedback/forms.py:123 +#: feedback/forms.py:126 msgid "Datei" msgstr "File" -#: feedback/forms.py:138 +#: feedback/forms.py:141 msgid "Das Feld für die Anrede oder Email ist leer." msgstr "The field for the salutation or email is empty." -#: feedback/forms.py:168 feedback/models/base.py:406 +#: feedback/forms.py:171 feedback/models/base.py:406 msgid "Ja" msgstr "Yes" -#: feedback/forms.py:168 feedback/models/base.py:407 +#: feedback/forms.py:171 feedback/models/base.py:407 msgid "Nein" msgstr "No" -#: feedback/forms.py:173 +#: feedback/forms.py:176 msgid "Auswahl" msgstr "Choise" -#: feedback/forms.py:203 +#: feedback/forms.py:206 msgid "CSV Datei aus Evasys" msgstr "CSV file from Evasys" -#: feedback/forms.py:203 +#: feedback/forms.py:206 msgid "Im Evasysseitenmenü unter dem Punkt \"Teilnahmeübersicht\" generierbar." msgstr "" "Can be generated in the Evasys side menu under \"Participation overview\"" -#: feedback/forms.py:206 +#: feedback/forms.py:209 msgid "Versende TANs per E-Mail" msgstr "Send TANs by e-mail" -#: feedback/forms.py:206 +#: feedback/forms.py:209 msgid "Verarbeitungsart" msgstr "Processing type" -#: feedback/forms.py:210 +#: feedback/forms.py:213 msgid "" "Hier wird eine E-Mail an alle Veranstalter*innen ohne Anhang versendet. Es " "werden die selben Ersetzungen wie beim Standardmailsystem unterstützt und " @@ -125,7 +125,7 @@ msgstr "" "replacements are supported as in the standard mail system and the " "{{ losung }} field is also supported." -#: feedback/forms.py:211 +#: feedback/forms.py:214 msgid "" "Hier wird die gewählte Vorlage an alle Veranstalter*innen mit einer CSV " "Datei versendet. Es werden die selben Ersetzungen wie beim " @@ -497,7 +497,7 @@ msgstr "" #: feedback/models/base.py:717 #: templates/formtools/wizard/email_zusammenfassung.html:74 -#: templates/veranstalter/dashboard.html:109 +#: templates/veranstalter/dashboard.html:110 msgid "Anmerkung" msgstr "Note" @@ -508,7 +508,7 @@ msgstr "" #: feedback/models/base.py:729 #: templates/formtools/wizard/email_zusammenfassung.html:66 #: templates/formtools/wizard/zusammenfassung.html:61 -#: templates/veranstalter/dashboard.html:101 +#: templates/veranstalter/dashboard.html:102 msgid "Tutoren" msgstr "Tutors" @@ -746,7 +746,7 @@ msgstr "" "date in order to be recorded." #: templates/feedback/person_form.html:4 -#: templates/veranstalter/dashboard.html:5 templates/veranstalter/index.html:4 +#: templates/veranstalter/dashboard.html:6 templates/veranstalter/index.html:4 msgid "Veranstalterbereich" msgstr "Organizer area" @@ -850,7 +850,7 @@ msgid "Die Bestellung wurde entgegengenommen" msgstr "The order has been accepted" #: templates/formtools/wizard/bestellung_done.html:7 -#: templates/intern/index.html:16 templates/veranstalter/dashboard.html:64 +#: templates/intern/index.html:16 templates/veranstalter/dashboard.html:65 msgid "Ausloggen" msgstr "Log out" @@ -864,22 +864,22 @@ msgid "Zusammenfassung der Fragebogenbestellung für %(veranstaltung)s" msgstr "Summary of the questionnaire order for %(veranstaltung)s" #: templates/formtools/wizard/email_zusammenfassung.html:70 -#: templates/veranstalter/dashboard.html:105 +#: templates/veranstalter/dashboard.html:106 msgid "Num" msgstr "" #: templates/formtools/wizard/email_zusammenfassung.html:71 -#: templates/veranstalter/dashboard.html:106 +#: templates/veranstalter/dashboard.html:107 msgid "Vorname" msgstr "First name" #: templates/formtools/wizard/email_zusammenfassung.html:72 -#: templates/veranstalter/dashboard.html:107 +#: templates/veranstalter/dashboard.html:108 msgid "Nachname" msgstr "Last name" #: templates/formtools/wizard/email_zusammenfassung.html:73 -#: templates/veranstalter/dashboard.html:108 +#: templates/veranstalter/dashboard.html:109 msgid "Email" msgstr "" @@ -1798,32 +1798,48 @@ msgstr "Goodbye!" msgid "weiter zu den Ergebnissen" msgstr "continue to the results" -#: templates/veranstalter/dashboard.html:61 +#: templates/registration/login.html:5 templates/registration/login.html:8 +msgid "Anmeldung" +msgstr "Login" + +#: templates/registration/login.html:13 +msgid "Benutzername" +msgstr "Username" + +#: templates/registration/login.html:17 +msgid "Password" +msgstr "" + +#: templates/registration/login.html:20 +msgid "Anmelden" +msgstr "Login" + +#: templates/veranstalter/dashboard.html:62 msgid "Dashboard" msgstr "" -#: templates/veranstalter/dashboard.html:66 -#: templates/veranstalter/dashboard.html:73 +#: templates/veranstalter/dashboard.html:67 +#: templates/veranstalter/dashboard.html:74 msgid "Status" msgstr "" -#: templates/veranstalter/dashboard.html:69 +#: templates/veranstalter/dashboard.html:70 msgid "Log" msgstr "" -#: templates/veranstalter/dashboard.html:72 +#: templates/veranstalter/dashboard.html:73 msgid "Datum" msgstr "Date" -#: templates/veranstalter/dashboard.html:85 +#: templates/veranstalter/dashboard.html:86 msgid "Aktuelle Bestellung" msgstr "Current order" -#: templates/veranstalter/dashboard.html:87 +#: templates/veranstalter/dashboard.html:88 msgid "Bestellung ändern" msgstr "Change order" -#: templates/veranstalter/dashboard.html:128 +#: templates/veranstalter/dashboard.html:129 msgid "Bestellung durchführen" msgstr "Execute order" diff --git a/src/settings.py b/src/settings.py index b98f3d6..a0b6d3f 100644 --- a/src/settings.py +++ b/src/settings.py @@ -112,6 +112,7 @@ 'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'feedback.auth.FSDebugRemoteUserMiddleware', + # 'whitenoise.middleware.WhiteNoiseMiddleware', # while DEBUG=False servers static files, Note:first pip install whitenoise ] if not TESTING: MIDDLEWARE += 'debug_toolbar.middleware.DebugToolbarMiddleware' @@ -195,8 +196,8 @@ } } -LOGIN_URL = '/intern/' -LOGIN_REDIRECT_URL = '/intern/uebersicht/' +LOGIN_URL = '/de/intern/' +LOGIN_REDIRECT_URL = '/de/intern/uebersicht/' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' diff --git a/src/templates/bestellung_base.html b/src/templates/bestellung_base.html index 0b5c29e..5c611aa 100644 --- a/src/templates/bestellung_base.html +++ b/src/templates/bestellung_base.html @@ -7,8 +7,8 @@ {% block backlink %} {% if request.user.is_superuser %} -

{% translate "zurück zum internen Bereich" %}

+

{% translate "zurück zum internen Bereich" %}

{% else %} -

{% translate "zurück zum Veranstalterbereich" %}

+

{% translate "zurück zum Veranstalterbereich" %}

{% endif %} {% endblock %} diff --git a/src/templates/d120/sidebar.html b/src/templates/d120/sidebar.html index 6cae342..ef8f5ee 100644 --- a/src/templates/d120/sidebar.html +++ b/src/templates/d120/sidebar.html @@ -12,10 +12,10 @@ {% translate "Hall of Fame" %} diff --git a/src/templates/d120_base.html b/src/templates/d120_base.html index 950bfe0..c89dc82 100644 --- a/src/templates/d120_base.html +++ b/src/templates/d120_base.html @@ -37,7 +37,7 @@ {% if request.session.orig_uid %} {% endif %} {% if messages %}