This commit is contained in:
Priec
2026-05-17 15:16:51 +02:00
parent 27887bf664
commit 622afc310d
16 changed files with 617 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
{% extends "admin/base.html" %}
{% block title %}Edit Article{% endblock title %}
{% block content %}
<h1>Edit Article</h1>
<form method="post" action="/admin/blog/articles/{{ article.id }}">
<label>
Title
<input type="text" name="title" value="{{ article.title }}" required>
</label>
<label>
Excerpt
<textarea name="excerpt" rows="4">{% if article.excerpt %}{{ article.excerpt }}{% endif %}</textarea>
</label>
<label>
Content
<textarea name="content" rows="18" required>{{ article.content }}</textarea>
</label>
<label>
Featured image id
<input type="text" name="featured_image_id" value="{% if article.featured_image_id %}{{ article.featured_image_id }}{% endif %}">
</label>
<label>
<input type="checkbox" name="published" {% if article.published %}checked{% endif %}>
Published
</label>
<button type="submit">Save</button>
</form>
{% endblock content %}

View File

@@ -0,0 +1,36 @@
{% extends "admin/base.html" %}
{% block title %}Blog Articles{% endblock title %}
{% block content %}
<h1>Blog Articles</h1>
<p><a href="/admin/blog/articles/new">New article</a></p>
{% if articles | length > 0 %}
<table>
<thead>
<tr>
<th>Title</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for article in articles %}
<tr>
<td>{{ article.title }}</td>
<td>{% if article.published %}Published{% else %}Draft{% endif %}</td>
<td>
<a href="/admin/blog/articles/{{ article.id }}/edit">Edit</a>
<form method="post" action="/admin/blog/articles/{{ article.id }}/delete">
<button type="submit">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No articles yet.</p>
{% endif %}
{% endblock content %}

View File

@@ -0,0 +1,31 @@
{% extends "admin/base.html" %}
{% block title %}New Article{% endblock title %}
{% block content %}
<h1>New Article</h1>
<form method="post" action="/admin/blog/articles">
<label>
Title
<input type="text" name="title" required>
</label>
<label>
Excerpt
<textarea name="excerpt" rows="4"></textarea>
</label>
<label>
Content
<textarea name="content" rows="18" required></textarea>
</label>
<label>
Featured image id
<input type="text" name="featured_image_id">
</label>
<label>
<input type="checkbox" name="published">
Published
</label>
<button type="submit">Create</button>
</form>
{% endblock content %}