From b36f0f4a9a11b81f0c725a2525ba5bacefd7dbe9 Mon Sep 17 00:00:00 2001 From: Vorname Nachname Date: Sun, 20 Mar 2022 00:46:18 +0100 Subject: [PATCH] =?UTF-8?q?Anreise=20in=20Krieseninterventionsliste=20hinz?= =?UTF-8?q?u=20gef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jdav_web/members/admin.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/jdav_web/members/admin.py b/jdav_web/members/admin.py index 0a977ad..83b7dfc 100644 --- a/jdav_web/members/admin.py +++ b/jdav_web/members/admin.py @@ -138,6 +138,9 @@ class FreizeitAdminForm(forms.ModelForm): tour_type = TypedChoiceField(choices=Freizeit.tour_type_choices, coerce=int, label=_('Tour type')) + tour_approach = TypedChoiceField(choices=Freizeit.tour_approach_choices, + coerce=int, + label=_('Tour type')) class Meta: model = Freizeit @@ -391,6 +394,20 @@ class FreizeitAdmin(admin.ModelAdmin): tour_type += '\\qquad \\qquad ' template_content = template_content.replace('TOUR-TYPE', tour_type) + # create tickboxes for tour approach + tour_approach = '' + for tt in ['Muskelkraft', 'Öffentliche VM', 'Fahrgemeinschaften']: + print(memberlist.tour_approach) + if tt == memberlist.get_tour_approach(): + tour_approach += '\\tickedbox ' + tt + else: + tour_approach += '\\checkbox' + tour_approach += '\\enspace ' + tt + + tour_approach += '\\qquad \\qquad ' + template_content = template_content.replace('TOUR-APPROACH', tour_approach) + + template_content = template_content.replace('TABLE-NAME', filename_table)