From eaea801f73aac3946763caf1be58e06fb3709615 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 18 Nov 2020 15:38:38 +0100 Subject: [PATCH] some labels for LibraryForm changed --- input/models.py | 1 - input/views.py | 14 +++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/input/models.py b/input/models.py index 750c82d..307b644 100644 --- a/input/models.py +++ b/input/models.py @@ -138,7 +138,6 @@ TYPE_CHOICES = {'BIB': format_html('Visitenkarten'), } - # same model is used for Library, ELitStip and Software! class Library(Grant): diff --git a/input/views.py b/input/views.py index 67dab8d..fcc008f 100644 --- a/input/views.py +++ b/input/views.py @@ -11,6 +11,7 @@ from django.template.loader import get_template from django.template import Context from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin +from django.utils.html import format_html from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\ HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\ @@ -108,6 +109,17 @@ class InternView(LoginRequiredMixin, CookieWizardView): return done(self.request) +# these where used as labels in the second form TYPE_CHOICES is used for the first form and the +# text above the second form. only used for BIB, SOFT, ELIT in the moment +LABEL_CHOICES = {'BIB': format_html('Bibliothek'), + 'ELIT': format_html('Datenbank/Online-Ressource'), + 'MAIL': format_html('E-Mail-Adresse'), + 'IFG': format_html('Kostenübernahme IFG-Anfrage'), + 'LIT': format_html('Literaturstipendium'), + 'LIST': format_html('Mailingliste'), + 'SOFT': format_html('Software'), + 'VIS': format_html('Visitenkarten'), + } class ExternView(CookieWizardView): '''This View is for Volunteers''' @@ -131,7 +143,7 @@ class ExternView(CookieWizardView): form = IFGForm(data) elif choice in ('BIB', 'SOFT', 'ELIT'): form = LibraryForm(data) - form.fields['library'].label = TYPE_CHOICES[choice] + form.fields['library'].label = LABEL_CHOICES[choice] elif choice == 'MAIL': form = EmailForm(data) elif choice == 'LIT':