Add cart-mini + auth-menu fragments to all apps, fix like button
- Market, events, federation, account now fetch cart-mini, auth-menu, and nav-tree fragments concurrently (matching blog's pattern) - Move like button template to shared/browser/templates/ so blog can find it without needing market's templates in its container Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
shared/browser/templates/_types/browse/like/button.html
Normal file
20
shared/browser/templates/_types/browse/like/button.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<button
|
||||
class="flex items-center gap-1 {% if liked %} text-red-600 {% else %} text-stone-300 {% endif %} hover:text-red-600 transition-colors w-[1em] h-[1em]"
|
||||
hx-post="{{ like_url if like_url else url_for('market.browse.product.like_toggle', product_slug=slug)|host }}"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
hx-push-url="false"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token() }}"}'
|
||||
hx-swap-settle="0ms"
|
||||
{% if liked %}
|
||||
aria-label="Unlike this {{ item_type if item_type else 'product' }}"
|
||||
{% else %}
|
||||
aria-label="Like this {{ item_type if item_type else 'product' }}"
|
||||
{% endif %}
|
||||
>
|
||||
{% if liked %}
|
||||
<i aria-hidden="true" class="fa-solid fa-heart"></i>
|
||||
{% else %}
|
||||
<i aria-hidden="true" class="fa-regular fa-heart"></i>
|
||||
{% endif %}
|
||||
</button>
|
||||
Reference in New Issue
Block a user