diff --git a/src/fellchensammlung/forms.py b/src/fellchensammlung/forms.py index c226e2d..ad7b54c 100644 --- a/src/fellchensammlung/forms.py +++ b/src/fellchensammlung/forms.py @@ -84,19 +84,7 @@ class AdoptionNoticeFormWithDateWidget(AdoptionNoticeForm): class AnimalForm(forms.ModelForm): - def __init__(self, *args, **kwargs): - if 'in_adoption_notice_creation_flow' in kwargs: - adding = kwargs.pop('in_adoption_notice_creation_flow') - else: - adding = False - super().__init__(*args, **kwargs) - self.helper = FormHelper() - self.helper.form_class = 'form-animal card' - if adding: - self.helper.add_input(Submit('save-and-add-another-animal', _('Speichern und weiteres Tier hinzufügen'))) - self.helper.add_input(Submit('save-and-finish', _('Speichern und beenden'))) - else: - self.helper.add_input(Submit('submit', _('Speichern'), css_class="btn")) + template_name = "fellchensammlung/forms/form_snippets.html" class Meta: model = Animal diff --git a/src/fellchensammlung/templates/fellchensammlung/forms/form-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/forms/form-adoption-notice.html index faf5d3a..e752a8d 100644 --- a/src/fellchensammlung/templates/fellchensammlung/forms/form-adoption-notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/forms/form-adoption-notice.html @@ -1,8 +1,15 @@ -{% extends "fellchensammlung/base_generic.html" %} +{% extends "fellchensammlung/base_bulma.html" %} {% load i18n %} -{% load crispy_forms_tags %} +{% load widget_tweaks %} {% block content %} -

{% translate "Vermittlungsanzeige" %}

- {% crispy form %} +

{{ form.name.data }}

+
+ {% csrf_token %} + + {{ form }} + + + {% translate "Löschen" %} +
{% endblock %} \ No newline at end of file diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 69ce9bf..406c31f 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -515,7 +515,8 @@ def animal_edit(request, animal_id): """Log""" Log.objects.create(user=request.user, action="add_photo_to_animal", text=f"{request.user} hat Tier {animal.pk} zum Tier geändert") - return redirect(reverse("adoption-notice-detail", args=[animal.adoption_notice.pk], )) + print(reverse("adoption-notice-detail", args=[animal.adoption_notice.pk], )) + return redirect(reverse("adoption-notice-detail-bulma", args=[animal.adoption_notice.pk], )) else: form = AnimalForm(instance=animal) return render(request, 'fellchensammlung/forms/form-adoption-notice.html', context={"form": form})