diff --git a/src/fellchensammlung/forms.py b/src/fellchensammlung/forms.py index f0a406d..922ebe7 100644 --- a/src/fellchensammlung/forms.py +++ b/src/fellchensammlung/forms.py @@ -34,7 +34,6 @@ class AdoptionNoticeForm(forms.ModelForm): } - class AdoptionNoticeFormAutoAnimal(AdoptionNoticeForm): def __init__(self, *args, **kwargs): super(AdoptionNoticeFormAutoAnimal, self).__init__(*args, **kwargs) @@ -46,7 +45,6 @@ class AdoptionNoticeFormAutoAnimal(AdoptionNoticeForm): self.fields["date_of_birth"].widget = DateInput(format=('%Y-%m-%d')) - class AnimalForm(forms.ModelForm): template_name = "fellchensammlung/forms/form_snippets.html" @@ -93,6 +91,7 @@ class ImageForm(forms.ModelForm): class ReportAdoptionNoticeForm(forms.ModelForm): template_name = "fellchensammlung/forms/form_snippets.html" + class Meta: model = ReportAdoptionNotice fields = ('reported_broken_rules', 'user_comment') @@ -100,6 +99,7 @@ class ReportAdoptionNoticeForm(forms.ModelForm): class ReportCommentForm(forms.ModelForm): template_name = "fellchensammlung/forms/form_snippets.html" + class Meta: model = ReportComment fields = ('reported_broken_rules', 'user_comment') diff --git a/src/fellchensammlung/templates/fellchensammlung/forms/form_add_animal_to_adoption.html b/src/fellchensammlung/templates/fellchensammlung/forms/form_add_animal_to_adoption.html index bbb201a..ce4f79b 100644 --- a/src/fellchensammlung/templates/fellchensammlung/forms/form_add_animal_to_adoption.html +++ b/src/fellchensammlung/templates/fellchensammlung/forms/form_add_animal_to_adoption.html @@ -1,13 +1,17 @@ -{% extends "fellchensammlung/base_generic.html" %} +{% extends "fellchensammlung/base_bulma.html" %} {% load i18n %} -{% load crispy_forms_tags %} {% block content %} -

{% translate "Vermitteln" %}

+

{% translate "Tiere hinzufügen" %}

{% blocktranslate %} - Hier kannst du jetzt einzelne Tiere zu deiner Vermittlung hinzufügen. Lad auch gerne Fotos hoch. Gruppenfotos - kannst - du im nächsten Schritt hochladen. + Hier kannst du jetzt einzelne Tiere zu deiner Vermittlung hinzufügen. {% endblocktranslate %} - {% crispy form %} + +
+ {% csrf_token %} + {{ form }} + + +
+ {% endblock %} \ No newline at end of file diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 33bccde..a0ce91d 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -289,7 +289,7 @@ def adoption_notice_add_animal(request, adoption_notice_id): adoption_notice = AdoptionNotice.objects.get(pk=adoption_notice_id) fail_if_user_not_owner_or_trust_level(request.user, adoption_notice) if request.method == 'POST': - form = AnimalFormWithDateWidget(request.POST, request.FILES) + form = AnimalForm(request.POST, request.FILES) if form.is_valid(): instance = form.save(commit=False) @@ -298,12 +298,12 @@ def adoption_notice_add_animal(request, adoption_notice_id): instance.save() form.save_m2m() if "save-and-add-another-animal" in request.POST: - form = AnimalFormWithDateWidget(in_adoption_notice_creation_flow=True) + form = AnimalForm() return render(request, 'fellchensammlung/forms/form_add_animal_to_adoption.html', {'form': form}) else: return redirect(reverse("adoption-notice-detail", args=[adoption_notice_id])) else: - form = AnimalFormWithDateWidget(in_adoption_notice_creation_flow=True) + form = AnimalForm() return render(request, 'fellchensammlung/forms/form_add_animal_to_adoption.html', {'form': form})