● Add categories and question duration; intern UI for category management
- gd/models.py: added Kategorie (name, sort_order), Frage.kategorien M2M, Frage.dauer_sekunden and property dauer_minuten - intern/forms.py: FrageForm extended with kategorien + dauer_sekunden; save() handles M2M and duration - intern/views.py + intern/urls.py: category CRUD (list/create/edit/delete) and sort (▲/▼) actions; assign sort_order for new categories - intern/templates/*: forms and templates updated (folge_form, kategorie_list, kategorie_edit, sidebar) - gd/views.py + gd/templates/gd/folge_detail.html: prefetch categories and display badges + approx. duration (≈ N min)
This commit is contained in:
1 parent
115cf72a81
commit
b8680f8e95
12 files changed
+381
-10
No files matched your search
@@ -200,6 +200,20 @@
|
||||
<div class="small text-muted mb-2">Eingereicht von: {{ f.einsender_display }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if f.kategorien.all or f.dauer_minuten %}
|
||||
<div class="mb-2 small">
|
||||
{% if f.kategorien.all %}
|
||||
{% for k in f.kategorien.all %}
|
||||
<span class="badge bg-secondary text-white me-1">{{ k.name }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if f.dauer_minuten %}
|
||||
<span class="text-muted ms-2">≈ {{ f.dauer_minuten|floatformat:0 }} min</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="bg-light p-3 rounded border-start border-success border-4">
|
||||
<strong class="text-success small d-block mb-1">ANTWORT:</strong>
|
||||
<p class="mb-2">{{ f.antwort.antwort_text }}</p>
|
||||
|
||||
Reference in new issue
Block a user