mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-21 08:11:36 +02:00
129 lines
5.6 KiB
HTML
129 lines
5.6 KiB
HTML
{% extends "layouts/base.html" %}
|
|
{% load crispy_forms_tags %}
|
|
{% load i18n %}
|
|
{% load month_name %}
|
|
{% load static %}
|
|
{% load webpack_loader %}
|
|
|
|
{% block title %}{% translate 'Monthly Overview' %} :: {{ month|month_name }}/{{ year }}{% endblock %}
|
|
|
|
{% block body_hyperscript %}
|
|
on keyup[code is 'ArrowLeft' and target.nodeName is 'BODY'] from body trigger 'previous_month' end
|
|
on keyup[code is 'ArrowRight' and target.nodeName is 'BODY'] from body trigger 'next_month' end
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container px-md-3 py-3 column-gap-5">
|
|
<div class="row mb-3 gx-xl-4 gy-3 mb-4">
|
|
{# Date picker#}
|
|
<div class="col-12 col-xl-4 flex-row align-items-center d-flex">
|
|
<div class="tw-text-base h-100 align-items-center d-flex">
|
|
<a role="button"
|
|
class="pe-4 py-2"
|
|
hx-boost="true"
|
|
hx-trigger="click, previous_month from:window"
|
|
href="{% url 'monthly_overview' month=previous_month year=previous_year %}"><i
|
|
class="fa-solid fa-chevron-left"></i></a>
|
|
</div>
|
|
<div class="tw-text-3xl fw-bold font-monospace tw-w-full text-center"
|
|
hx-get="{% url 'available_dates' %}"
|
|
hx-target="#generic-offcanvas-left"
|
|
hx-trigger="click, date_picker from:window"
|
|
hx-vals='{"month": {{ month }}, "year": {{ year }}}' role="button">
|
|
{{ month|month_name }} {{ year }}
|
|
</div>
|
|
<div class="tw-text-base mx-2 h-100 align-items-center d-flex">
|
|
<a role="button"
|
|
class="ps-3 py-2"
|
|
hx-boost="true"
|
|
hx-trigger="click, next_month from:window"
|
|
href="{% url 'monthly_overview' month=next_month year=next_year %}">
|
|
<i class="fa-solid fa-chevron-right"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{# Action buttons#}
|
|
<div class="col-12 col-xl-8">
|
|
<div class="d-grid gap-2 d-xl-flex justify-content-xl-end">
|
|
<button class="btn btn-sm btn-outline-success"
|
|
hx-get="{% url 'transaction_add' %}"
|
|
hx-target="#generic-offcanvas"
|
|
hx-trigger="click, add_income from:window"
|
|
hx-vals='{"year": {{ year }}, "month": {{ month }}, "type": "IN"}'>
|
|
<i class="fa-solid fa-arrow-right-to-bracket me-2"></i>
|
|
{% translate "Income" %}
|
|
</button>
|
|
<button class="btn btn-sm btn-outline-danger"
|
|
hx-get="{% url 'transaction_add' %}"
|
|
hx-target="#generic-offcanvas"
|
|
hx-trigger="click, add_expense from:window"
|
|
hx-vals='{"year": {{ year }}, "month": {{ month }}, "type": "EX"}'>
|
|
<i class="fa-solid fa-arrow-right-from-bracket me-2"></i>
|
|
{% translate "Expense" %}
|
|
</button>
|
|
<button class="btn btn-sm btn-outline-warning"
|
|
hx-get="{% url 'installment_plan_add' %}"
|
|
hx-trigger="click, installment from:window"
|
|
hx-target="#generic-offcanvas">
|
|
<i class="fa-solid fa-divide me-2"></i>
|
|
{% translate "Installment" %}
|
|
</button>
|
|
<button class="btn btn-sm btn-outline-warning"
|
|
hx-get="{% url 'recurring_transaction_add' %}"
|
|
hx-trigger="click, balance from:window"
|
|
hx-target="#generic-offcanvas">
|
|
<i class="fa-solid fa-repeat me-2"></i>
|
|
{% translate "Recurring" %}
|
|
</button>
|
|
<button class="btn btn-sm btn-outline-info"
|
|
hx-get="{% url 'transactions_transfer' %}"
|
|
hx-target="#generic-offcanvas"
|
|
hx-trigger="click, add_transfer from:window"
|
|
hx-vals='{"year": {{ year }}, "month": {{ month }}}'>
|
|
<i class="fa-solid fa-money-bill-transfer me-2"></i>
|
|
{% translate "Transfer" %}
|
|
</button>
|
|
<button class="btn btn-sm btn-outline-info"
|
|
hx-get="{% url 'account_reconciliation' %}"
|
|
hx-trigger="click, balance from:window"
|
|
hx-target="#generic-offcanvas">
|
|
<i class="fa-solid fa-scale-balanced me-2"></i>
|
|
{% translate "Balance" %}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{# Monthly summary#}
|
|
<div class="row gx-xl-4 gy-3">
|
|
<div class="col-12 col-xl-4 order-0 order-xl-2">
|
|
<div id="summary" hx-get="{% url 'monthly_summary' month=month year=year %}" class="show-loading"
|
|
hx-trigger="load, updated from:window, monthly_summary_update from:window">
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-xl-8 order-2 order-xl-1">
|
|
{# Filter transactions#}
|
|
<div class="row mb-1">
|
|
<div class="col-12">
|
|
<div class="dropdown">
|
|
<button type="button" class="btn btn-sm btn-outline-primary dropdown-toggle" data-bs-toggle="dropdown"
|
|
aria-expanded="false" data-bs-auto-close="false">
|
|
<i class="fa-solid fa-filter fa-fw me-2"></i>{% translate 'Filter transactions' %}
|
|
</button>
|
|
<form hx-get="{% url 'monthly_transactions_list' month=month year=year %}" hx-trigger="change, submit, search"
|
|
hx-target="#transactions" id="filter" hx-indicator="#transactions"
|
|
class="dropdown-menu p-4 tw-w-full lg:tw-w-3/4"
|
|
_="install init_tom_select">
|
|
{% crispy filter.form %}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="transactions"
|
|
class="show-loading"
|
|
hx-get="{% url 'monthly_transactions_list' month=month year=year %}"
|
|
hx-trigger="load, updated from:window" hx-include="#filter"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|