1
0
Fork 0

some labels for LibraryForm changed

This commit is contained in:
Benni Bärmann 2020-11-18 15:38:38 +01:00
parent 7a1fbcbc06
commit eaea801f73
2 changed files with 13 additions and 2 deletions

View File

@ -138,7 +138,6 @@ TYPE_CHOICES = {'BIB': format_html('<a href="https://de.wikipedia.org/wiki/Wikip
'VIS': format_html('<a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/E-Mail-Adressen_und_Visitenkarten#Visitenkarten">Visitenkarten</a>'), 'VIS': format_html('<a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/E-Mail-Adressen_und_Visitenkarten#Visitenkarten">Visitenkarten</a>'),
} }
# same model is used for Library, ELitStip and Software! # same model is used for Library, ELitStip and Software!
class Library(Grant): class Library(Grant):

View File

@ -11,6 +11,7 @@ from django.template.loader import get_template
from django.template import Context from django.template import Context
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.html import format_html
from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\ from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\
HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\ HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\
@ -108,6 +109,17 @@ class InternView(LoginRequiredMixin, CookieWizardView):
return done(self.request) 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): class ExternView(CookieWizardView):
'''This View is for Volunteers''' '''This View is for Volunteers'''
@ -131,7 +143,7 @@ class ExternView(CookieWizardView):
form = IFGForm(data) form = IFGForm(data)
elif choice in ('BIB', 'SOFT', 'ELIT'): elif choice in ('BIB', 'SOFT', 'ELIT'):
form = LibraryForm(data) form = LibraryForm(data)
form.fields['library'].label = TYPE_CHOICES[choice] form.fields['library'].label = LABEL_CHOICES[choice]
elif choice == 'MAIL': elif choice == 'MAIL':
form = EmailForm(data) form = EmailForm(data)
elif choice == 'LIT': elif choice == 'LIT':