Return structured JSON errors with request IDs, log unexpected exceptions with tracebacks, and show HTTP and network failures in the admin UI without losing unsaved source. Preserve publication errors when release listing also fails, handle cancelled preview promises, and add regression tests, browser failure scenarios, and updated API documentation.
34 lines
2.0 KiB
Django/Jinja
34 lines
2.0 KiB
Django/Jinja
{% extends 'shell.html.j2' %}
|
||
{% block title %}Публикация — админка{% endblock %}
|
||
{% block content %}
|
||
<h1>Публикация</h1>
|
||
{% if error|default(none) %}<ul class='issues' role='alert'><li class='error'>{{ error.message }}<br>Код: <code>{{ error.code }}</code> · ID запроса: <code>{{ error.request_id }}</code></li></ul>{% endif %}
|
||
{% if issues %}
|
||
<h2>Проблемы сборки</h2>
|
||
<ul class='issues'>{% for i in issues %}<li class='{{ i.severity }}'><code>{{ i.code }}</code> {{ i.path }} {{ i.message }}</li>{% endfor %}</ul>
|
||
{% endif %}
|
||
<p>Сейчас на сайте: {% if current %}<code>{{ current }}</code>{% else %}ничего не опубликовано{% endif %}</p>
|
||
<form method='post' action='/admin/publish'>
|
||
<input type='hidden' name='csrf' value='{{ csrf }}'>
|
||
<button type='submit'>Опубликовать текущий черновик сайта</button>
|
||
</form>
|
||
<p class='muted'>В релиз попадают только страницы и записи со статусом published. Если сборка не пройдёт проверку, опубликованный сайт не изменится.</p>
|
||
<h2>Релизы</h2>
|
||
<table>
|
||
<thead><tr><th>Релиз</th><th></th></tr></thead>
|
||
<tbody>
|
||
{% for b in builds %}
|
||
<tr>
|
||
<td><code>{{ b.id }}</code>{% if b.current %} <span class='status status-published'>текущий</span>{% endif %}</td>
|
||
<td>{% if not b.current %}
|
||
<form method='post' action='/admin/publish/rollback/{{ b.id }}' class='inline-form'>
|
||
<input type='hidden' name='csrf' value='{{ csrf }}'><button type='submit' class='small'>Вернуть этот релиз</button>
|
||
</form>{% endif %}</td>
|
||
</tr>
|
||
{% else %}
|
||
<tr><td colspan='2'>{% if releases_unavailable|default(false) %}Список релизов недоступен. Обновите страницу после устранения ошибки.{% else %}Релизов пока нет{% endif %}</td></tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% endblock %}
|