--- /dev/null
+from django import forms
+'''
+class UploadFileForm(forms.Form):
+ file1 = forms.FileField(label='S-Verein-Export')
+
+class DocumentForm(forms.Form):
+ docfile = forms.FileField(
+ label='Select a file',
+ help_text='max. 42 megabytes'
+ )
+
+class TextInputForm(forms.Form):
+ text = forms.CharField(
+ label = "Text für das Anschreiben",
+ empty_value = "Bitte Text eingeben ...",
+ widget=forms.Textarea,
+ )
+'''
+'''
+- Doku zu Forms:
+https://docs.djangoproject.com/en/2.2/topics/forms/
+- Doku zu Fields:
+https://docs.djangoproject.com/en/2.2/ref/forms/fields/
+'''
+class KassenbriefForm(forms.Form):
+ briefpapier = forms.FileField(label='Briefpapier ändern:', required=False)
+ basisbeitrag = forms.IntegerField()
+ zusatzbeitrag = forms.IntegerField(label="Beitrag für Zusatzgrundstück")
--- /dev/null
+from django.http import HttpResponse
+from django.shortcuts import render
+from django.template import loader
+
+from .AWK import config, routines
+#import .forms
+from .forms import KassenbriefForm
+
+# Create your views here.
+
+def index(request, verein):
+ template = loader.get_template("vbasis.html")
+ return HttpResponse(template.render({"verein" : verein}, request))
+
+def kassenbrief(request, verein):
+ # Hole Daten aus der Config
+ vconf = config.getInstance(verein)
+ briefpapier = vconf.getConfig("briefpapier")
+ beitrag_basis = vconf.getConfig("beitrag_basis", 0)
+ beitrag_zusatz = vconf.getConfig("beitrag_zusatz", 0)
+ briefpapier_label = briefpapier
+ if not briefpapier:
+ briefpapier_label = "Kein Briefpapier ausgewäht"
+
+ # if this is a POST request we need to process the form data
+ if request.method == 'POST':
+ # create a form instance and populate it with data from the request:
+ form = KassenbriefForm(request.POST, request.FILES)
+ # check whether it's valid:
+ if form.is_valid():
+ # bei Änderungen Konfiguration aktualisieren
+ routines.aktualisiere_config(vconf, form.cleaned_data)
+ # redirect to a new URL:
+ return HttpResponseRedirect('/thanks/')
+
+ # if a GET (or any other method) we'll create a blank form
+ else:
+ form = KassenbriefForm(initial={'basisbeitrag': beitrag_basis, 'zusatzbeitrag': beitrag_zusatz})
+
+ return render(request, 'kassenbrief.html', {'form': form, 'verein': verein, 'briefpapier': briefpapier_label})
+
+ '''
+ template = loader.get_template("kassenbrief.html")
+ return HttpResponse(template.render({
+ "verein" : verein,
+ "briefpapier" : briefpapier,
+ "beitrag_basis" : beitrag_basis,
+ "beitrag_zusatz" : beitrag_zusatz
+ }, request))
+
+ '''
+
+def kassenbrief_exec(request, verein):
+ # Hole Formulardaten
+ print (request.POST)
+ print (request.FILES)
+ return HttpResponse("xxx")
+
\ No newline at end of file