105 lines
3.7 KiB
Twig
105 lines
3.7 KiB
Twig
{% extends 'admin/base.html.twig' %}
|
|
|
|
{% block title %}System Prompt{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
<h1 class="h4 mb-4">System Prompt</h1>
|
|
|
|
{% for message in app.flashes('success') %}
|
|
<div class="alert alert-success">{{ message }}</div>
|
|
{% endfor %}
|
|
{% for message in app.flashes('danger') %}
|
|
<div class="alert alert-danger">{{ message }}</div>
|
|
{% endfor %}
|
|
|
|
<div class="card bg-black text-info border-secondary mb-4">
|
|
<div class="card-body">
|
|
|
|
<form method="post">
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Kommentar (optional)</label>
|
|
<input type="text"
|
|
name="comment"
|
|
class="form-control bg-dark text-info border-secondary"
|
|
placeholder="Warum wurde der Prompt geändert?">
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Prompt Inhalt | Variablen: {% verbatim %}{% now %}{% endverbatim %} = Datum/Zeit</label>
|
|
<textarea name="content"
|
|
rows="16"
|
|
class="form-control bg-dark text-info border-secondary"
|
|
>{{ active ? active.content : '' }}</textarea>
|
|
</div>
|
|
|
|
<button class="btn btn-outline-light">
|
|
Neue Version speichern
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card bg-black text-info border-secondary">
|
|
<div class="card-body">
|
|
|
|
<h5>Versionen</h5>
|
|
|
|
<table class="table table-dark table-sm table-bordered align-middle">
|
|
<thead>
|
|
<tr>
|
|
<th>Version</th>
|
|
<th>Aktiv</th>
|
|
<th>Kommentar</th>
|
|
<th>Erstellt</th>
|
|
<th>Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in all %}
|
|
<tr>
|
|
<td>{{ p.version }}</td>
|
|
<td>
|
|
{% if p.active %}
|
|
<span class="badge bg-success">ACTIVE</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ p.comment ?? '-' }}</td>
|
|
<td>{{ p.createdAt|date('d.m.Y H:i:s') }}</td>
|
|
<td>
|
|
|
|
{% if not p.active %}
|
|
<form method="post"
|
|
action="{{ path('admin_system_prompt_activate', {id: p.id}) }}"
|
|
style="display:inline-block;">
|
|
<button class="btn btn-sm btn-outline-light">
|
|
Aktivieren
|
|
</button>
|
|
</form>
|
|
|
|
<form method="post"
|
|
action="{{ path('admin_system_prompt_delete', {id: p.id}) }}"
|
|
style="display:inline-block;"
|
|
onsubmit="return confirm('Version wirklich löschen?');">
|
|
<button class="btn btn-sm btn-outline-danger">
|
|
Löschen
|
|
</button>
|
|
</form>
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|