bookwyrm/bookwyrm/templates/snippets/boost_button.html
Mouse Reeve 21a954c7df Always use underscores in html ids
Plus some other shifting around
2021-08-08 19:44:12 -07:00

39 lines
1.2 KiB
HTML

{% load interaction %}
{% load utilities %}
{% load i18n %}
{% with status.id|uuid as uuid %}
{% with request.user|boosted:status as boosted %}
<form
name="boost"
action="/boost/{{ status.id }}"
method="post"
class="interaction boost_{{ status.id }}_{{ uuid }}{% if boosted %} is-hidden{% endif %}"
data-id="boost_{{ status.id }}_{{ uuid }}"
>
{% csrf_token %}
<button
class="button is-small is-light is-transparent"
type="submit"
{% if not status.boostable %}disabled{% endif %}
>
<span class="icon icon-boost m-0-mobile" title="{% trans 'Boost' %}"></span>
<span class="is-sr-only-mobile">{% trans "Boost" %}</span>
</button>
</form>
<form
name="unboost"
action="/unboost/{{ status.id }}"
method="post"
class="interaction boost_{{ status.id }}_{{ uuid }} active {% if not boosted %}is-hidden{% endif %}"
data-id="boost_{{ status.id }}_{{ uuid }}"
>
{% csrf_token %}
<button class="button is-small is-light is-transparent" type="submit">
<span class="icon icon-boost has-text-primary m-0-mobile" title="{% trans 'Un-boost' %}"></span>
<span class="is-sr-only-mobile">{% trans "Un-boost" %}</span>
</button>
</form>
{% endwith %}
{% endwith %}