init commit
This commit is contained in:
17
templates/ui/components/like_button.html
Normal file
17
templates/ui/components/like_button.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{# expects: profile_id, liked: bool #}
|
||||
<form method="post"
|
||||
hx-post="{% url 'like_profile' profile_id %}"
|
||||
hx-target="this"
|
||||
hx-swap="outerHTML"
|
||||
aria-label="Добавить в избранное">
|
||||
{% csrf_token %}
|
||||
{% if liked %}
|
||||
<button type="submit" class="inline-flex items-center gap-1 rounded-md border px-3 py-1.5 text-sm hover:bg-white">
|
||||
<span aria-hidden="true">❤️</span> В избранном
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="submit" class="inline-flex items-center gap-1 rounded-md border px-3 py-1.5 text-sm hover:bg-white">
|
||||
<span aria-hidden="true">🤍</span> В избранное
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
Reference in New Issue
Block a user