{% load i18n %}
{% load user_actions %}
{% liked_post post as liked %}
<span hx-target="this"
      hx-swap="outerHTML"
      {% if not request.user.is_authenticated %}hx-disable{% endif %}>
  {% if liked %}
    <a class="activated"
       hx-post="{% url 'journal:post_unlike' post.pk %}"
       title="{% trans "liked" %}">
      <i class="fa-solid fa-heart }}"></i>
      <span>{{ post.stats.likes }}</span>
    </a>
  {% else %}
    <a hx-post="{% url 'journal:post_like' post.pk %}"
       title="{% trans "like" %}">
      <i class="fa-regular fa-heart }}"></i>
      {% if post.stats.likes %}<span>{{ post.stats.likes }}</span>{% endif %}
    </a>
  {% endif %}
</span>
