diff --git a/bird/forms.py b/bird/forms.py index 4508082..af30399 100644 --- a/bird/forms.py +++ b/bird/forms.py @@ -1,6 +1,7 @@ +from datetime import date + from django import forms from django.utils.translation import gettext_lazy as _ -from datetime import date from .models import FallenBird @@ -11,18 +12,9 @@ class DateInput(forms.DateInput): class BirdAddForm(forms.ModelForm): class Meta: - widgets = { - "date_found": DateInput(format="%Y-%m-%d", attrs={"value": date.today}) - } + widgets = {"date_found": DateInput(format="%Y-%m-%d", attrs={"value": date.today})} model = FallenBird - fields = [ - "bird_identifier", - "bird", - "date_found", - "place", - "status", - - ] + fields = ["bird_identifier","bird","date_found","place","status", ] labels = { "bird_identifier": _("Kennung"), "bird": _("Vogel"), diff --git a/bird/models.py b/bird/models.py index 1e860c0..eeeebf4 100644 --- a/bird/models.py +++ b/bird/models.py @@ -1,28 +1,35 @@ -import names from uuid import uuid4 +from aviary.models import Aviary from django.conf import settings from django.db import models from django.utils.translation import gettext_lazy as _ - -from aviary.models import Aviary from rescuer.models import Rescuer class FallenBird(models.Model): id = models.UUIDField(primary_key=True, default=uuid4, editable=False) - bird_identifier = models.CharField(max_length=256, verbose_name=_("Kennung")) - bird = models.ForeignKey("Bird", on_delete=models.CASCADE, verbose_name=_("Patient")) + bird_identifier = models.CharField( + max_length=256, verbose_name=_("Kennung")) + bird = models.ForeignKey( + "Bird", on_delete=models.CASCADE, verbose_name=_("Patient")) date_found = models.DateField(verbose_name=_("Datum des Fundes")) place = models.CharField(max_length=256, verbose_name=_("Ort des Fundes")) - created = models.DateTimeField(auto_now_add=True, verbose_name=_("angelegt am")) - updated = models.DateTimeField(auto_now=True, verbose_name=_("geändert am")) + created = models.DateTimeField( + auto_now_add=True, verbose_name=_("angelegt am")) + updated = models.DateTimeField( + auto_now=True, verbose_name=_("geändert am")) diagnostic_finding = models.CharField(max_length=256) - cost_sum = models.DecimalField(max_digits=5, decimal_places=2, default=0.00) - rescuer = models.ForeignKey(Rescuer, on_delete=models.SET_NULL, blank=True, null=True) - user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) - status = models.ForeignKey("BirdStatus", on_delete=models.CASCADE, default=1) - aviary = models.ForeignKey(Aviary, on_delete=models.SET_NULL, blank=True, null=True) + cost_sum = models.DecimalField( + max_digits=5, decimal_places=2, default=0.00) + rescuer = models.ForeignKey( + Rescuer, on_delete=models.SET_NULL, blank=True, null=True) + user = models.ForeignKey(settings.AUTH_USER_MODEL, + on_delete=models.CASCADE) + status = models.ForeignKey( + "BirdStatus", on_delete=models.CASCADE, default=1) + aviary = models.ForeignKey( + Aviary, on_delete=models.SET_NULL, blank=True, null=True) class Meta: verbose_name = _("Patient") diff --git a/bird/templates/bird/bird_single.html b/bird/templates/bird/bird_single.html index 54e6643..d4f676a 100644 --- a/bird/templates/bird/bird_single.html +++ b/bird/templates/bird/bird_single.html @@ -11,7 +11,7 @@ {{form|crispy}} Löschen - + diff --git a/bird/views.py b/bird/views.py index ad6ccb8..290b2b0 100644 --- a/bird/views.py +++ b/bird/views.py @@ -1,10 +1,10 @@ import names from django.contrib.auth.decorators import login_required from django.shortcuts import HttpResponse, redirect, render +from rescuer.models import Rescuer from .forms import BirdAddForm, BirdEditForm from .models import FallenBird -from rescuer.models import Rescuer @login_required(login_url="account_login") diff --git a/sites/templates/sites/index.html b/sites/templates/sites/index.html index 8921a63..78923da 100644 --- a/sites/templates/sites/index.html +++ b/sites/templates/sites/index.html @@ -1,10 +1,9 @@ -{% extends 'base.html' %} {% block content %} +{% extends 'base.html' %} +{% block content %}
-

FallenBirdy

- Logo Wildvogelhilfe Jena - Einloggen + Logo Wildvogelhilfe Jena +
- {% endblock content %} diff --git a/static/img/wvh.png b/static/img/wvh.png new file mode 100644 index 0000000..a534a5a Binary files /dev/null and b/static/img/wvh.png differ diff --git a/templates/account/login.html b/templates/account/login.html index 34a8709..889e0ec 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -14,7 +14,7 @@

{% trans "Sign In" %}

{% get_providers as socialaccount_providers %} - +{% comment %} {% if socialaccount_providers %}

{% blocktrans with site.name as site_name %}Please sign in with one of your existing third party accounts. Or, sign up @@ -32,7 +32,7 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}

{% else %}

{% blocktrans %}If you have not created an account yet, then please sign up first.{% endblocktrans %}

-{% endif %} +{% endif %} {% endcomment %}
{% csrf_token %} @@ -45,12 +45,4 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}

-{% comment %} -
-

Login

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fuga sapiente rerum dignissimos voluptatum, expedita saepe quae voluptas possimus eveniet eligendi fugiat similique repudiandae. Necessitatibus fugiat accusamus laudantium qui, et dolore?

-
-{% endcomment %} - - {% endblock %} diff --git a/templates/partials/_footer.html b/templates/partials/_footer.html index c8b7e14..7688833 100644 --- a/templates/partials/_footer.html +++ b/templates/partials/_footer.html @@ -1,3 +1,4 @@ +{% if user.is_authenticated %}
+{% endif %} diff --git a/templates/partials/_navbar.html b/templates/partials/_navbar.html index f8b035d..e5f454e 100644 --- a/templates/partials/_navbar.html +++ b/templates/partials/_navbar.html @@ -1,4 +1,6 @@ {% load static %} +{% if user.is_authenticated %} + +{% endif %}