This commit is contained in:
Jonas Heinrich 2025-04-09 10:00:10 +02:00
parent abf6da60a8
commit c62c1b2c1b
6 changed files with 131 additions and 5 deletions

View file

@ -30,6 +30,7 @@
{% block css %} {% block css %}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
<style> <style>
.bd-placeholder-img { .bd-placeholder-img {
font-size: 1.125rem; font-size: 1.125rem;

View file

@ -5,6 +5,7 @@
{% load cms_tags %} {% load cms_tags %}
{% load follow_tags %} {% load follow_tags %}
{% load govplan %} {% load govplan %}
{% load form_helper %}
{% load content_helper %} {% load content_helper %}
{% load thumbnail %} {% load thumbnail %}
{% block title %} {% block title %}
@ -25,7 +26,7 @@
{% for cat in object.categories.all %} {% for cat in object.categories.all %}
<li> <li>
<a href="{{ section.get_absolute_url }}" <a href="{{ section.get_absolute_url }}"
class="badge text-bg-light text-decoration-none">{{ cat.name }}</a> class="badge text-bg-light text-decoration-none me-2">{{ cat.name }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
@ -174,7 +175,12 @@
aria-label="{% translate "Close" %}"></button> aria-label="{% translate "Close" %}"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<b>FIXME FORM SUBMIT</b>> <form method="post"
action="{% url 'govplan:propose_planupdate' gov=object.government.slug plan=object.slug %}">
{% csrf_token %}
{% render_form update_proposal_form %}
<button type="submit" class="btn btn-primary">Neue Entwicklung melden</button>
</form>
</div> </div>
</div> </div>
</div> </div>

View file

@ -13,7 +13,52 @@
<div class="album py-5"> <div class="album py-5">
<div style="margin-left: auto; max-width: 700px; margin-bottom: 1rem;">
<form method="get" action="/search/" class="ajaxified" data-container="#govplan-searchresult-275111" data-modalcontainer="#govplan-searchmodal-275111">
<div class="input-group">
<input type="text" name="q" class="form-control" aria-label="Suchbegriff" placeholder="Suchbegriff">
<select name="status" class="form-select" style="max-width: 300px;">
<option value="">Status filtern</option>
<option value="not_started">nicht begonnen</option>
<option value="started">begonnen</option>
<option value="partially_implemented">teilweise umgesetzt</option>
<option value="implemented">umgesetzt</option>
<option value="deferred">zurückgestellt</option>
</select>
<button class="btn btn-outline-secondary" type="submit">
Suchen
</button>
</div>
<input type="hidden" name="government" value="1"/>
</form>
<div class="modal fade" id="govplan-searchmodal-275111">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Suchergebnisse</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Schließen">
</button>
</div>
<div class="modal-body">
<div id="govplan-searchresult-275111"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3"> <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
{% for section in sections %} {% for section in sections %}
<div class="col"> <div class="col">
<a href="{{ section.get_absolute_url }}" class="text-decoration-none text-reset"> <a href="{{ section.get_absolute_url }}" class="text-decoration-none text-reset">

View file

@ -21,7 +21,7 @@
<h1 class="text-body-emphasis">{{ object.title }}</h1> <h1 class="text-body-emphasis">{{ object.title }}</h1>
<p class="fs-5 col-md-8"> <p class="fs-5 col-md-8">
{% blocktranslate with section=object.title %} {% blocktranslate with section=object.title %}
Here you can find all plans of the section “{{ section }}”, which the coalition constituted in their agreement. On the curresponding detail pages, you'll get more information, stay up to date with news or submit changes. Hier finden Sie alle Vorhaben aus dem Bereich „{{ section }}“, welche die Stadtverwaltung festgelegt hat. Auf den jeweiligen Detailseiten erhalten Sie mehr Informationen, können Neuigkeiten abonnieren oder Änderungen einreichen.
{% endblocktranslate %} {% endblocktranslate %}
</p> </p>
@ -37,7 +37,6 @@
<span class="text-nowrap me-1"><i class="fa fa-circle text-success"></i>&nbsp;umgesetzt</span> <span class="text-nowrap me-1"><i class="fa fa-circle text-success"></i>&nbsp;umgesetzt</span>
<span class="text-nowrap me-1"><i class="fa fa-circle text-danger"></i>&nbsp;verschoben</span> <span class="text-nowrap me-1"><i class="fa fa-circle text-danger"></i>&nbsp;verschoben</span>
</p> </p>
{% include "froide_govplan/plugins/time_used.html" with instance=object %}
</div> </div>
</div> </div>
</div> </div>

View file

@ -0,0 +1,58 @@
{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text required=field.field.required %}
{% if field_type == "radio" or is_checkboxmultiple %}
<fieldset class="row mb-3">
<legend class="fw-bold col-form-label col-md-4{% if required %} field-required{% endif %}">{{ label }}</legend>
<div class="col-md-8">
{% for widget in field %}<div class="form-check">{{ widget }}</div>{% endfor %}
{% if help_text %}<div class="form-text">{{ help_text }}</div>{% endif %}
{% if field.errors %}
<div class="invalid-feedback">{% include "helper/forms/errors.html" with errors=field.errors %}</div>
{% endif %}
</div>
</fieldset>
{% elif field_type == "checkbox" %}
<div class="mb-3 row{% if classes %} {{ classes }}{% endif %}">
<div class="col-md-8 offset-md-4">
<div class="form-check">
{{ field }}
<label class="form-check-label fw-bold {% if required %}field-required{% endif %}"
for="{{ field.id_for_label }}">{{ label }}</label>
{% if help_text %}<div class="form-text">{{ help_text }}</div>{% endif %}
{% if field.errors %}
<div class="invalid-feedback">{% include "helper/forms/errors.html" with errors=field.errors %}</div>
{% endif %}
</div>
</div>
</div>
{% elif label and not field.id_for_label %}
<fieldset class="mb-3 row{% if classes %} {{ classes }}{% endif %}{% if field.field.is_honeypot %} d-none honigtopf{% endif %}">
<legend class="fw-bold col-md-4 col-form-label{% if required %} field-required{% endif %}">{{ label }}</legend>
<div class="col-md-8">
{{ field }}
{% if help_text %}<div class="form-text">{{ help_text }}</div>{% endif %}
{% if field.errors %}
<div class="invalid-feedback">{% include "helper/forms/errors.html" with errors=field.errors %}</div>
{% endif %}
</div>
</fieldset>
{% else %}
<div class="mb-3 row{% if classes %} {{ classes }}{% endif %}{% if field.field.is_honeypot %} d-none honigtopf{% endif %}">
{% if label %}
{% if field.id_for_label %}
<label class="fw-bold col-md-4 col-form-label{% if required %} field-required{% endif %}"
for="{{ field.id_for_label }}">
{% endif %}
{{ label }}
{% if field.id_for_label %}</label>{% endif %}
{% endif %}
<div class="col-md-8">
{{ field }}
{% if help_text %}<div class="form-text">{{ help_text }}</div>{% endif %}
{% if field.errors %}
<div class="invalid-feedback">{% include "helper/forms/errors.html" with errors=field.errors %}</div>
{% endif %}
</div>
</div>
{% endif %}
{% endwith %}

View file

@ -0,0 +1,17 @@
{% load form_helper %}
{% if form.non_field_errors %}
<div class="alert alert-danger">
{% for error in form.non_field_errors %}
{{ error }}
{% if not forloop.last %}<br />{% endif %}
{% endfor %}
</div>
{% endif %}
{% for field in form.hidden_fields %}
{% include "helper/forms/errors.html" with errors=field.errors %}
{% endfor %}
{% for field in form.visible_fields %}
{% render_field field horizontal %}
{% endfor %}
{% for field in form.hidden_fields %}{{ field }}{% endfor %}