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.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"),
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{{form|crispy}}
|
||||
<button class="btn btn-success" type="abbort">Abbrechen</button>
|
||||
<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>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{% extends 'base.html' %} {% block content %}
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="row" style="text-align: center;">
|
||||
<div>
|
||||
<h1 style="margin-bottom: 5px;">FallenBirdy</h1>
|
||||
<img src="../../../static/img/wvhLogo12001200300x.png" alt="Logo Wildvogelhilfe Jena" class="logowvh">
|
||||
<a href="{% url 'account_login' %}" id="loginMain">Einloggen</a>
|
||||
<img src="../../../static/img/wvh.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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% 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>
|
||||
|
||||
{% get_providers as socialaccount_providers %}
|
||||
|
||||
{% comment %}
|
||||
{% if socialaccount_providers %}
|
||||
<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>
|
||||
|
@ -32,7 +32,7 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
|
|||
{% else %}
|
||||
<p>{% blocktrans %}If you have not created an account yet, then please
|
||||
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
{% endif %} {% endcomment %}
|
||||
|
||||
<form class="login" method="POST" action="{% url 'account_login' %}">
|
||||
{% csrf_token %}
|
||||
|
@ -45,12 +45,4 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
|
|||
</form>
|
||||
</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 %}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{% if user.is_authenticated %}
|
||||
<div class="container">
|
||||
<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>
|
||||
|
@ -14,3 +15,4 @@
|
|||
</ul>
|
||||
</footer>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% load static %}
|
||||
{% if user.is_authenticated %}
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'index' %}">
|
||||
|
@ -49,4 +51,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{% endif %}
|
||||
<br />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue