diff --git a/app/bird/migrations/0001_initial.py b/app/bird/migrations/0001_initial.py index a019dbf..ebea249 100644 --- a/app/bird/migrations/0001_initial.py +++ b/app/bird/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.6 on 2023-10-09 21:31 +# Generated by Django 4.2.5 on 2023-10-16 18:35 import ckeditor.fields from django.conf import settings diff --git a/app/contact/__init__.py b/app/contact/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/contact/admin.py b/app/contact/admin.py new file mode 100644 index 0000000..a444f08 --- /dev/null +++ b/app/contact/admin.py @@ -0,0 +1,15 @@ +from django.contrib import admin + +from .models import Contact + + +@admin.register(Contact) +class FallenBirdAdmin(admin.ModelAdmin): + list_display = [ + "name", + "phone", + "email", + "address", + "comment", + ] + list_filter = ("name", "phone", "email", "address", "comment") diff --git a/app/contact/apps.py b/app/contact/apps.py new file mode 100644 index 0000000..594aa3a --- /dev/null +++ b/app/contact/apps.py @@ -0,0 +1,8 @@ +from django.apps import AppConfig +from django.utils.translation import gettext_lazy as _ + + +class ContactConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "contact" + verbose_name = _("Kontakte") diff --git a/app/contact/migrations/0001_initial.py b/app/contact/migrations/0001_initial.py new file mode 100644 index 0000000..e486762 --- /dev/null +++ b/app/contact/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# Generated by Django 4.2.5 on 2023-10-16 18:42 + +from django.db import migrations, models +import uuid + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('name', models.CharField(blank=True, max_length=50, null=True, verbose_name='Kontakt Name')), + ('phone', models.CharField(blank=True, max_length=50, null=True, verbose_name='Telefon')), + ('email', models.CharField(blank=True, max_length=50, null=True, verbose_name='Email')), + ('address', models.CharField(blank=True, max_length=50, null=True, verbose_name='Adresse')), + ('comment', models.CharField(blank=True, max_length=50, null=True, verbose_name='Bemerkungen')), + ], + ), + ] diff --git a/app/contact/migrations/0002_alter_contact_options.py b/app/contact/migrations/0002_alter_contact_options.py new file mode 100644 index 0000000..57b5f47 --- /dev/null +++ b/app/contact/migrations/0002_alter_contact_options.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-10-16 19:34 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('contact', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='contact', + options={'verbose_name': 'Kontakt', 'verbose_name_plural': 'Kontakte'}, + ), + ] diff --git a/app/contact/migrations/__init__.py b/app/contact/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/contact/models.py b/app/contact/models.py new file mode 100644 index 0000000..9b566af --- /dev/null +++ b/app/contact/models.py @@ -0,0 +1,27 @@ +from django.db import models +from uuid import uuid4 + +from django.utils.translation import gettext_lazy as _ + + +class Contact(models.Model): + id = models.UUIDField(primary_key=True, default=uuid4, editable=False) + name = models.CharField( + max_length=50, null=True, blank=True, verbose_name=_("Kontakt Name") + ) + phone = models.CharField( + max_length=50, null=True, blank=True, verbose_name=_("Telefon") + ) + email = models.CharField( + max_length=50, null=True, blank=True, verbose_name=_("Email") + ) + address = models.CharField( + max_length=50, null=True, blank=True, verbose_name=_("Adresse") + ) + comment = models.CharField( + max_length=50, null=True, blank=True, verbose_name=_("Bemerkungen") + ) + + class Meta: + verbose_name = _("Kontakt") + verbose_name_plural = _("Kontakte") diff --git a/app/contact/templates/contact/contact_all.html b/app/contact/templates/contact/contact_all.html new file mode 100644 index 0000000..949c475 --- /dev/null +++ b/app/contact/templates/contact/contact_all.html @@ -0,0 +1,75 @@ +{% extends "base.html" %} +{% load static %} +{% block header %} + + + + + + + + + + + + + + + + + + +{% endblock header %} + +{% block content %} +
Die Übersicht aller bisher hinterlegten Kontakte.
+ +Name | +Telefon | +Adresse | +Bemerkung | +|
---|---|---|---|---|
{{ item.name }} | +{{ item.phone|default_if_none:"" }} | +{{ item.email|default_if_none:"" }} | +{{ item.address|default_if_none:"" }} | +{{ item.comment|default_if_none:"" }} | +