{% load app_extras %}

<button class="btn progress-btn"
        hx-post="/progress_edit"
        hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
        hx-trigger="click"
        hx-target="closest .card-text"
        hx-vals='{"item": {{ media.item.id }}, "operation": "decrease"}'
        {% if media.min or media.progress == 0 %}disabled{% endif %}>
  <i class="bi bi-dash"></i> {% comment %} decrease progress button {% endcomment %}
</button>

<div class="progress_count">
  {% if media_type == "game" %}
    {{ media.progress|format_time }}
  {% elif media_type == "season" %}
    {% if media.current_episode %}
      Ep. {{ media.current_episode.item.episode_number }}
    {% else %}
      Ep. 0
    {% endif %}
  {% elif media_type == "manga" %}
    Ch. {{ media.progress }}
  {% else %}
    Ep. {{ media.progress }}
  {% endif %}
</div>

<button class="btn progress-btn"
        hx-post="/progress_edit"
        hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
        hx-trigger="click"
        hx-target="closest .card-text"
        hx-vals='{"item": {{ media.item.id }}, "operation": "increase"}'
        {% if media.max %}disabled{% endif %}>
  <i class="bi bi-plus"></i> {% comment %} increase progress button {% endcomment %}
</button>
