lib.itmens/journal/templates/action_boost_post.html
2024-05-20 12:00:17 -04:00

15 lines
578 B
HTML

{% load i18n %}
{% load user_actions %}
{% boosted_post post as boosted %}
<span hx-target="this"
hx-swap="outerHTML"
{% if not request.user.is_authenticated %}hx-disable{% endif %}>
<a hx-post="{% url 'journal:post_boost' post.pk %}"
hx-include="[name='post_url']"
{% if boosted %}class="activated"{% endif %}
title="{% trans "boost" %}">
<input type="hidden" name="post_url" value="{{ post.object_uri }}">
<i class="fa-solid fa-retweet"></i>
{% if post.stats.boosts > 1 %}<span>{{ post.stats.boosts }}</span>{% endif %}
</a>
</span>