{% extends "main/base.html" %}
{% load i18n main_extras history_extras transaction_extras %}
{% block title %}
  {{ category }} – {{ block.super }}
{% endblock title %}
{% block link %}
  {{ block.super }}
  {% css "main/css/table.css" %}
  {% css "main/css/plot.css" %}
{% endblock link %}
{% block body %}
  <h2>{{ category.icon|remix }}{{ category }}</h2>
  <p>
    <a href="{% url "edit_category" category.pk %}">{{ "edit"|remix }}{% translate "Edit category" %}</a>
  </p>
  <section>
    <h3>{% translate "Transactions" %}</h3>
    {% url_get "transactions" category=category.id as t_url %}
    <p>
      <a class="big-link" href="{{ t_url }}">{{ "list-check"|remixnl }}{% translate "View all transactions" %}</a>
    </p>
    {% transaction_table category.transaction_set.all n_max=8 transactions_url=t_url %}
  </section>
  <section>
    <h3>{% translate "History" %}</h3>
    {% history_plot category.transaction_set category=category %}
  </section>
{% endblock body %}
