Templates update
All checks were successful
Rust / Test (push) Successful in 6m12s
Rust / Rustfmt (push) Successful in 21s
Rust / Clippy (push) Successful in 1m36s
Rust / Code coverage (push) Successful in 4m55s

This commit is contained in:
Alphonse Paix
2025-10-06 02:51:52 +02:00
parent 04c2d2b7f5
commit da590fb7c6
11 changed files with 119 additions and 140 deletions

View File

@@ -2,7 +2,7 @@
class="block py-4 hover:bg-gray-50 px-6 transition-colors group">
<div class="flex items-start justify-between">
<div class="flex-1 min-w-0">
<div class="flex items-center space-x-2 mb-2">
<div class="mb-1">
<span class="text-sm font-medium text-gray-900">
{% if let Some(name) = comment.author %}
{{ name }}
@@ -10,14 +10,9 @@
Anonymous
{% endif %}
</span>
<span class="text-gray-400"></span>
<span class="text-xs text-gray-500">on</span>
<a href="/posts/{{ comment.post_id }}" class="text-sm text-blue-600 hover:underline truncate">
#{{ comment.post_id.to_string()[..8] }}
</a>
</div>
<p class="text-sm text-gray-700 mb-2 line-clamp-2">{{ comment.content }}</p>
<div class="flex items-center text-sm text-gray-500">
<div class="flex items-center text-xs text-gray-500 mb-1">
<svg class="w-4 h-4 mr-1.5"
fill="none"
viewBox="0 0 24 24"
@@ -29,6 +24,12 @@
{{ comment.formatted_date() }}
</time>
</div>
<div class="flex items-center text-xs text-gray-500">
<span class="mr-1">on</span>
<a href="/posts/{{ comment.post_id }}" class="text-blue-600 hover:underline truncate">
#{{ comment.post_id }}
</a>
</div>
</div>
<button hx-delete="/admin/comments/{{ comment.comment_id }}"
hx-target="#comment-{{ comment.comment_id }}"

View File

@@ -1,4 +1,4 @@
<div class="bg-white rounded-lg shadow-md border border-gray-200 mb-8">
<div class="bg-white rounded-lg shadow-md border border-gray-200">
<div class="p-6 border-b border-gray-200">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div>
@@ -10,7 +10,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
</svg>
<span>Comments management ({{ comments_count }})</span>
<span>Comments ({{ comments_count }})</span>
</h2>
<p class="text-sm text-gray-600 mt-1">View and moderate all comments.</p>
</div>

View File

@@ -5,13 +5,13 @@
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900">Dashboard</h1>
<p class="mt-2 text-gray-600 items-start">
<span>Connected as
<a href="/users/{{ user.username }}"
class="hover:text-blue-600 hover:underline font-bold">{{ user.username }}</a></span>
<span>Connected as
<a href="/users/{{ user.username }}"
class="hover:text-blue-600 hover:underline font-bold">{{ user.username }}</a></span>
{% if user.is_admin() %}
<span class="ml-2 inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800">
admin
</span>
admin
</span>
{% endif %}
</p>
<button hx-get="/admin/logout"
@@ -24,23 +24,37 @@
<span>Logout</span>
</button>
</div>
{% if user.is_admin() %}
<div class="mb-8 p-6 bg-gradient-to-br from-blue-50 to-indigo-50 bg-blue-50 rounded-lg border border-blue-200">
<h2 class="text-lg font-semibold text-blue-900 mb-6">Administration</h2>
{% include "stats.html" %}
{% include "subscribers/list.html" %}
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
{% include "users/list.html" %}
{% include "users/form.html" %}
</div>
{% include "posts/list.html" %}
{% include "comments/list.html" %}
</div>
{% endif %}
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
{% include "stats.html" %}
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 mb-8">
{% include "publish.html" %}
{% include "send_email.html" %}
{% include "change_password.html" %}
</div>
{% if user.is_admin() %}
<div class="relative my-12">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t-2 border-blue-300"></div>
</div>
<div class="relative flex justify-center">
<span class="bg-gray-50 px-4 text-sm font-semibold text-blue-900 flex items-center gap-2">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/>
</svg>
Administration
</span>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
{% include "subscribers/list.html" %}
{% include "users/list.html" %}
{% include "users/form.html" %}
{% include "posts/list.html" %}
{% include "comments/list.html" %}
</div>
{% endif %}
</div>
{% endblock %}
{% endblock %}

