initial commit
This commit is contained in:
124
app/templates/dashboard.html
Normal file
124
app/templates/dashboard.html
Normal file
@@ -0,0 +1,124 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section class="card">
|
||||
<h2>Newsletter erstellen</h2>
|
||||
<form method="post" action="/dashboard" class="form-grid">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<label>Zeitraum (Tage)
|
||||
<input type="number" name="days" min="1" max="90" value="{{ filters.days }}">
|
||||
</label>
|
||||
<label>Kategorie (optional)
|
||||
<input type="text" name="category" value="{{ filters.category }}">
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="only_edited" value="true" {% if filters.only_edited %}checked{% endif %}>
|
||||
Nur bearbeitete Artikel (keine neu erstellten)
|
||||
</label>
|
||||
{% if user.role in ["admin", "editor"] %}
|
||||
<button type="submit">Newsletter generieren</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% if user.role == "admin" %}
|
||||
<p><a href="/admin/users">Zur Benutzerverwaltung</a></p>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
{% if user.role in ["admin", "editor"] %}
|
||||
<section class="card">
|
||||
<h3>Optionaler SMTP-Versand</h3>
|
||||
<form method="post" action="/newsletter/send-now" class="form-grid">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<input type="hidden" name="days" value="{{ filters.days }}">
|
||||
<input type="hidden" name="category" value="{{ filters.category }}">
|
||||
<input type="hidden" name="only_edited" value="{{ 'true' if filters.only_edited else 'false' }}">
|
||||
<button type="submit">Newsletter jetzt senden</button>
|
||||
</form>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if user.role == "admin" %}
|
||||
<section class="card">
|
||||
<h3>SMTP-Konfiguration (optional)</h3>
|
||||
<form method="post" action="/admin/smtp" class="form-grid">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="enabled" value="true" {% if smtp.enabled == "true" %}checked{% endif %}>
|
||||
SMTP Versand aktivieren
|
||||
</label>
|
||||
<label>SMTP Host
|
||||
<input type="text" name="host" value="{{ smtp.host }}">
|
||||
</label>
|
||||
<label>SMTP Port
|
||||
<input type="number" name="port" value="{{ smtp.port }}">
|
||||
</label>
|
||||
<label>Benutzername
|
||||
<input type="text" name="username" value="{{ smtp.username }}">
|
||||
</label>
|
||||
<label>Passwort
|
||||
<input type="password" name="password" value="{{ smtp.password }}">
|
||||
</label>
|
||||
<label>Absender E-Mail
|
||||
<input type="email" name="from_email" value="{{ smtp.from_email }}">
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="use_tls" value="true" {% if smtp.use_tls == "true" %}checked{% endif %}>
|
||||
STARTTLS verwenden
|
||||
</label>
|
||||
<label>Verteilerliste (Komma-separiert)
|
||||
<textarea rows="3" name="recipients">{{ smtp.recipients }}</textarea>
|
||||
</label>
|
||||
<label>Geplanter täglicher Versand (HH:MM)
|
||||
<input type="time" name="schedule_time" value="{{ smtp.schedule_time }}">
|
||||
</label>
|
||||
<button type="submit">SMTP Einstellungen speichern</button>
|
||||
</form>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<section class="card">
|
||||
<h3>Output: Outlook Text</h3>
|
||||
<textarea rows="14" readonly>{{ plain_text }}</textarea>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Output: Raw HTML</h3>
|
||||
<textarea rows="14" readonly>{{ raw_html }}</textarea>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Gefundene Artikel ({{ articles|length }})</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Titel</th><th>Zeit</th><th>Benutzer</th><th>Kategorien</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in articles %}
|
||||
<tr>
|
||||
<td>{{ item.title }}</td>
|
||||
<td>{{ item.timestamp }}</td>
|
||||
<td>{{ item.user }}</td>
|
||||
<td>{{ item.categories|join(", ") }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h3>Versandprotokoll (letzte 20)</h3>
|
||||
<table>
|
||||
<thead><tr><th>Zeit</th><th>Status</th><th>Betreff</th><th>Empfänger</th><th>Details</th></tr></thead>
|
||||
<tbody>
|
||||
{% for log in send_logs %}
|
||||
<tr>
|
||||
<td>{{ log.created_at }}</td>
|
||||
<td>{{ log.status }}</td>
|
||||
<td>{{ log.subject }}</td>
|
||||
<td>{{ log.recipients }}</td>
|
||||
<td>{{ log.detail }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user