feat(publisher): add wordpress draft queue with retry and admin controls

This commit is contained in:
Oliver 2026-02-18 10:49:43 +01:00
parent dcdf4d954a
commit 1cee56205e
13 changed files with 719 additions and 3 deletions

View file

@ -21,6 +21,12 @@
</header>
<main class="container">
{% if flash_msg %}
<section class="card flash {{ 'flash-error' if flash_type == 'error' else 'flash-success' }}">
{{ flash_msg }}
</section>
{% endif %}
<section class="card">
<h2>{{ article.title }}</h2>
<div class="detail-grid">
@ -39,6 +45,16 @@
{% if article.summary %}
<p><strong>Summary:</strong> {{ article.summary }}</p>
{% endif %}
<p><strong>WordPress Post:</strong>
{% if article.wp_post_url %}
<a href="{{ article.wp_post_url }}" target="_blank" rel="noopener">#{{ article.wp_post_id }}</a>
{% elif article.wp_post_id %}
#{{ article.wp_post_id }}
{% else %}
-
{% endif %}
</p>
<p><strong>Publish Attempts:</strong> {{ article.publish_attempts or 0 }} | <strong>Letzter Fehler:</strong> {{ article.publish_last_error or "-" }}</p>
</section>
<section class="card">
@ -184,6 +200,15 @@
<button type="submit" class="secondary">Setzen</button>
</form>
</section>
<section class="card">
<h2>WordPress Publish Queue</h2>
<p class="subtle">Voraussetzungen: Status `approved`, Rechtsfreigabe aktiv, Hauptbild gesetzt.</p>
<form method="post" action="/admin/articles/{{ article.id }}/publish-enqueue" class="row">
<input name="max_attempts" value="3" />
<button type="submit">In Queue einreihen</button>
</form>
</section>
</main>
</body>
</html>

View file

@ -91,6 +91,14 @@
</form>
</section>
<section class="card">
<h2>Publisher ausführen</h2>
<form method="post" action="/admin/publisher/run" class="row">
<input name="max_jobs" value="10" />
<button type="submit">Publisher Run starten</button>
</form>
</section>
<section class="card">
<h2>Quellen + Policy</h2>
<table>
@ -239,6 +247,35 @@
</tbody>
</table>
</section>
<section class="card">
<h2>Publish Jobs</h2>
<table>
<thead>
<tr><th>ID</th><th>Artikel</th><th>Status</th><th>Attempts</th><th>WP Post</th><th>Fehler</th></tr>
</thead>
<tbody>
{% for j in publish_jobs %}
<tr>
<td>{{ j.id }}</td>
<td>#{{ j.article_id }} {{ j.article_title or "-" }}</td>
<td>{{ j.status }}</td>
<td>{{ j.attempts }}/{{ j.max_attempts }}</td>
<td>
{% if j.wp_post_url %}
<a href="{{ j.wp_post_url }}" target="_blank" rel="noopener">#{{ j.wp_post_id }}</a>
{% elif j.wp_post_id %}
#{{ j.wp_post_id }}
{% else %}
-
{% endif %}
</td>
<td>{{ j.error_message or "-" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
</main>
</body>
</html>