Initial commit: Crumbforest Architecture Refinement v1 (Clean)

This commit is contained in:
2025-12-07 01:26:46 +01:00
commit 6c38ed680b
633 changed files with 61797 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<tr id="row-{{post.id}}">
<td>{{ post.id }}</td>
<td>
<form hx-put="/{{ lang }}/admin/posts/{{ post.id }}" hx-target="#row-{{post.id}}" hx-swap="outerHTML">
<input type="text" name="title" value="{{ i18n.title }}" />
<input type="text" name="slug" value="{{ post.slug }}" />
<button type="submit">Save</button>
</form>
</td>
<td>
<form hx-post="/{{ lang }}/admin/posts/{{ post.id }}/publish" hx-target="#row-{{post.id}}" hx-swap="outerHTML">
<input type="hidden" name="is_published" value="{{ 1 if not post.is_published else 0 }}">
<button type="submit">{{ 'Unpublish' if post.is_published else 'Publish' }}</button>
</form>
</td>
<td><button hx-get="/{{ lang }}/admin/posts/{{ post.id }}/cancel" hx-target="#row-{{post.id}}" hx-swap="outerHTML">Cancel</button></td>
</tr>

View File

@@ -0,0 +1,16 @@
{% extends 'base.html' %}
{% block content %}
<h1>Edit: {{ post.title }}</h1>
<form method="post" action="/admin/posts/{{ post.id }}/edit">
<p><label>Titel <input name="title" value="{{ post.title }}" required></label></p>
<p><label>Slug <input name="slug" value="{{ post.slug }}" required></label></p>
<p><label>Locale
<select name="locale">
<option value="de" {{ 'selected' if post.locale=='de' else '' }}>de</option>
<option value="en" {{ 'selected' if post.locale=='en' else '' }}>en</option>
</select></label></p>
<p><label>Publiziert <input type="checkbox" name="is_published" value="1" {{ 'checked' if post.is_published else '' }}></label></p>
<p><label>Body (Markdown)<br><textarea name="body_md" rows="12" style="width:100%">{{ post.body_md or '' }}</textarea></label></p>
<p><button type="submit">Speichern</button></p>
</form>
{% endblock %}

View File

@@ -0,0 +1,21 @@
{% extends 'base.html' %}
{% block content %}
<h1>Posts</h1>
<p><a href="/admin/posts/new">Neuer Post</a></p>
<table border="1" cellpadding="6" cellspacing="0">
<tr>
<th>ID</th><th>Titel</th><th>Slug</th><th>Locale</th><th>Publiziert</th><th>Geändert</th><th></th>
</tr>
{% for p in posts %}
<tr>
<td>{{ p.id }}</td>
<td>{{ p.title }}</td>
<td>{{ p.slug }}</td>
<td>{{ p.locale }}</td>
<td>{{ 'yes' if p.is_published else 'no' }}</td>
<td>{{ p.updated_at or '' }}</td>
<td><a href="/admin/posts/{{ p.id }}/edit">Edit</a></td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@@ -0,0 +1,16 @@
{% extends 'base.html' %}
{% block content %}
<h1>Neuer Post</h1>
<form method="post" action="/admin/posts/new">
<p><label>Titel <input name="title" required></label></p>
<p><label>Slug <input name="slug" required></label></p>
<p><label>Locale
<select name="locale">
<option value="de">de</option>
<option value="en">en</option>
</select></label></p>
<p><label>Publiziert <input type="checkbox" name="is_published" value="1"></label></p>
<p><label>Body (Markdown)<br><textarea name="body_md" rows="10" style="width:100%"></textarea></label></p>
<p><button type="submit">Speichern</button></p>
</form>
{% endblock %}