View File

@@ -7,31 +7,29 @@
{{ post.title }}
</h3>
</a>
<div class="flex items-center text-sm text-gray-500 space-x-4">
<div class="flex items-center">
<svg class="w-4 h-4 mr-1.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
<a href="/users/{{ post.author }}" class="hover:text-blue-600 hover:underline">
{{ post.author }}
</a>
</div>
<div class="flex items-center">
<svg class="w-4 h-4 mr-1.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
<time datetime="{{ post.published_at }}">
{{ post.formatted_date() }}
</time>
</div>
<div class="flex items-center text-sm text-gray-500 mb-1">
<svg class="w-4 h-4 mr-1.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
<a href="/users/{{ post.author }}" class="hover:text-blue-600 hover:underline">
{{ post.author }}
</a>
</div>
<div class="flex items-center text-sm text-gray-500">
<svg class="w-4 h-4 mr-1.5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
<time datetime="{{ post.published_at }}">
{{ post.formatted_date() }}
</time>
</div>
</div>
<button hx-delete="/admin/posts/{{ post.post_id }}"

View File

@@ -1,4 +1,4 @@
<div class="bg-white rounded-lg shadow-md border border-gray-200 mb-8">
<div class="bg-white rounded-lg shadow-md border border-gray-200">
<div class="p-6 border-b border-gray-200">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div>
@@ -10,7 +10,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
<span>Posts management ({{ posts_count }})</span>
<span>Posts ({{ posts_count }})</span>
</h2>
<p class="text-sm text-gray-600 mt-1">View and manage all published posts.</p>
</div>

View File

@@ -2,7 +2,7 @@
class="block py-4 hover:bg-gray-50 px-6 transition-colors group {% if subscriber.confirmed() %}border-l-4 border-l-green-500{% else %}border-l-4 border-l-yellow-500{% endif %}">
<div class="flex items-start justify-between">
<div class="flex-1 min-w-0">
<h3 class="text-sm font-medium text-gray-900 group-hover:text-blue-600 transition-colors mb-1 break-all">
<h3 class="text-sm truncate font-medium text-gray-900 group-hover:text-blue-600 transition-colors mb-1 break-all">
{{ subscriber.email }}</h3>
<div class="flex items-center text-sm text-gray-500">
<svg class="w-4 h-4 mr-1.5"

View File

@@ -1,4 +1,4 @@
<div class="bg-white rounded-lg shadow-md border border-gray-200 mb-8">
<div class="bg-white rounded-lg shadow-md border border-gray-200">
<div class="p-6 border-b border-gray-200">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div>
@@ -13,7 +13,7 @@
<path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
</svg>
Subscribers management ({{ count }})
Subscribers ({{ count }})
</h2>
<p class="text-sm text-gray-600 mt-1">View and manage your subscribers.</p>
</div>

View File

@@ -1,4 +1,4 @@
<div class="bg-white rounded-lg shadow-md border border-gray-200 mb-8">
<div class="bg-white rounded-lg shadow-md border border-gray-200">
<div class="p-6 border-b border-gray-200">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div>

View File

@@ -1,4 +1,4 @@
<div class="bg-white rounded-lg shadow-md border border-gray-200 mb-8">
<div class="bg-white rounded-lg shadow-md border border-gray-200">
<div class="p-6 border-b border-gray-200">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
<div>
@@ -10,7 +10,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
</svg>
Users management
Users
</h2>
<p class="text-sm text-gray-600 mt-1">View and manage users.</p>
</div>