generated from coulomb/repo-seed
89 lines
3.9 KiB
HTML
89 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Preisauswertung — {{ ausschreibung.titel }}{% endblock %}
|
|
{% block content %}
|
|
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h1 class="page-title">Preisauswertung</h1>
|
|
<a href="{% url 'ausschreibungen:preise:liste' ausschreibung.pk %}" class="btn-ghost text-xs">← Preise</a>
|
|
</div>
|
|
|
|
<form method="get" class="card mb-4 flex flex-wrap gap-3 items-end">
|
|
<div>
|
|
<label class="form-label">Leistungstyp</label>
|
|
<input type="text" name="leistungstyp" value="{{ leistungstyp }}" list="lt-list" class="form-input">
|
|
<datalist id="lt-list">{% for lt in alle_leistungstypen %}<option value="{{ lt }}">{% endfor %}</datalist>
|
|
</div>
|
|
<div>
|
|
<label class="form-label">Gewonnen</label>
|
|
<select name="gewonnen" class="form-select">
|
|
<option value="">Alle</option>
|
|
<option value="ja" {% if filter_gewonnen == 'ja' %}selected{% endif %}>Ja</option>
|
|
<option value="nein" {% if filter_gewonnen == 'nein' %}selected{% endif %}>Nein</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="btn-secondary text-xs">Auswerten</button>
|
|
</form>
|
|
|
|
{% if ergebnis %}
|
|
<div class="grid grid-cols-3 gap-3 mb-6">
|
|
<div class="card text-center">
|
|
<p class="text-xs text-slate-500 mb-1">Gewichteter Durchschnitt</p>
|
|
<p class="text-2xl font-bold text-blue-700">{{ ergebnis.wert|floatformat:2 }}</p>
|
|
</div>
|
|
<div class="card text-center">
|
|
<p class="text-xs text-slate-500 mb-1">Ungewichteter Durchschnitt</p>
|
|
<p class="text-2xl font-bold text-slate-700">{% if ungewichtet %}{{ ungewichtet|floatformat:2 }}{% else %}—{% endif %}</p>
|
|
</div>
|
|
<div class="card text-center">
|
|
<p class="text-xs text-slate-500 mb-1">Messpunkte / Summe Gewichte</p>
|
|
<p class="text-2xl font-bold text-slate-700">{{ ergebnis.anzahl }} / {{ ergebnis.summe_gewichte }}</p>
|
|
</div>
|
|
<div class="card text-center">
|
|
<p class="text-xs text-slate-500 mb-1">Minimum</p>
|
|
<p class="text-xl font-semibold text-green-700">{{ ergebnis.minimum|floatformat:2 }}</p>
|
|
</div>
|
|
<div class="card text-center">
|
|
<p class="text-xs text-slate-500 mb-1">Maximum</p>
|
|
<p class="text-xl font-semibold text-red-700">{{ ergebnis.maximum|floatformat:2 }}</p>
|
|
</div>
|
|
</div>
|
|
{% elif leistungstyp %}
|
|
<div class="card text-center py-6 text-sm text-slate-500 mb-6">Keine Daten für "{{ leistungstyp }}".</div>
|
|
{% else %}
|
|
<div class="card text-center py-6 text-sm text-slate-500 mb-6">Leistungstyp eingeben, um Auswertung zu starten.</div>
|
|
{% endif %}
|
|
|
|
{% if preispunkte %}
|
|
<div class="card overflow-hidden">
|
|
<p class="text-xs font-medium text-slate-500 uppercase tracking-wide mb-3">Einzelmesspunkte</p>
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-slate-200 text-left text-xs text-slate-500">
|
|
<th class="pb-2 pr-3">Ausschreibung</th>
|
|
<th class="pb-2 pr-3">Leistung</th>
|
|
<th class="pb-2 pr-3 text-right">Einzelpreis</th>
|
|
<th class="pb-2 pr-3 text-center">Gewicht</th>
|
|
<th class="pb-2 text-center">Gewonnen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-100">
|
|
{% for pp in preispunkte %}
|
|
<tr class="hover:bg-slate-50">
|
|
<td class="py-2 pr-3 text-xs text-slate-600">{{ pp.ausschreibung.titel|truncatechars:30 }}</td>
|
|
<td class="py-2 pr-3 text-xs">{{ pp.konkrete_leistung }}</td>
|
|
<td class="py-2 pr-3 text-right text-xs">{{ pp.einzelpreis|floatformat:2 }} {{ pp.waehrung }}</td>
|
|
<td class="py-2 pr-3 text-center text-xs">{{ pp.vergleichsgewicht }}</td>
|
|
<td class="py-2 text-center text-xs">
|
|
{% if pp.ausschreibung_gewonnen == True %}<span class="text-green-600">✓</span>
|
|
{% elif pp.ausschreibung_gewonnen == False %}<span class="text-red-500">✗</span>
|
|
{% else %}<span class="text-slate-400">?</span>{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|