Unterstützung für Lose

This commit is contained in:
tegwick 2026-05-14 02:57:27 +02:00
parent e4eb5bc368
commit f6af101933
8 changed files with 105 additions and 1 deletions

View file

@ -100,6 +100,41 @@
</div>
{% endif %}
<!-- Lose -->
<div class="card mt-6">
<div class="flex items-center justify-between mb-3">
<h2 class="text-sm font-semibold text-slate-700">Lose</h2>
<button class="btn-ghost text-xs"
hx-get="{% url 'ausschreibungen:lose:neu' ausschreibung.pk %}"
hx-target="#lose-form-container"
hx-swap="innerHTML">
+ Los hinzufügen
</button>
</div>
<div id="lose-form-container"></div>
{% if lose %}
<table class="w-full text-sm mt-1">
<thead>
<tr class="border-b border-slate-200 text-left text-xs text-slate-500">
<th class="pb-2 pr-4">Nr.</th>
<th class="pb-2 pr-4">Titel</th>
<th class="pb-2 pr-4">Aufgaben</th>
<th class="pb-2 pr-4">Teilnahme</th>
<th class="pb-2"></th>
</tr>
</thead>
<tbody id="lose-tbody" class="divide-y divide-slate-100">
{% for los in lose %}
{% include "lose/partials/los_row.html" %}
{% endfor %}
</tbody>
</table>
{% else %}
<div id="lose-tbody"></div>
<p class="text-sm text-slate-400 mt-1">Noch keine Lose angelegt.</p>
{% endif %}
</div>
<div class="flex gap-3 mt-6">
<a href="{% url 'ausschreibungen:entscheidung' ausschreibung.pk %}" class="btn-ghost text-xs">
Teilnahmeentscheidung

View file

@ -31,6 +31,10 @@
{{ form.rechtsgrundlage }}
</div>
</div>
<div>
<label class="form-label">Rechtsgrundlage — Details</label>
{{ form.rechtsgrundlage_details }}
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="form-label">Vergabeplattform</label>

View file

@ -0,0 +1,27 @@
<form hx-post="{% url 'ausschreibungen:lose:neu' ausschreibung.pk %}"
hx-target="#lose-tbody"
hx-swap="afterbegin"
hx-on::after-request="if(event.detail.successful) this.reset(); document.getElementById('lose-form-container').innerHTML = '';"
class="bg-slate-50 border border-slate-200 rounded p-3 mt-2">
{% csrf_token %}
<div class="flex gap-2 items-end flex-wrap">
<div class="flex-none w-20">
<label class="form-label">Nr.</label>
{{ form.losnummer }}
</div>
<div class="flex-1 min-w-40">
<label class="form-label">Titel *</label>
{{ form.lostitel }}
</div>
<div class="flex gap-2 shrink-0">
<button type="submit" class="btn-primary text-xs">Speichern</button>
<button type="button" class="btn-ghost text-xs"
onclick="document.getElementById('lose-form-container').innerHTML = ''">Abbrechen</button>
</div>
</div>
{% if form.losnummer.errors or form.lostitel.errors %}
<p class="text-red-600 text-xs mt-1">
{{ form.losnummer.errors.0 }}{{ form.lostitel.errors.0 }}
</p>
{% endif %}
</form>