feat: add page admin market CRUD and update shared_lib
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
- Market create/delete routes in post admin blueprint - markets.py service (create_market, soft_delete_market) - _markets_panel.html admin template with HTMX create/delete - Update shared_lib submodule (MarketPlace model, migration, URLs) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
44
templates/_types/post/admin/_markets_panel.html
Normal file
44
templates/_types/post/admin/_markets_panel.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<div id="markets-panel">
|
||||
<h3 class="text-lg font-semibold mb-3">Markets</h3>
|
||||
|
||||
{% if markets %}
|
||||
<ul class="space-y-2 mb-4">
|
||||
{% for m in markets %}
|
||||
<li class="flex items-center justify-between p-3 bg-stone-50 rounded">
|
||||
<div>
|
||||
<span class="font-medium">{{ m.name }}</span>
|
||||
<span class="text-stone-400 text-sm ml-2">/{{ m.slug }}/</span>
|
||||
</div>
|
||||
<button
|
||||
hx-delete="{{ url_for('blog.post.admin.delete_market', slug=post.slug, market_slug=m.slug) }}"
|
||||
hx-target="#markets-panel"
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Delete market '{{ m.name }}'?"
|
||||
class="text-red-600 hover:text-red-800 text-sm"
|
||||
>Delete</button>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="text-stone-500 mb-4 text-sm">No markets yet.</p>
|
||||
{% endif %}
|
||||
|
||||
<form
|
||||
hx-post="{{ url_for('blog.post.admin.create_market', slug=post.slug) }}"
|
||||
hx-target="#markets-panel"
|
||||
hx-swap="outerHTML"
|
||||
class="flex gap-2"
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
name="name"
|
||||
placeholder="Market name"
|
||||
required
|
||||
class="flex-1 border border-stone-300 rounded px-3 py-1.5 text-sm"
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
class="bg-stone-800 text-white px-4 py-1.5 rounded text-sm hover:bg-stone-700"
|
||||
>Create</button>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user