49 lines
2.0 KiB
HTML
49 lines
2.0 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Prompts{% endblock %}
|
||
{% block content %}
|
||
<h1>Prompts</h1>
|
||
{% include "_prompt_tabs.html" %}
|
||
<section class="card">
|
||
<h2>Aktiver Text <span class="badge ok">Version {{ active.version }}</span></h2>
|
||
<div class="promptbox">{{ active.text }}</div>
|
||
{% include "_prompt_notice.html" %}
|
||
{% if user.is_admin %}
|
||
<div class="actions">
|
||
<a href="/prompts/{{ prompt_name }}/edit">Aktiven Text als neuen Entwurf bearbeiten</a>
|
||
<a href="/prompts/{{ prompt_name }}/test">Testbereich</a>
|
||
</div>
|
||
{% endif %}
|
||
</section>
|
||
<section class="card">
|
||
<h2>Versionen</h2>
|
||
<p class="muted">Das Aktivieren einer älteren Version ist der Rollback. Neue Entwürfe werden erst mit "Aktivieren" wirksam.</p>
|
||
<div class="table-wrap">
|
||
<table>
|
||
<thead><tr><th>Version</th><th>Zeit</th><th>Von</th><th>Notiz</th><th>Text</th>{% if user.is_admin %}<th>Aktion</th>{% endif %}</tr></thead>
|
||
<tbody>
|
||
{% for v in history %}
|
||
<tr>
|
||
<td>{{ v.version }}{% if v.version == active.version %} <span class="badge ok">aktiv</span>{% endif %}</td>
|
||
<td>{{ v.created_at | fmt_ts }}</td>
|
||
<td>{{ v.created_by }}</td>
|
||
<td>{{ v.note or '–' }}</td>
|
||
<td><details><summary>anzeigen</summary><div class="promptbox">{{ v.text }}</div></details></td>
|
||
{% if user.is_admin %}
|
||
<td>
|
||
{% if v.version != active.version %}
|
||
<form method="post" action="/prompts/{{ prompt_name }}/versions/{{ v.version }}/activate" class="inline" data-confirm="Version {{ v.version }} aktivieren?">
|
||
{{ csrf_input }}<button type="submit">Aktivieren</button>
|
||
</form>
|
||
{% endif %}
|
||
<a href="/prompts/{{ prompt_name }}/edit?base={{ v.version }}">Als neuen Entwurf bearbeiten</a>
|
||
<a href="/prompts/{{ prompt_name }}/test?version={{ v.version }}">Testen</a>
|
||
</td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</section>
|
||
{% endblock %}
|