diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py
index bbab0cd..e4ffe02 100644
--- a/src/fellchensammlung/models.py
+++ b/src/fellchensammlung/models.py
@@ -297,11 +297,13 @@ class AdoptionNotice(models.Model):
updated_at = models.DateTimeField(auto_now=True)
last_checked = models.DateTimeField(verbose_name=_('Zuletzt überprüft am'), default=timezone.now)
searching_since = models.DateField(verbose_name=_('Sucht nach einem Zuhause seit'))
- name = models.CharField(max_length=200)
+ name = models.CharField(max_length=200, verbose_name=_('Titel der Vermittlung'))
description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung'))
organization = models.ForeignKey(RescueOrganization, blank=True, null=True, on_delete=models.SET_NULL,
verbose_name=_('Organisation'))
- further_information = models.URLField(null=True, blank=True, verbose_name=_('Link zu mehr Informationen'))
+ further_information = models.URLField(null=True, blank=True,
+ verbose_name=_('Link zu mehr Informationen'),
+ help_text=_("Verlinke hier die Quelle der Vermittlung (z.B. die Website des Tierheims"))
group_only = models.BooleanField(default=False, verbose_name=_('Ausschließlich Gruppenadoption'))
photos = models.ManyToManyField(Image, blank=True)
location_string = models.CharField(max_length=200, verbose_name=_("Ortsangabe"))
diff --git a/src/fellchensammlung/templates/fellchensammlung/forms/bulma-form-add-adoption.html b/src/fellchensammlung/templates/fellchensammlung/forms/bulma-form-add-adoption.html
index f0bb7e9..b5ff965 100644
--- a/src/fellchensammlung/templates/fellchensammlung/forms/bulma-form-add-adoption.html
+++ b/src/fellchensammlung/templates/fellchensammlung/forms/bulma-form-add-adoption.html
@@ -1,6 +1,7 @@
{% extends "fellchensammlung/base_bulma.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
+{% load widget_tweaks %}
{% block title %}
{% translate "Vermittlung hinzufügen" %}{% endblock %}
@@ -12,17 +13,83 @@
{% url 'terms-of-service' as rules_url %}
{% trans "Regeln" as rules_text %}
{% blocktranslate with rules_link=''|add:rules_text|add:''|safe %}
- Bitte mach dich zunächst mit unseren {{ rules_link }} vertraut. Dann trage hier die ersten Informationen ein.
- Wenn du Details und Fotos zu den Tieren hinzufügen willst oder ihr Geschlecht und Geburtsdatum anpassen
- willst,
- kannst du das im nächsten Schritt tun.
+ Bitte mach dich zunächst mit unseren {{ rules_link }} vertraut. Dann trage hier die ersten Informationen
+ ein.
+ Fotos kannst du im nächsten Schritt hinzufügen.
{% endblocktranslate %}
{% endblock %}
\ No newline at end of file
diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py
index ab84838..57900d4 100644
--- a/src/fellchensammlung/views.py
+++ b/src/fellchensammlung/views.py
@@ -314,9 +314,11 @@ def add_adoption_notice(request):
@login_required
def add_adoption_notice_bulma(request):
if request.method == 'POST':
- form = BulmaAdoptionNoticeForm(request.POST)
+ print("dada")
+ form = AdoptionNoticeFormWithDateWidgetAutoAnimal(request.POST)
if form.is_valid():
+ print("dodo")
an_instance = form.save(commit=False)
an_instance.owner = request.user
@@ -346,9 +348,11 @@ def add_adoption_notice_bulma(request):
# Automatically subscribe user that created AN to AN
Subscriptions.objects.create(owner=request.user, adoption_notice=an_instance)
- return redirect(reverse("adoption-notice-detail", args=[an_instance.pk]))
+ return redirect(reverse("adoption-notice-detail-bulma", args=[an_instance.pk]))
+ else:
+ print(form.errors)
else:
- form = BulmaAdoptionNoticeForm()
+ form = AdoptionNoticeFormWithDateWidgetAutoAnimal()
return render(request, 'fellchensammlung/forms/bulma-form-add-adoption.html', {'form': form})
diff --git a/src/notfellchen/settings.py b/src/notfellchen/settings.py
index a00083f..816b480 100644
--- a/src/notfellchen/settings.py
+++ b/src/notfellchen/settings.py
@@ -176,6 +176,7 @@ INSTALLED_APPS = [
'rest_framework.authtoken',
'drf_spectacular',
'drf_spectacular_sidecar', # required for Django collectstatic discovery
+ 'widget_tweaks'
]
MIDDLEWARE = [