some simple UI to make it work
This commit is contained in:
@@ -3,17 +3,34 @@
|
|||||||
{% block title %}Edit About{% endblock title %}
|
{% block title %}Edit About{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Edit About</h1>
|
<div class="space-y-2">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">Edit About</h1>
|
||||||
|
<p class="text-sm opacity-70">Update the public about page.</p>
|
||||||
|
</div>
|
||||||
|
<a href="/about" class="btn btn-ghost btn-sm">View page</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form method="post" action="/admin/about">
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
<label>
|
<div class="card-body">
|
||||||
Title
|
<form method="post" action="/admin/about" class="space-y-2">
|
||||||
<input type="text" name="title" value="{{ page.title }}" required>
|
<div class="form-control">
|
||||||
</label>
|
<label class="label"><span class="label-text">Title</span></label>
|
||||||
<label>
|
<input type="text" name="title" value="{{ page.title }}" required class="input input-bordered w-full">
|
||||||
Content
|
</div>
|
||||||
<textarea name="content" rows="16" required>{{ page.content }}</textarea>
|
|
||||||
</label>
|
<div class="form-control">
|
||||||
<button type="submit">Save</button>
|
<label class="label"><span class="label-text">Content</span></label>
|
||||||
|
<textarea name="content" rows="16" required class="textarea textarea-bordered w-full">{{ page.content }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap gap-2 pt-2">
|
||||||
|
<button type="submit" class="btn btn-neutral btn-sm">Save</button>
|
||||||
|
<a href="/admin/dashboard" class="btn btn-ghost btn-sm">Cancel</a>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
||||||
<style>
|
<style>
|
||||||
.btn { --animation-btn: 0; --btn-focus-scale: 1; }
|
.btn { --animation-btn: 0; --btn-focus-scale: 1; }
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.nav-menu { flex-direction: row; }
|
||||||
|
}
|
||||||
#nav-backdrop { display: none; }
|
#nav-backdrop { display: none; }
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
#nav-backdrop {
|
#nav-backdrop {
|
||||||
@@ -59,15 +62,17 @@
|
|||||||
<header class="navbar bg-base-100 shadow-sm">
|
<header class="navbar bg-base-100 shadow-sm">
|
||||||
<nav class="mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4">
|
<nav class="mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4">
|
||||||
<a href="/admin/dashboard" class="min-w-0 truncate text-lg font-bold">Admin</a>
|
<a href="/admin/dashboard" class="min-w-0 truncate text-lg font-bold">Admin</a>
|
||||||
<div class="hidden items-center gap-1 md:flex">
|
<ul class="nav-menu menu menu-sm hidden items-center gap-1 md:flex">
|
||||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm">Dashboard</a>
|
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Blog</a>
|
<li><a href="/admin/blog/articles">Blog</a></li>
|
||||||
<a href="/admin/about" class="btn btn-ghost btn-sm">About</a>
|
<li><a href="/admin/about">About</a></li>
|
||||||
<a href="/" class="btn btn-ghost btn-sm">View site</a>
|
<li><a href="/">View site</a></li>
|
||||||
|
<li>
|
||||||
<form method="post" action="/admin/logout">
|
<form method="post" action="/admin/logout">
|
||||||
<button type="submit" class="btn btn-ghost btn-sm">Logout</button>
|
<button type="submit" class="w-full">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</li>
|
||||||
|
</ul>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<div class="dropdown dropdown-end md:hidden">
|
<div class="dropdown dropdown-end md:hidden">
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Menu">
|
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Menu">
|
||||||
@@ -76,16 +81,18 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div tabindex="0"
|
<ul tabindex="0"
|
||||||
class="dropdown-content z-50 mt-3 flex w-52 flex-col gap-1 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
class="menu dropdown-content z-50 mt-3 w-52 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm justify-start">Dashboard</a>
|
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||||
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm justify-start">Blog</a>
|
<li><a href="/admin/blog/articles">Blog</a></li>
|
||||||
<a href="/admin/about" class="btn btn-ghost btn-sm justify-start">About</a>
|
<li><a href="/admin/about">About</a></li>
|
||||||
<a href="/" class="btn btn-ghost btn-sm justify-start">View site</a>
|
<li><a href="/">View site</a></li>
|
||||||
|
<li>
|
||||||
<form method="post" action="/admin/logout">
|
<form method="post" action="/admin/logout">
|
||||||
<button type="submit" class="btn btn-ghost btn-sm w-full justify-start">Logout</button>
|
<button type="submit" class="w-full">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Settings" title="Settings">
|
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Settings" title="Settings">
|
||||||
|
|||||||
@@ -3,34 +3,61 @@
|
|||||||
{% block title %}Blog Articles{% endblock title %}
|
{% block title %}Blog Articles{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Blog Articles</h1>
|
<div class="space-y-2">
|
||||||
<p><a href="/admin/blog/articles/new">New article</a></p>
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">Blog Articles</h1>
|
||||||
|
<p class="text-sm opacity-70">Create, edit, and remove blog posts.</p>
|
||||||
|
</div>
|
||||||
|
<a href="/admin/blog/articles/new" class="btn btn-neutral btn-sm">New article</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body">
|
||||||
{% if articles | length > 0 %}
|
{% if articles | length > 0 %}
|
||||||
<table>
|
<div class="overflow-x-auto">
|
||||||
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Actions</th>
|
<th class="text-right">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ article.title }}</td>
|
<td class="font-medium">{{ article.title }}</td>
|
||||||
<td>{% if article.published %}Published{% else %}Draft{% endif %}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<a href="/admin/blog/articles/{{ article.id }}/edit">Edit</a>
|
{% if article.published %}
|
||||||
|
<span class="badge">Published</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge opacity-70">Draft</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<a href="/admin/blog/articles/{{ article.id }}/edit" class="btn btn-ghost btn-sm">Edit</a>
|
||||||
<form method="post" action="/admin/blog/articles/{{ article.id }}/delete">
|
<form method="post" action="/admin/blog/articles/{{ article.id }}/delete">
|
||||||
<button type="submit">Delete</button>
|
<button type="submit" class="btn btn-ghost btn-sm">Delete</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No articles yet.</p>
|
<div class="text-center">
|
||||||
|
<p class="font-medium">No articles yet.</p>
|
||||||
|
<p class="text-sm opacity-70">Create the first blog post.</p>
|
||||||
|
<div class="pt-2">
|
||||||
|
<a href="/admin/blog/articles/new" class="btn btn-neutral btn-sm">New article</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -3,29 +3,49 @@
|
|||||||
{% block title %}New Article{% endblock title %}
|
{% block title %}New Article{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>New Article</h1>
|
<div class="space-y-2">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">New Article</h1>
|
||||||
|
<p class="text-sm opacity-70">Create a blog post for the public site.</p>
|
||||||
|
</div>
|
||||||
|
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Back to articles</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form method="post" action="/admin/blog/articles">
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
<label>
|
<div class="card-body">
|
||||||
Title
|
<form method="post" action="/admin/blog/articles" class="space-y-2">
|
||||||
<input type="text" name="title" required>
|
<div class="form-control">
|
||||||
|
<label class="label"><span class="label-text">Title</span></label>
|
||||||
|
<input type="text" name="title" required class="input input-bordered w-full">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-control">
|
||||||
|
<label class="label"><span class="label-text">Excerpt</span></label>
|
||||||
|
<textarea name="excerpt" rows="4" class="textarea textarea-bordered w-full"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-control">
|
||||||
|
<label class="label"><span class="label-text">Content</span></label>
|
||||||
|
<textarea name="content" rows="18" required class="textarea textarea-bordered w-full"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-control">
|
||||||
|
<label class="label"><span class="label-text">Featured image id</span></label>
|
||||||
|
<input type="text" name="featured_image_id" class="input input-bordered w-full">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class="label cursor-pointer justify-start gap-2">
|
||||||
|
<input type="checkbox" name="published" class="checkbox checkbox-sm">
|
||||||
|
<span class="label-text">Published</span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
|
||||||
Excerpt
|
<div class="flex flex-wrap gap-2 pt-2">
|
||||||
<textarea name="excerpt" rows="4"></textarea>
|
<button type="submit" class="btn btn-neutral btn-sm">Create</button>
|
||||||
</label>
|
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Cancel</a>
|
||||||
<label>
|
</div>
|
||||||
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>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -3,11 +3,41 @@
|
|||||||
{% block title %}Admin{% endblock title %}
|
{% block title %}Admin{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Admin</h1>
|
<div class="space-y-2">
|
||||||
<p>Logged in as {{ admin.email }}</p>
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">Dashboard</h1>
|
||||||
|
<p class="text-sm opacity-70">Logged in as {{ admin.email }}</p>
|
||||||
|
</div>
|
||||||
|
<a href="/" class="btn btn-ghost btn-sm">View site</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul>
|
<div class="grid grid-cols-2 gap-4 pt-4">
|
||||||
<li><a href="/admin/blog/articles">Manage blog articles</a></li>
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
<li><a href="/admin/about">Edit about page</a></li>
|
<div class="card-body">
|
||||||
</ul>
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<h2 class="card-title text-base">Blog</h2>
|
||||||
|
<span class="badge">Content</span>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm opacity-70">Create and update blog articles.</p>
|
||||||
|
<div class="pt-2">
|
||||||
|
<a href="/admin/blog/articles" class="btn btn-neutral btn-sm">Manage blog</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<h2 class="card-title text-base">About page</h2>
|
||||||
|
<span class="badge">Page</span>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm opacity-70">Edit the public about page content.</p>
|
||||||
|
<div class="pt-2">
|
||||||
|
<a href="/admin/about" class="btn btn-neutral btn-sm">Edit about</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
||||||
<style>
|
<style>
|
||||||
.btn { --animation-btn: 0; --btn-focus-scale: 1; }
|
.btn { --animation-btn: 0; --btn-focus-scale: 1; }
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.nav-menu { flex-direction: row; }
|
||||||
|
}
|
||||||
#nav-backdrop { display: none; }
|
#nav-backdrop { display: none; }
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
#nav-backdrop {
|
#nav-backdrop {
|
||||||
@@ -59,19 +62,21 @@
|
|||||||
<header class="navbar bg-base-100 shadow-sm">
|
<header class="navbar bg-base-100 shadow-sm">
|
||||||
<nav class="mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4">
|
<nav class="mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4">
|
||||||
<a href="/" class="min-w-0 truncate text-lg font-bold">Universal Web</a>
|
<a href="/" class="min-w-0 truncate text-lg font-bold">Universal Web</a>
|
||||||
<div class="hidden items-center gap-1 md:flex">
|
<ul class="nav-menu menu menu-sm hidden items-center gap-1 md:flex">
|
||||||
<a href="/" class="btn btn-ghost btn-sm">Home</a>
|
<li><a href="/">Home</a></li>
|
||||||
<a href="/about" class="btn btn-ghost btn-sm">About</a>
|
<li><a href="/about">About</a></li>
|
||||||
<a href="/blog" class="btn btn-ghost btn-sm">Blog</a>
|
<li><a href="/blog">Blog</a></li>
|
||||||
{% if logged_in_admin %}
|
{% if logged_in_admin %}
|
||||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm">Dashboard</a>
|
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||||
|
<li>
|
||||||
<form method="post" action="/admin/logout">
|
<form method="post" action="/admin/logout">
|
||||||
<button type="submit" class="btn btn-ghost btn-sm">Logout</button>
|
<button type="submit" class="w-full">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="/admin/login" class="btn btn-ghost btn-sm">Admin</a>
|
<li><a href="/admin/login">Admin</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</ul>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<div class="dropdown dropdown-end md:hidden">
|
<div class="dropdown dropdown-end md:hidden">
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Menu">
|
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Menu">
|
||||||
@@ -80,20 +85,22 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div tabindex="0"
|
<ul tabindex="0"
|
||||||
class="dropdown-content z-50 mt-3 flex w-52 flex-col gap-1 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
class="menu dropdown-content z-50 mt-3 w-52 rounded-box border border-base-300 bg-base-100 p-2 shadow-lg">
|
||||||
<a href="/" class="btn btn-ghost btn-sm justify-start">Home</a>
|
<li><a href="/">Home</a></li>
|
||||||
<a href="/about" class="btn btn-ghost btn-sm justify-start">About</a>
|
<li><a href="/about">About</a></li>
|
||||||
<a href="/blog" class="btn btn-ghost btn-sm justify-start">Blog</a>
|
<li><a href="/blog">Blog</a></li>
|
||||||
{% if logged_in_admin %}
|
{% if logged_in_admin %}
|
||||||
<a href="/admin/dashboard" class="btn btn-ghost btn-sm justify-start">Dashboard</a>
|
<li><a href="/admin/dashboard">Dashboard</a></li>
|
||||||
|
<li>
|
||||||
<form method="post" action="/admin/logout">
|
<form method="post" action="/admin/logout">
|
||||||
<button type="submit" class="btn btn-ghost btn-sm w-full justify-start">Logout</button>
|
<button type="submit" class="w-full">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="/admin/login" class="btn btn-ghost btn-sm justify-start">Admin</a>
|
<li><a href="/admin/login">Admin</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Settings" title="Settings">
|
<div tabindex="0" role="button" class="btn btn-ghost btn-sm btn-circle" aria-label="Settings" title="Settings">
|
||||||
|
|||||||
@@ -3,18 +3,45 @@
|
|||||||
{% block title %}Blog{% endblock title %}
|
{% block title %}Blog{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Blog</h1>
|
<div class="space-y-2">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">Blog</h1>
|
||||||
|
<p class="text-sm opacity-70">Published articles.</p>
|
||||||
|
</div>
|
||||||
|
{% if logged_in_admin %}
|
||||||
|
<a href="/admin/blog/articles" class="btn btn-ghost btn-sm">Manage blog</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if articles | length > 0 %}
|
{% if articles | length > 0 %}
|
||||||
<ul>
|
<div class="grid gap-4 pt-4">
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
<li>
|
<article class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<h2 class="card-title text-base">
|
||||||
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
||||||
{% if article.excerpt %}<p>{{ article.excerpt }}</p>{% endif %}
|
</h2>
|
||||||
</li>
|
<span class="badge">Post</span>
|
||||||
{% endfor %}
|
</div>
|
||||||
</ul>
|
{% if article.excerpt %}
|
||||||
{% else %}
|
<p class="text-sm leading-relaxed opacity-80">{{ article.excerpt }}</p>
|
||||||
<p>No published posts yet.</p>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="pt-2">
|
||||||
|
<a href="/blog/{{ article.slug }}" class="btn btn-neutral btn-sm">Read</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body text-center">
|
||||||
|
<p class="font-medium">No published posts yet.</p>
|
||||||
|
<p class="text-sm opacity-70">Published articles will appear here.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -3,10 +3,23 @@
|
|||||||
{% block title %}{{ article.title }}{% endblock title %}
|
{% block title %}{{ article.title }}{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<article>
|
<article class="space-y-2">
|
||||||
<h1>{{ article.title }}</h1>
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
<p>Views: {{ article.view_count }}</p>
|
<div>
|
||||||
{% if article.excerpt %}<p>{{ article.excerpt }}</p>{% endif %}
|
<h1 class="text-2xl font-bold">{{ article.title }}</h1>
|
||||||
<div>{{ article.content | linebreaksbr | safe }}</div>
|
<p class="text-sm opacity-70">Views: {{ article.view_count }}</p>
|
||||||
|
</div>
|
||||||
|
<a href="/blog" class="btn btn-ghost btn-sm">Back to blog</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body">
|
||||||
|
{% if article.excerpt %}
|
||||||
|
<p class="text-base leading-relaxed opacity-80">{{ article.excerpt }}</p>
|
||||||
|
<div class="border-t border-base-300 pt-4"></div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="leading-relaxed whitespace-pre-line">{{ article.content }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -3,21 +3,45 @@
|
|||||||
{% block title %}Home{% endblock title %}
|
{% block title %}Home{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Home</h1>
|
<div class="space-y-2">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">Universal Web</h1>
|
||||||
|
<p class="text-sm opacity-70">Latest updates from the site.</p>
|
||||||
|
</div>
|
||||||
|
<a href="/blog" class="btn btn-ghost btn-sm">All posts</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<section>
|
<section class="pt-4">
|
||||||
<h2>Latest posts</h2>
|
|
||||||
{% if articles | length > 0 %}
|
{% if articles | length > 0 %}
|
||||||
<ul>
|
<div class="grid gap-4">
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
<li>
|
<article class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<h2 class="card-title text-base">
|
||||||
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
<a href="/blog/{{ article.slug }}">{{ article.title }}</a>
|
||||||
{% if article.excerpt %}<p>{{ article.excerpt }}</p>{% endif %}
|
</h2>
|
||||||
</li>
|
<span class="badge">Post</span>
|
||||||
|
</div>
|
||||||
|
{% if article.excerpt %}
|
||||||
|
<p class="text-sm leading-relaxed opacity-80">{{ article.excerpt }}</p>
|
||||||
|
{% endif %}
|
||||||
|
<div class="pt-2">
|
||||||
|
<a href="/blog/{{ article.slug }}" class="btn btn-neutral btn-sm">Read</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No published posts yet.</p>
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body text-center">
|
||||||
|
<p class="font-medium">No published posts yet.</p>
|
||||||
|
<p class="text-sm opacity-70">Check back later.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
@@ -3,8 +3,21 @@
|
|||||||
{% block title %}{{ page.title }}{% endblock title %}
|
{% block title %}{{ page.title }}{% endblock title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<article>
|
<article class="space-y-2">
|
||||||
<h1>{{ page.title }}</h1>
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||||
<div>{{ page.content | linebreaksbr | safe }}</div>
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold">{{ page.title }}</h1>
|
||||||
|
<p class="text-sm opacity-70">About this site.</p>
|
||||||
|
</div>
|
||||||
|
{% if logged_in_admin %}
|
||||||
|
<a href="/admin/about" class="btn btn-ghost btn-sm">Edit page</a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card border border-base-300 bg-base-100 shadow-sm">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="leading-relaxed whitespace-pre-line">{{ page.content }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|||||||
Reference in New Issue
Block a user