Files
WYGIWYH/app/templates/yearly_overview/pages/yearly_overview_base.html
T
2025-11-01 03:15:44 -03:00

103 lines
4.3 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% load month_name %}
{% load static %}
{% block title %}{% translate 'Yearly Overview' %} :: {% block overview_type_title %}{% endblock %} :: {{ year }}{% endblock %}
{% block body_hyperscript %}
on keyup[code is 'ArrowLeft' and target.nodeName is 'BODY'] from body trigger 'previous_year' end
on keyup[code is 'ArrowRight' and target.nodeName is 'BODY'] from body trigger 'next_year' end
{% endblock %}
{% block content %}
<div class="h-full text-center mb-4 pt-2">
<div class="btn-group gap-3" role="group">
<a href="{% url 'yearly_overview_currency' year=year %}" class="btn {% if type != 'currency' %}btn-outline btn-primary{% else %}btn-primary{% endif %} rounded-full" hx-boost>
<i class="fa-solid fa-solid fa-coins fa-fw me-2"></i>{% trans 'Currency' %}
</a>
<a href="{% url 'yearly_overview_account' year=year %}" class="btn {% if type != 'account' %}btn-outline btn-primary{% else %}btn-primary{% endif %} rounded-full" hx-boost>
<i class="fa-solid fa-wallet fa-fw me-2"></i>{% trans 'Account' %}
</a>
</div>
</div>
<div class="container px-md-3 py-3 gap-x-5" id="yearly-content">
<div class="flex flex-wrap mb-4 gap-x-xl-4 gap-y-3">
{# Date picker#}
<div class="w-full xl:w-auto flex-row items-center flex">
<div class="text-base h-full items-center flex btn btn-ghost">
<a role="button"
hx-boost="true"
hx-trigger="click, previous_year from:window"
href="{% block previous_year_url %}{% endblock %}">
<i class="fa-solid fa-chevron-left"></i></a>
</div>
<div class="text-3xl font-bold font-mono w-full text-center">
{{ year }}
</div>
<div class="text-base mx-2 h-full items-center flex btn btn-ghost">
<a role="button"
hx-boost="true"
hx-trigger="click, next_year from:window"
href="{% block next_year_url %}{% endblock %}">
<i class="fa-solid fa-chevron-right"></i>
</a>
</div>
</div>
</div>
<div class="flex flex-wrap">
<div class="w-full lg:w-2/12">
<input type="hidden" name="month" value="">
<div class="flex-col join join-vertical" id="month-pills" role="tablist"
hx-indicator="#data-content">
<button class="btn btn-outline btn-primary btn-active justify-start join-item"
role="tab"
hx-get="{% block data_url %}{% endblock %}"
hx-target="#data-content"
hx-trigger="click"
hx-include="{% block hx_include %}{% endblock %}"
hx-swap="innerHTML"
onclick="document.querySelector('[name=month]').value = ''"
_="on click
remove .btn-active from <button/> in #month-pills
add .btn-active to me">
{% translate 'Year' %}
</button>
{% for month in months %}
<button class="btn btn-outline btn-primary justify-start join-item"
role="tab"
hx-get="{% block month_data_url %}{% endblock %}"
hx-target="#data-content"
hx-trigger="click"
hx-include="{% block month_hx_include %}{% endblock %}"
hx-swap="innerHTML"
onclick="document.querySelector('[name=month]').value = '{{ month }}'"
_="on click
remove .btn-active from <button/> in #month-pills
add .btn-active to me">
{{ month|month_name }}
</button>
{% endfor %}
</div>
</div>
<hr class="my-4 block lg:hidden">
<div class="w-full lg:w-3/12">
{% block filter_pills %}{% endblock %}
</div>
<div class="w-full lg:w-7/12">
<div id="data-content"
class="show-loading"
hx-get="{% block content_data_url %}{% endblock %}"
hx-trigger="load, every 10m, updated from:window"
hx-include="{% block content_hx_include %}{% endblock %}"
hx-swap="innerHTML">
</div>
</div>
</div>
</div>
<c-ui.transactions_fab></c-ui.transactions_fab>
{% endblock %}