Add page editing and publish
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
{% extends 'shell.html.j2' %}
|
||||
{% block title %}Публикация — админка{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Публикация</h1>
|
||||
{% 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'>Релизов пока нет</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user