beautified
This commit is contained in:
parent
864c700666
commit
70d9995005
9 changed files with 36 additions and 41 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from datetime import date
|
|
||||||
|
|
||||||
from .models import FallenBird
|
from .models import FallenBird
|
||||||
|
|
||||||
|
@ -11,18 +12,9 @@ class DateInput(forms.DateInput):
|
||||||
|
|
||||||
class BirdAddForm(forms.ModelForm):
|
class BirdAddForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
widgets = {
|
widgets = {"date_found": DateInput(format="%Y-%m-%d", attrs={"value": date.today})}
|
||||||
"date_found": DateInput(format="%Y-%m-%d", attrs={"value": date.today})
|
|
||||||
}
|
|
||||||
model = FallenBird
|
model = FallenBird
|
||||||
fields = [
|
fields = ["bird_identifier","bird","date_found","place","status", ]
|
||||||
"bird_identifier",
|
|
||||||
"bird",
|
|
||||||
"date_found",
|
|
||||||
"place",
|
|
||||||
"status",
|
|
||||||
|
|
||||||
]
|
|
||||||
labels = {
|
labels = {
|
||||||
"bird_identifier": _("Kennung"),
|
"bird_identifier": _("Kennung"),
|
||||||
"bird": _("Vogel"),
|
"bird": _("Vogel"),
|
||||||
|
|
|
@ -1,28 +1,35 @@
|
||||||
import names
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
|
from aviary.models import Aviary
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from aviary.models import Aviary
|
|
||||||
from rescuer.models import Rescuer
|
from rescuer.models import Rescuer
|
||||||
|
|
||||||
|
|
||||||
class FallenBird(models.Model):
|
class FallenBird(models.Model):
|
||||||
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
id = models.UUIDField(primary_key=True, default=uuid4, editable=False)
|
||||||
bird_identifier = models.CharField(max_length=256, verbose_name=_("Kennung"))
|
bird_identifier = models.CharField(
|
||||||
bird = models.ForeignKey("Bird", on_delete=models.CASCADE, verbose_name=_("Patient"))
|
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"))
|
date_found = models.DateField(verbose_name=_("Datum des Fundes"))
|
||||||
place = models.CharField(max_length=256, verbose_name=_("Ort des Fundes"))
|
place = models.CharField(max_length=256, verbose_name=_("Ort des Fundes"))
|
||||||
created = models.DateTimeField(auto_now_add=True, verbose_name=_("angelegt am"))
|
created = models.DateTimeField(
|
||||||
updated = models.DateTimeField(auto_now=True, verbose_name=_("geändert am"))
|
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)
|
diagnostic_finding = models.CharField(max_length=256)
|
||||||
cost_sum = models.DecimalField(max_digits=5, decimal_places=2, default=0.00)
|
cost_sum = models.DecimalField(
|
||||||
rescuer = models.ForeignKey(Rescuer, on_delete=models.SET_NULL, blank=True, null=True)
|
max_digits=5, decimal_places=2, default=0.00)
|
||||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
rescuer = models.ForeignKey(
|
||||||
status = models.ForeignKey("BirdStatus", on_delete=models.CASCADE, default=1)
|
Rescuer, on_delete=models.SET_NULL, blank=True, null=True)
|
||||||
aviary = models.ForeignKey(Aviary, 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:
|
class Meta:
|
||||||
verbose_name = _("Patient")
|
verbose_name = _("Patient")
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{{form|crispy}}
|
{{form|crispy}}
|
||||||
<button class="btn btn-success" type="abbort">Abbrechen</button>
|
<button class="btn btn-success" type="abbort">Abbrechen</button>
|
||||||
<a href="{% url 'bird_delete' bird.id %}" class="btn btn-danger">Löschen</a>
|
<a href="{% url 'bird_delete' bird.id %}" class="btn btn-danger">Löschen</a>
|
||||||
<button class="btn btn-primary" type="submit">Speichern und zur Übersicht</button>
|
<button class="btn btn-primary" type="submit">Speichern</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import names
|
import names
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.shortcuts import HttpResponse, redirect, render
|
from django.shortcuts import HttpResponse, redirect, render
|
||||||
|
from rescuer.models import Rescuer
|
||||||
|
|
||||||
from .forms import BirdAddForm, BirdEditForm
|
from .forms import BirdAddForm, BirdEditForm
|
||||||
from .models import FallenBird
|
from .models import FallenBird
|
||||||
from rescuer.models import Rescuer
|
|
||||||
|
|
||||||
|
|
||||||
@login_required(login_url="account_login")
|
@login_required(login_url="account_login")
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
{% extends 'base.html' %} {% block content %}
|
{% extends 'base.html' %}
|
||||||
|
{% block content %}
|
||||||
<div class="row" style="text-align: center;">
|
<div class="row" style="text-align: center;">
|
||||||
<div>
|
<div>
|
||||||
<h1 style="margin-bottom: 5px;">FallenBirdy</h1>
|
<img src="../../../static/img/wvh.png" alt="Logo Wildvogelhilfe Jena" class="logowvh">
|
||||||
<img src="../../../static/img/wvhLogo12001200300x.png" alt="Logo Wildvogelhilfe Jena" class="logowvh">
|
<a href="{% url 'account_login' %}" id="loginMain"><button type="button" class="btn btn-primary btn-lg">Anmelden</button></a>
|
||||||
<a href="{% url 'account_login' %}" id="loginMain">Einloggen</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
BIN
static/img/wvh.png
Normal file
BIN
static/img/wvh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
|
@ -14,7 +14,7 @@
|
||||||
<h1>{% trans "Sign In" %}</h1>
|
<h1>{% trans "Sign In" %}</h1>
|
||||||
|
|
||||||
{% get_providers as socialaccount_providers %}
|
{% get_providers as socialaccount_providers %}
|
||||||
|
{% comment %}
|
||||||
{% if socialaccount_providers %}
|
{% if socialaccount_providers %}
|
||||||
<p>{% blocktrans with site.name as site_name %}Please sign in with one
|
<p>{% blocktrans with site.name as site_name %}Please sign in with one
|
||||||
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
|
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
|
||||||
|
@ -32,7 +32,7 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>{% blocktrans %}If you have not created an account yet, then please
|
<p>{% blocktrans %}If you have not created an account yet, then please
|
||||||
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
|
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
|
||||||
{% endif %}
|
{% endif %} {% endcomment %}
|
||||||
|
|
||||||
<form class="login" method="POST" action="{% url 'account_login' %}">
|
<form class="login" method="POST" action="{% url 'account_login' %}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
@ -45,12 +45,4 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% comment %}
|
|
||||||
<div class="col-lg-5">
|
|
||||||
<h4>Login</h4>
|
|
||||||
<p>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?</p>
|
|
||||||
</div>
|
|
||||||
{% endcomment %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% if user.is_authenticated %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<footer class="footer d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
|
<footer class="footer d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
|
||||||
<p class="col-md-4 mb-0 text-muted">© 2023 fbf</p>
|
<p class="col-md-4 mb-0 text-muted">© 2023 fbf</p>
|
||||||
|
@ -14,3 +15,4 @@
|
||||||
</ul>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
|
<nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="{% url 'index' %}">
|
<a class="navbar-brand" href="{% url 'index' %}">
|
||||||
|
@ -49,4 +51,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
{% endif %}
|
||||||
<br />
|
<br />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue