diff --git a/council/__pycache__/admin.cpython-312.pyc b/council/__pycache__/admin.cpython-312.pyc index 15d1930..2492790 100644 Binary files a/council/__pycache__/admin.cpython-312.pyc and b/council/__pycache__/admin.cpython-312.pyc differ diff --git a/council/admin.py b/council/admin.py index 10bf80a..d71d784 100644 --- a/council/admin.py +++ b/council/admin.py @@ -1,5 +1,5 @@ from django.contrib import admin -from .models import PublicBody, Party, Member, Question, Answer +from .models import PublicBody, Party, Member, Question, Answer, Vote @admin.register(PublicBody) @@ -33,4 +33,11 @@ class QuestionAdmin(admin.ModelAdmin): class AnswerAdmin(admin.ModelAdmin): list_display = ("question", "answered_by", "created_at") list_filter = ("answered_by",) - search_fields = ("body",) \ No newline at end of file + search_fields = ("body",) + + +@admin.register(Vote) +class VoteAdmin(admin.ModelAdmin): + list_display = ("title", "public_body", "date") + list_filter = ("public_body", "date") + search_fields = ("title", "description") \ No newline at end of file diff --git a/council/migrations/0002_vote.py b/council/migrations/0002_vote.py new file mode 100644 index 0000000..3cc8655 --- /dev/null +++ b/council/migrations/0002_vote.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.23 on 2025-08-21 07:44 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('council', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Vote', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=255)), + ('description', models.TextField(blank=True)), + ('date', models.DateField(blank=True, null=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('members', models.ManyToManyField(blank=True, related_name='votes', to='council.member')), + ('public_body', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='council.publicbody')), + ], + options={ + 'verbose_name': 'Abstimmung', + 'verbose_name_plural': 'Abstimmungen', + 'ordering': ['-date', '-created_at'], + }, + ), + ] diff --git a/council/migrations/__pycache__/0002_vote.cpython-312.pyc b/council/migrations/__pycache__/0002_vote.cpython-312.pyc new file mode 100644 index 0000000..bbef195 Binary files /dev/null and b/council/migrations/__pycache__/0002_vote.cpython-312.pyc differ diff --git a/db.sqlite3 b/db.sqlite3 index 1ac72c9..7ed9b0f 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/templates/council/member_detail.html b/templates/council/member_detail.html new file mode 100644 index 0000000..4d78d99 --- /dev/null +++ b/templates/council/member_detail.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} +{% block title %}{{ member }} – Stadträt:in{% endblock %} +{% block content %} +

{{ member.first_name }} {{ member.last_name }}

+

+ {% if member.public_body %}in {{ member.public_body.name }}{% endif %} + {% if member.party %} • {{ member.party }} (Profil){% endif %} +

+ +

Fragen an {{ member.first_name }}

+ + +

Abstimmungen (Beteiligung)

+ +{% endblock %} \ No newline at end of file diff --git a/templates/council/parties.html b/templates/council/parties.html index 26e08c9..6f9ea0f 100644 --- a/templates/council/parties.html +++ b/templates/council/parties.html @@ -11,7 +11,7 @@ {% if p.abbreviation %}({{ p.abbreviation }}){% endif %} - {% if p.color %}   {% endif %} + {% if p.color %}   {% endif %} {% empty %}
  • Keine Einträge.
  • diff --git a/templates/council/party_detail.html b/templates/council/party_detail.html new file mode 100644 index 0000000..975b1ac --- /dev/null +++ b/templates/council/party_detail.html @@ -0,0 +1,51 @@ +{% extends "base.html" %} +{% block title %}{{ party.name }} – Partei{% endblock %} +{% block content %} +

    {{ party.name }}

    +{% if party.abbreviation %}

    Kurz: {{ party.abbreviation }}

    {% endif %} + +

    Gemeinden

    + + +

    Stadträt:innen

    +
    + + + + + + + + + {% for m in members %} + + + + + {% empty %} + + {% endfor %} + +
    NameGemeinde
    {{ m.first_name }} {{ m.last_name }}{% if m.public_body %}{{ m.public_body.name }}{% else %}–{% endif %}
    Keine Mitglieder.
    +
    + +

    Fragen

    + +{% endblock %} \ No newline at end of file diff --git a/templates/council/public_body_detail.html b/templates/council/public_body_detail.html new file mode 100644 index 0000000..e88f372 --- /dev/null +++ b/templates/council/public_body_detail.html @@ -0,0 +1,56 @@ +{% extends "base.html" %} +{% block title %}{{ body.name }} – Gemeinde{% endblock %} +{% block content %} +

    {{ body.name }}

    +{% if body.website %}

    Webseite

    {% endif %} +{% if body.description %}

    {{ body.description }}

    {% endif %} + +

    Parteien in {{ body.name }}

    + + +

    Stadträt:innen

    +
    + + + + + + + + + {% for m in members %} + + + + + {% empty %} + + {% endfor %} + +
    NamePartei
    {{ m.first_name }} {{ m.last_name }}{% if m.party %}{{ m.party }}{% else %}–{% endif %}
    Keine Mitglieder.
    +
    + +

    Abstimmungen

    + +{% endblock %} \ No newline at end of file