Update djlint settings

This commit is contained in:
Edgar P. Burkhart 2025-01-01 13:59:31 +01:00
parent 898c92df23
commit f98990d0a8
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
33 changed files with 851 additions and 831 deletions

View file

@ -3,23 +3,23 @@
{% load i18n %} {% load i18n %}
{% block title %}{{ object }} {{ block.super }}{% endblock %} {% block title %}{{ object }} {{ block.super }}{% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>{{ object.icon|remix }}{{ object }}</h2> <h2>{{ object.icon|remix }}{{ object }}</h2>
<p> <p>
<a href="{% url "edit_account" object.pk %}">{{ "edit"|remix }}{% translate "Edit account" %}</a> <a href="{% url "edit_account" object.pk %}">{{ "edit"|remix }}{% translate "Edit account" %}</a>
</p> </p>
<section>
<h3>{% translate "Statements" %}</h3>
{% include "statement/statement_table.html" %}
</section>
{% if history %}
<section> <section>
<h3>{% translate "Statements" %}</h3> <h3>{% translate "History" %}</h3>
{% include "statement/statement_table.html" %} {% include "history/plot.html" %}
</section> </section>
{% if history %} {% endif %}
<section>
<h3>{% translate "History" %}</h3>
{% include "history/plot.html" %}
</section>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -2,9 +2,9 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block title_new %} {% block title_new %}
{% translate "Create account" %} {% translate "Create account" %}
{% endblock %} {% endblock %}
{% block h2_new %} {% block h2_new %}
{% translate "New account" %} {% translate "New account" %}
{% endblock %} {% endblock %}
{% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %} {% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %}

View file

@ -2,23 +2,23 @@
{% load main_extras i18n %} {% load main_extras i18n %}
{% block title %}{{ object }} {{ block.super }}{% endblock %} {% block title %}{{ object }} {{ block.super }}{% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>{{ object.icon|remix }}{{ object }}</h2> <h2>{{ object.icon|remix }}{{ object }}</h2>
<p> <p>
<a href="{% url "edit_category" object.pk %}">{{ "edit"|remix }}{% translate "Edit category" %}</a> <a href="{% url "edit_category" object.pk %}">{{ "edit"|remix }}{% translate "Edit category" %}</a>
</p> </p>
<section>
<h3>{% translate "Transactions" %}</h3>
{% include "transaction/transaction_table.html" %}
</section>
{% if history %}
<section> <section>
<h3>{% translate "Transactions" %}</h3> <h3>{% translate "History" %}</h3>
{% include "transaction/transaction_table.html" %} {% include "history/plot.html" %}
</section> </section>
{% if history %} {% endif %}
<section>
<h3>{% translate "History" %}</h3>
{% include "history/plot.html" %}
</section>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -2,9 +2,9 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block title_new %} {% block title_new %}
{% translate "Create category" %} {% translate "Create category" %}
{% endblock %} {% endblock %}
{% block h2_new %} {% block h2_new %}
{% translate "New category" %} {% translate "New category" %}
{% endblock %} {% endblock %}
{% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %} {% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %}

View file

@ -1,110 +1,110 @@
{% load main_extras statement_extras %} {% load main_extras statement_extras %}
{% load i18n %} {% load i18n %}
<div class="plot"> <div class="plot">
<table class="full-width"> <table class="full-width">
<colgroup> <colgroup>
<col class="desc"> <col class="desc">
<col class="value"> <col class="value">
<col span="2" class="bar"> <col span="2" class="bar">
<col class="value"> <col class="value">
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th scope="col">{% translate "Category" %}</th> <th scope="col">{% translate "Category" %}</th>
<th scope="col" colspan="2">{% translate "Expenses" %}</th> <th scope="col" colspan="2">{% translate "Expenses" %}</th>
<th scope="col" colspan="2">{% translate "Income" %}</th> <th scope="col" colspan="2">{% translate "Income" %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% spaceless %} {% spaceless %}
{% for cat in categories %} {% for cat in categories %}
<tr> <tr>
<th scope="row" class="l wi"> <th scope="row" class="l wi">
{% if cat.category %} {% if cat.category %}
{% if month %} {% if month %}
<a href="{% url "category_transaction_month" cat.category month.year month.month %}">{{ cat.category__icon|remix }}{{ cat.category__name }}</a> <a href="{% url "category_transaction_month" cat.category month.year month.month %}">{{ cat.category__icon|remix }}{{ cat.category__name }}</a>
{% elif year %} {% elif year %}
<a href="{% url "category_transaction_year" cat.category year.year %}">{{ cat.category__icon|remix }}{{ cat.category__name }}</a> <a href="{% url "category_transaction_year" cat.category year.year %}">{{ cat.category__icon|remix }}{{ cat.category__name }}</a>
{% else %} {% else %}
{{ cat.category__icon|remix }}{{ cat.category__name }} {{ cat.category__icon|remix }}{{ cat.category__name }}
{% endif %} {% endif %}
{% endif %} {% endif %}
</th> </th>
<td class="value">{{ cat.sum_m|pmvalue }}</td> <td class="value">{{ cat.sum_m|pmvalue }}</td>
<td class="bar m"> <td class="bar m">
{% if cat.sum_m %} {% if cat.sum_m %}
<div style="width: {% widthratio cat.sum_m max -100 %}%"></div> <div style="width: {% widthratio cat.sum_m max -100 %}%"></div>
{% endif %} {% endif %}
{% if cat.sum < 0 %} {% if cat.sum < 0 %}
<div class="tot" style="width:{% widthratio cat.sum max -100 %}%"> <div class="tot" style="width:{% widthratio cat.sum max -100 %}%">
<span>{{ cat.sum|pmvalue }}</span> <span>{{ cat.sum|pmvalue }}</span>
</div> </div>
{% endif %} {% endif %}
</td> </td>
<td class="bar p"> <td class="bar p">
{% if cat.sum_p %} {% if cat.sum_p %}
<div style="width: {% widthratio cat.sum_p max 100 %}%"></div> <div style="width: {% widthratio cat.sum_p max 100 %}%"></div>
{% endif %} {% endif %}
{% if cat.sum > 0 %} {% if cat.sum > 0 %}
<div class="tot" style="width:{% widthratio cat.sum max 100 %}%"> <div class="tot" style="width:{% widthratio cat.sum max 100 %}%">
<span>{{ cat.sum|pmvalue }}</span> <span>{{ cat.sum|pmvalue }}</span>
</div> </div>
{% endif %} {% endif %}
</td> </td>
<td class="value">{{ cat.sum_p|pmvalue }}</td> <td class="value">{{ cat.sum_p|pmvalue }}</td>
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>
<td class="empty" colspan="5">{% translate "No transaction" %}</td> <td class="empty" colspan="5">{% translate "No transaction" %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
{% endspaceless %} {% endspaceless %}
</tbody> </tbody>
<tfoot> <tfoot>
{% if categories %} {% if categories %}
<tr> <tr>
<th scope="row" class="l">{% translate "Total" %}</th> <th scope="row" class="l">{% translate "Total" %}</th>
<td class="value">{{ total_m|pmvalue }}</td> <td class="value">{{ total_m|pmvalue }}</td>
<td class="bar m"> <td class="bar m">
<div style="width: {% widthratio total_m max -100 %}%"></div> <div style="width: {% widthratio total_m max -100 %}%"></div>
{% if total < 0 %} {% if total < 0 %}
<div class="tot" style="width:{% widthratio total max -100 %}%"> <div class="tot" style="width:{% widthratio total max -100 %}%">
<span>{{ total|pmvalue }}</span> <span>{{ total|pmvalue }}</span>
</div> </div>
{% endif %}
</td>
<td class="bar p">
<div style="width: {% widthratio total_p max 100 %}%"></div>
{% if total > 0 %}
<div class="tot" style="width:{% widthratio total max 100 %}%">
<span>{{ total|pmvalue }}</span>
</div>
{% endif %}
</td>
<td class="value">{{ total_p|pmvalue }}</td>
</tr>
{% endif %} {% endif %}
{% if statement and statement.diff != statement.sum %} </td>
<tr> <td class="bar p">
<th scope="row" class="l">{% translate "Expected total" %}</th> <div style="width: {% widthratio total_p max 100 %}%"></div>
<td class="c">{{ total|check:statement.diff }}</td> {% if total > 0 %}
<td class="bar m"> <div class="tot" style="width:{% widthratio total max 100 %}%">
{% if statement.diff < 0 %} <span>{{ total|pmvalue }}</span>
<div class="tot" style="width:{% widthratio statement.diff max -100 %}%"> </div>
<span>{{ statement.diff|pmvalue }}</span>
</div>
{% endif %}
</td>
<td class="bar p">
{% if statement.diff >= 0 %}
<div class="tot" style="width:{% widthratio statement.diff max 100 %}%">
<span>{{ statement.diff|pmvalue }}</span>
</div>
{% endif %}
</td>
<td></td>
</tr>
{% endif %} {% endif %}
</tfoot> </td>
</table> <td class="value">{{ total_p|pmvalue }}</td>
</tr>
{% endif %}
{% if statement and statement.diff != statement.sum %}
<tr>
<th scope="row" class="l">{% translate "Expected total" %}</th>
<td class="c">{{ total|check:statement.diff }}</td>
<td class="bar m">
{% if statement.diff < 0 %}
<div class="tot" style="width:{% widthratio statement.diff max -100 %}%">
<span>{{ statement.diff|pmvalue }}</span>
</div>
{% endif %}
</td>
<td class="bar p">
{% if statement.diff >= 0 %}
<div class="tot" style="width:{% widthratio statement.diff max 100 %}%">
<span>{{ statement.diff|pmvalue }}</span>
</div>
{% endif %}
</td>
<td></td>
</tr>
{% endif %}
</tfoot>
</table>
</div> </div>

View file

@ -3,86 +3,86 @@
{% load transaction_extras %} {% load transaction_extras %}
{% load i18n %} {% load i18n %}
<div class="calendar"> <div class="calendar">
<table> <table>
<thead> <thead>
<tr> <tr>
{% if not year %} {% if not year %}
<th scope="col">{% translate "Year" %}</th> <th scope="col">{% translate "Year" %}</th>
{% endif %} {% endif %}
{% calendar_head %} {% calendar_head %}
<th scope="col">{% translate "Total" %}</th> <th scope="col">{% translate "Total" %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% regroup history.data by month.year as years_list %} {% regroup history.data by month.year as years_list %}
{% for y, y_data in years_list reversed %} {% for y, y_data in years_list reversed %}
<tr> <tr>
{% if not year %} {% if not year %}
<th class="date" scope="row">{% year_url y %}</th> <th class="date" scope="row">{% year_url y %}</th>
{% endif %} {% endif %}
{% for m in y_data %} {% for m in y_data %}
{% if forloop.parentloop.last and forloop.first %} {% if forloop.parentloop.last and forloop.first %}
{% empty_calendar_cells_start m.month.month %} {% empty_calendar_cells_start m.month.month %}
{% endif %} {% endif %}
{% if m %} {% if m %}
<td class="month {% if m.sum > 0 %}p{% else %}m{% endif %}" <td class="month {% if m.sum > 0 %}p{% else %}m{% endif %}"
style="--opacity: {% calendar_opacity m.sum history.max.sum %}" style="--opacity: {% calendar_opacity m.sum history.max.sum %}"
title="{{ m.sum|pmrvalue }}">{% up_down_icon m.sum %}</td> title="{{ m.sum|pmrvalue }}">{% up_down_icon m.sum %}</td>
{% else %} {% else %}
<td class="month"></td> <td class="month"></td>
{% endif %} {% endif %}
{% if forloop.parentloop.first and forloop.last %} {% if forloop.parentloop.first and forloop.last %}
{% empty_calendar_cells_end m.month.month %} {% empty_calendar_cells_end m.month.month %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<td class="total">{{ y_data|sum_year|pmrvalue }}</td> <td class="total">{{ y_data|sum_year|pmrvalue }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="history plot"> <div class="history plot">
<table class="full-width"> <table class="full-width">
<colgroup> <colgroup>
<col class="icon"> <col class="icon">
<col class="desc"> <col class="desc">
<col class="value"> <col class="value">
<col span="2" class="bar"> <col span="2" class="bar">
<col class="value"> <col class="value">
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th scope="col">{{ "expand-up-down"|remix }}</th> <th scope="col">{{ "expand-up-down"|remix }}</th>
<th scope="col">{% translate "Month" %}</th> <th scope="col">{% translate "Month" %}</th>
<th scope="col" colspan="2">{% translate "Expenses" %}</th> <th scope="col" colspan="2">{% translate "Expenses" %}</th>
<th scope="col" colspan="2">{% translate "Income" %}</th> <th scope="col" colspan="2">{% translate "Income" %}</th>
</tr>
</thead>
<tbody>
{% for date in history.data reversed %}
{% ifchanged %}
{% if date.sum_m or date.sum_p %}
<tr {% if not date.month.month|divisibleby:"2" %}class="even"{% endif %}>
<td class="icon">{% up_down_icon date.sum %}</td>
<th class="date" scope="row">
{% if year %}
{% month_url date.month fmt="F" %}
{% else %}
{% month_url date.month %}
{% endif %}
</th>
<td class="value">{{ date.sum_m|pmrvalue }}</td>
<td class="bar m">{% plot_bar date.sum date.sum_m history.max.pm %}</td>
<td class="bar p">{% plot_bar date.sum date.sum_p history.max.pm %}</td>
<td class="value">{{ date.sum_p|pmrvalue }}</td>
</tr> </tr>
</thead> {% else %}
<tbody> <tr class="empty">
{% for date in history.data reversed %} <td colspan="6" class="empty"></td>
{% ifchanged %} </tr>
{% if date.sum_m or date.sum_p %} {% endif %}
<tr {% if not date.month.month|divisibleby:"2" %}class="even"{% endif %}> {% endifchanged %}
<td class="icon">{% up_down_icon date.sum %}</td> {% endfor %}
<th class="date" scope="row"> </tbody>
{% if year %} </table>
{% month_url date.month fmt="F" %}
{% else %}
{% month_url date.month %}
{% endif %}
</th>
<td class="value">{{ date.sum_m|pmrvalue }}</td>
<td class="bar m">{% plot_bar date.sum date.sum_m history.max.pm %}</td>
<td class="bar p">{% plot_bar date.sum date.sum_p history.max.pm %}</td>
<td class="value">{{ date.sum_p|pmrvalue }}</td>
</tr>
{% else %}
<tr class="empty">
<td colspan="6" class="empty"></td>
</tr>
{% endif %}
{% endifchanged %}
{% endfor %}
</tbody>
</table>
</div> </div>

View file

@ -3,92 +3,94 @@
{% load main_extras %} {% load main_extras %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title> <title>
{% block title %}Nummi{% endblock %} {% block title %}Nummi{% endblock %}
</title> </title>
{% block link %} {% block link %}
<link rel="icon" href="{% static "main/svg/logo.svg" %}" type="image/svg+xml"> <link rel="icon" href="{% static "main/svg/logo.svg" %}" type="image/svg+xml">
{% css "main/css/main.css" %} {% css "main/css/main.css" %}
{% js "main/js/base.js" %} {% js "main/js/base.js" %}
{% endblock %} {% endblock %}
</head> </head>
<body> <body>
{% block nav %} {% block nav %}
{% spaceless %} {% spaceless %}
<nav> <nav>
<h1> <h1>
<img src="{% static "main/svg/logo.svg" %}" alt=""> <img src="{% static "main/svg/logo.svg" %}" alt="">
Nummi Nummi
</h1> </h1>
<ul> <ul>
<li> <li>
<a class="skip-link" href="#main">{% translate "Skip to main content" %}</a> <a class="skip-link" href="#main">{% translate "Skip to main content" %}</a>
</li> </li>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li> <li>
<a href="{% url "index" %}" <a href="{% url "index" %}"
class="home{% if request.resolver_match.url_name == "index" %} cur{% endif %}" class="home{% if request.resolver_match.url_name == "index" %} cur{% endif %}"
accesskey="h"> accesskey="h">
<span>{% translate "Home" %}</span> <span>{% translate "Home" %}</span>
{{ "home"|remix }} {{ "home"|remix }}
</a> </a>
</li> </li>
<li> <li>
<a href="{% url "statements" %}" <a href="{% url "statements" %}"
class="{% if request.resolver_match.url_name == "statements" %}cur{% endif %}"> class="{% if request.resolver_match.url_name == "statements" %}cur{% endif %}">
<span>{% translate "Statements" %}</span> <span>{% translate "Statements" %}</span>
{{ "file"|remix }} {{ "file"|remix }}
</a> </a>
</li> </li>
<li> <li>
<a href="{% url "transactions" %}" <a href="{% url "transactions" %}"
class="{% if request.resolver_match.url_name == "transactions" %}cur{% endif %}"> class="{% if request.resolver_match.url_name == "transactions" %}cur{% endif %}">
<span>{% translate "Transactions" %}</span> <span>{% translate "Transactions" %}</span>
{{ "receipt"|remix }} {{ "receipt"|remix }}
</a> </a>
</li> </li>
<li> <li>
<a href="{% url "search" %}" <a href="{% url "search" %}"
class="{% if request.resolver_match.url_name == "search" %}cur{% endif %}" class="{% if request.resolver_match.url_name == "search" %}cur{% endif %}"
accesskey="r"> accesskey="r">
<span>{% translate "Search" %}</span> <span>{% translate "Search" %}</span>
{{ "search"|remix }} {{ "search"|remix }}
</a> </a>
</li> </li>
<li> <li>
{% blocktranslate %}Logged in as <strong>{{ user }}</strong>{% endblocktranslate %} {% blocktranslate %}Logged in as <strong>{{ user }}</strong>{% endblocktranslate %}
</li> </li>
<li> <li>
<a href="{% url "logout" %}" accesskey="l"> <a href="{% url "logout" %}" accesskey="l">
<span>{% translate "Log out" %}</span> <span>{% translate "Log out" %}</span>
{{ "close-circle"|remix }} {{ "close-circle"|remix }}
</a> </a>
</li> </li>
{% else %} {% else %}
<li> <li>
<a {% if request.resolver_match.url_name == "login" %}class="cur"{% endif %} <a {% if request.resolver_match.url_name == "login" %}class="cur"{% endif %}
href="{% url "login" %}"> href="{% url "login" %}">
<span>{% translate "Log in" %}</span> <span>{% translate "Log in" %}</span>
{{ "user"|remix }} {{ "user"|remix }}
</a> </a>
</li> </li>
{% endif %}
</ul>
</nav>
{% endspaceless %}
{% endblock %}
<main id="main">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li class="msg-level-{{ message.level }}">{{ message.level|messageicon }}{{ message }}</li>
{% endfor %}
</ul>
{% endif %} {% endif %}
{% block body %}{% endblock %} </ul>
</main> </nav>
</body> {% endspaceless %}
{% endblock %}
<main id="main">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li class="msg-level-{{ message.level }}">
{{ message.level|messageicon }}{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
{% block body %}{% endblock %}
</main>
</body>
</html> </html>

View file

@ -3,23 +3,23 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/form.css" %} {% css "main/css/form.css" %}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% spaceless %} {% spaceless %}
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<p> <p>
{% blocktranslate %}Are you sure you want do delete <strong>{{ object }}</strong> ?{% endblocktranslate %} {% blocktranslate %}Are you sure you want do delete <strong>{{ object }}</strong> ?{% endblocktranslate %}
</p> </p>
{% block additionalinfo %}{% endblock %} {% block additionalinfo %}{% endblock %}
{{ form }} {{ form }}
<div class="buttons"> <div class="buttons">
<a href="{{ object.get_absolute_url }}">{% translate "Cancel" %}</a> <a href="{{ object.get_absolute_url }}">{% translate "Cancel" %}</a>
<input class="del" type="submit" value="{% translate "Confirm" %}" /> <input class="del" type="submit" value="{% translate "Confirm" %}" />
</div> </div>
</form> </form>
{% endspaceless %} {% endspaceless %}
{% endblock %} {% endblock %}

View file

@ -3,36 +3,38 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block title %} {% block title %}
{% if form.instance|adding %} {% if form.instance|adding %}
{% block title_new %}{% endblock %} {% block title_new %}{% endblock %}
{% else %} {% else %}
{{ form.instance }} {{ form.instance }}
{% endif %} {% endif %}
Nummi Nummi
{% endblock %} {% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/form.css" %} {% css "main/css/form.css" %}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% with instance=form.instance %} {% with instance=form.instance %}
{% if instance|adding %} {% if instance|adding %}
<h2 class="new"> <h2 class="new">
{% block h2_new %}{% endblock %} {% block h2_new %}{% endblock %}
</h2> </h2>
{% else %} {% else %}
<h2> <h2>
{% block h2 %}{{ instance }}{% endblock %} {% block h2 %}{{ instance }}{% endblock %}
</h2> </h2>
{% endif %} {% endif %}
{% block pre %}{% endblock %} {% block pre %}{% endblock %}
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
{% if instance|adding %}<input hidden name="next" value="{{ request.path }}">{% endif %} {% if instance|adding %}
{{ form }} <input hidden name="next" value="{{ request.path }}">
</form> {% endif %}
{% block tables %}{% endblock %} {{ form }}
{% endwith %} </form>
{% block tables %}{% endblock %}
{% endwith %}
{% endblock %} {% endblock %}

View file

@ -1,36 +1,36 @@
{% load i18n %} {% load i18n %}
{% load main_extras %} {% load main_extras %}
<table class="file-input"> <table class="file-input">
{% if widget.is_initial %} {% if widget.is_initial %}
<tr>
<th>{{ widget.initial_text }}</th>
<td>
<a href="{{ widget.value.url }}">{% translate "File" %} [{{ widget.value|extension }}]</a>
</td>
</tr>
{% if not widget.required %}
<tr>
<th>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>
</th>
<td>
<input type="checkbox"
name="{{ widget.checkbox_name }}"
id="{{ widget.checkbox_id }}"
{% if widget.attrs.disabled %}disabled{% endif %}>
</td>
</tr>
{% endif %}
<tr>
<th>{{ widget.input_text }}</th>
<td>
{% else %}
<tr> <tr>
<th>{{ widget.initial_text }}</th> <td colspan="2">
<td> {% endif %}
<a href="{{ widget.value.url }}">{% translate "File" %} [{{ widget.value|extension }}]</a> <input type="{{ widget.type }}"
</td> name="{{ widget.name }}"
</tr> {% include "django/forms/widgets/attrs.html" %}>
{% if not widget.required %} </td>
<tr> </tr>
<th> </table>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>
</th>
<td>
<input type="checkbox"
name="{{ widget.checkbox_name }}"
id="{{ widget.checkbox_id }}"
{% if widget.attrs.disabled %}disabled{% endif %}>
</td>
</tr>
{% endif %}
<tr>
<th>{{ widget.input_text }}</th>
<td>
{% else %}
<tr>
<td colspan="2">
{% endif %}
<input type="{{ widget.type }}"
name="{{ widget.name }}"
{% include "django/forms/widgets/attrs.html" %}>
</td>
</tr>
</table>

View file

@ -1,43 +1,43 @@
{% load i18n %} {% load i18n %}
{% load main_extras %} {% load main_extras %}
{% block fields %} {% block fields %}
{% if form.non_field_errors %} {% if form.non_field_errors %}
<ul class='errorlist'> <ul class='errorlist'>
{% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %} {% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
</ul> </ul>
{% endif %} {% endif %}
<table> <table>
<tbody> <tbody>
{% for field in form %} {% for field in form %}
{% if field.errors %} {% if field.errors %}
<tr> <tr>
<td colspan="2">{{ field.errors }}</td> <td colspan="2">{{ field.errors }}</td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<th class="l"> <th class="l">
<label for="{{ field.id_for_label }}">{{ field.label }}</label> <label for="{{ field.id_for_label }}">{{ field.label }}</label>
</th> </th>
<td>{{ field }}</td> <td>{{ field }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot> <tfoot>
<tr class="buttons"> <tr class="buttons">
<td colspan="2"> <td colspan="2">
{% block buttons %} {% block buttons %}
{% if not form.instance|adding %} {% if not form.instance|adding %}
<a class="del" href="{{ form.instance.get_delete_url }}">{% translate "Delete" %}</a> <a class="del" href="{{ form.instance.get_delete_url }}">{% translate "Delete" %}</a>
{% endif %} {% endif %}
<input type="reset" value="{% translate "Reset" %}"> <input type="reset" value="{% translate "Reset" %}">
{% if form.instance|adding %} {% if form.instance|adding %}
<input type="submit" value="{% translate "Create" %}"> <input type="submit" value="{% translate "Create" %}">
{% else %} {% else %}
<input type="submit" value="{% translate "Save" %}"> <input type="submit" value="{% translate "Save" %}">
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
{% endblock %} {% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "main/form/form_base.html" %} {% extends "main/form/form_base.html" %}
{% load i18n %} {% load i18n %}
{% block buttons %} {% block buttons %}
<input hidden value="{{ next }}" name="next"> <input hidden value="{{ next }}" name="next">
<input type="reset"> <input type="reset">
<input type="submit" value="{% translate "Log in" %}"> <input type="submit" value="{% translate "Log in" %}">
{% endblock %} {% endblock %}

View file

@ -3,61 +3,63 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% js "main/js/index.js" %} {% js "main/js/index.js" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<div class="split"> <div class="split">
<section class="accounts"> <section class="accounts">
<h2>{% translate "Accounts" %}</h2> <h2>{% translate "Accounts" %}</h2>
<dl> <dl>
{% for acc in accounts %} {% for acc in accounts %}
<div class="account {% if acc.archived %}archived{% endif %}"> <div class="account {% if acc.archived %}archived{% endif %}">
<dt> <dt>
<a href="{{ acc.get_absolute_url }}">{{ acc.icon|remix }}{{ acc }}</a> <a href="{{ acc.get_absolute_url }}">{{ acc.icon|remix }}{{ acc }}</a>
</dt> </dt>
<dd> <dd>
{% if acc.statement_set.first %}{{ acc.statement_set.first.value|value }}{% endif %} {% if acc.statement_set.first %}{{ acc.statement_set.first.value|value }}{% endif %}
</dd> </dd>
</div> </div>
{% endfor %} {% endfor %}
<div class="more account"> <div class="more account">
<dt> <dt>
<label class="wi" for="show-archived-accounts">{{ "archive"|remix }}{% translate "Show archived" %}</label> <label class="wi" for="show-archived-accounts">
</dt> {{ "archive"|remix }}{% translate "Show archived" %}
<dd> </label>
<input type="checkbox" class="show-archived" id="show-archived-accounts" /> </dt>
</dd> <dd>
</div> <input type="checkbox" class="show-archived" id="show-archived-accounts" />
<div class="new account"> </dd>
<dt> </div>
<a href="{% url "new_account" %}">{{ "add-box"|remix }}{% translate "Create account" %}</a> <div class="new account">
</dt> <dt>
</div> <a href="{% url "new_account" %}">{{ "add-box"|remix }}{% translate "Create account" %}</a>
</dl> </dt>
</section> </div>
<section class="statements"> </dl>
<h2>{% translate "Statements" %}</h2>
{% include "statement/statement_table.html" %}
</section>
</div>
<section class="categories">
<h2>{% translate "Categories" %}</h2>
{% spaceless %}
<p>
{% for cat in categories %}
<a class="big-link" href="{{ cat.get_absolute_url }}">{{ cat.icon|remix }}{{ cat }}</a>
{% endfor %}
<a class="big-link add" href="{% url "new_category" %}">{{ "add"|remix }}{% translate "Create category" %}</a>
</p>
{% endspaceless %}
</section> </section>
{% if history %} <section class="statements">
<section> <h2>{% translate "Statements" %}</h2>
<h2>{% translate "History" %}</h2> {% include "statement/statement_table.html" %}
{% include "history/plot.html" %} </section>
</section> </div>
{% endif %} <section class="categories">
<h2>{% translate "Categories" %}</h2>
{% spaceless %}
<p>
{% for cat in categories %}
<a class="big-link" href="{{ cat.get_absolute_url }}">{{ cat.icon|remix }}{{ cat }}</a>
{% endfor %}
<a class="big-link add" href="{% url "new_category" %}">{{ "add"|remix }}{% translate "Create category" %}</a>
</p>
{% endspaceless %}
</section>
{% if history %}
<section>
<h2>{% translate "History" %}</h2>
{% include "history/plot.html" %}
</section>
{% endif %}
{% endblock %} {% endblock %}

View file

@ -3,45 +3,45 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block title %} {% block title %}
{% block name %}{% endblock %} {% block name %}{% endblock %}
{% if account %} {{ account }}{% endif %} {% if account %} {{ account }}{% endif %}
{% if category %} {{ category }}{% endif %} {% if category %} {{ category }}{% endif %}
{% if search %} {% if search %}
{% translate "Search" %} {% translate "Search" %}
{% endif %} {% endif %}
Nummi Nummi
{% endblock %} {% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2> <h2>
{% block h2 %}{% endblock %} {% block h2 %}{% endblock %}
</h2> </h2>
{% if account or category or search %} {% if account or category or search %}
<div class="backlinks"> <div class="backlinks">
{% block backlinks %} {% block backlinks %}
{% if account %} {% if account %}
<p> <p>
<a class="big-link" href="{{ account.get_absolute_url }}">{{ account.icon|remix }}{{ account }}</a> <a class="big-link" href="{{ account.get_absolute_url }}">{{ account.icon|remix }}{{ account }}</a>
</p> </p>
{% endif %} {% endif %}
{% if category %} {% if category %}
<p> <p>
<a class="big-link" href="{{ category.get_absolute_url }}">{{ category.icon|remix }}{{ category }}</a> <a class="big-link" href="{{ category.get_absolute_url }}">{{ category.icon|remix }}{{ category }}</a>
</p> </p>
{% endif %} {% endif %}
{% if search %} {% if search %}
<p> <p>
<a href="{% url "search" %}">{% translate "Search" %}</a> <a href="{% url "search" %}">{% translate "Search" %}</a>
</p> </p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</div> </div>
{% endif %} {% endif %}
{% include "main/pagination.html" %} {% include "main/pagination.html" %}
{% block table %}{% endblock %} {% block table %}{% endblock %}
{% include "main/pagination.html" %} {% include "main/pagination.html" %}
{% block body_more %}{% endblock %} {% block body_more %}{% endblock %}
{% endblock %} {% endblock %}

View file

@ -3,14 +3,14 @@
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/form.css" %} {% css "main/css/form.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>{% translate "Log in" %}</h2> <h2>{% translate "Log in" %}</h2>
<form action="{% url 'login' %}" method="post"> <form action="{% url 'login' %}" method="post">
{% csrf_token %} {% csrf_token %}
{% include "main/form/login.html" %} {% include "main/form/login.html" %}
</form> </form>
{% endblock %} {% endblock %}

View file

@ -1,32 +1,32 @@
{% load i18n transaction_extras %} {% load i18n transaction_extras %}
{% if page_obj %} {% if page_obj %}
<p class="pagination"> <p class="pagination">
{% for page in paginator.page_range %} {% for page in paginator.page_range %}
<a href="?page={{ page }}" <a href="?page={{ page }}"
{% if page == page_obj.number %}class="cur"{% endif %}>{{ page }}</a> {% if page == page_obj.number %}class="cur"{% endif %}>{{ page }}</a>
{% endfor %} {% endfor %}
</p> </p>
{% endif %} {% endif %}
{% if month %} {% if month %}
<p class="pagination">{% year_url month %}</p> <p class="pagination">{% year_url month %}</p>
<p class="pagination n3"> <p class="pagination n3">
{% if previous_month %} {% if previous_month %}
{% month_url previous_month fmt="F Y" %} {% month_url previous_month fmt="F Y" %}
{% endif %} {% endif %}
{% month_url month cls="cur" fmt="F Y" %} {% month_url month cls="cur" fmt="F Y" %}
{% if next_month %} {% if next_month %}
{% month_url next_month fmt="F Y" %} {% month_url next_month fmt="F Y" %}
{% endif %} {% endif %}
</p> </p>
{% endif %} {% endif %}
{% if year %} {% if year %}
<p class="pagination n3"> <p class="pagination n3">
{% if previous_year %} {% if previous_year %}
{% year_url previous_year cls="prev" %} {% year_url previous_year cls="prev" %}
{% endif %} {% endif %}
{% year_url year cls="cur" %} {% year_url year cls="cur" %}
{% if next_year %} {% if next_year %}
{% year_url next_year cls="next" %} {% year_url next_year cls="next" %}
{% endif %} {% endif %}
</p> </p>
{% endif %} {% endif %}

View file

@ -3,19 +3,19 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block title %} {% block title %}
{% translate "Search" %} Nummi {% translate "Search" %} Nummi
{% endblock %} {% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/form.css" %} {% css "main/css/form.css" %}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>{% translate "Search" %}</h2> <h2>{% translate "Search" %}</h2>
{% spaceless %} {% spaceless %}
<form id="search" method="post"> <form id="search" method="post">
{% csrf_token %} {% csrf_token %}
{{ form }} {{ form }}
</form> </form>
{% endspaceless %} {% endspaceless %}
{% endblock %} {% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "main/form/form_base.html" %} {% extends "main/form/form_base.html" %}
{% load i18n %} {% load i18n %}
{% block buttons %} {% block buttons %}
<input type="reset" /> <input type="reset" />
<input type="submit" value="{% translate "Search" %}" /> <input type="submit" value="{% translate "Search" %}" />
{% endblock %} {% endblock %}

View file

@ -1,5 +1,7 @@
{% extends "main/confirm_delete.html" %} {% extends "main/confirm_delete.html" %}
{% load i18n %} {% load i18n %}
{% block additionalinfo %} {% block additionalinfo %}
<p>{% blocktranslate %}This will delete all transactions in this statement.{% endblocktranslate %}</p> <p>
{% blocktranslate %}This will delete all transactions in this statement.{% endblocktranslate %}
</p>
{% endblock %} {% endblock %}

View file

@ -1,45 +1,47 @@
{% extends "main/base.html" %} {% extends "main/base.html" %}
{% load i18n main_extras statement_extras category %} {% load i18n main_extras statement_extras category %}
{% block title %} {% block title %}
{{ statement }} {{ statement }}
Nummi Nummi
{% endblock %} {% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/form.css" %} {% css "main/css/form.css" %}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>{{ statement }}</h2> <h2>{{ statement }}</h2>
<p> <p>
<a href="{{ account.get_absolute_url }}">{{ account.icon|remix }}{{ account }}</a> <a href="{{ account.get_absolute_url }}">{{ account.icon|remix }}{{ account }}</a>
</p> </p>
<p> <p>
<a href="{% url "edit_statement" statement.id %}">{{ "file-edit"|remix }}{% translate "Edit statement" %}</a> <a href="{% url "edit_statement" statement.id %}">{{ "file-edit"|remix }}{% translate "Edit statement" %}</a>
</p> </p>
<div class="statement-details"> <div class="statement-details">
<span> <span>
<span class="date">{{ statement.start_date|date:"Y-m-d" }}</span> <span class="date">{{ statement.start_date|date:"Y-m-d" }}</span>
<span class="value">{{ statement.start_value|value }}</span> <span class="value">{{ statement.start_value|value }}</span>
</span> </span>
<span> <span>
<span class="value">{{ statement.sum|pmvalue }}</span> <span class="value">{{ statement.sum|pmvalue }}</span>
{{ "arrow-right"|remix }} {{ "arrow-right"|remix }}
{% if statement.diff != statement.sum %}<span class="value">{{ statement.diff|pmvalue }}</span>{% endif %} {% if statement.diff != statement.sum %}
</span> <span class="value">{{ statement.diff|pmvalue }}</span>
<span> {% endif %}
<span class="date">{{ statement.date|date:"Y-m-d" }}</span> </span>
<span class="value">{{ statement.value|value }}</span> <span>
</span> <span class="date">{{ statement.date|date:"Y-m-d" }}</span>
{{ statement.sum|check:statement.diff }} <span class="value">{{ statement.value|value }}</span>
</div> </span>
<section> {{ statement.sum|check:statement.diff }}
<h3>{% translate "Transactions" %}</h3> </div>
{% include "transaction/transaction_table.html" %} <section>
</section> <h3>{% translate "Transactions" %}</h3>
<section> {% include "transaction/transaction_table.html" %}
<h3>{% translate "Categories" %}</h3> </section>
{% category_plot transactions budget=False statement=object %} <section>
</section> <h3>{% translate "Categories" %}</h3>
{% category_plot transactions budget=False statement=object %}
</section>
{% endblock %} {% endblock %}

View file

@ -1,15 +1,15 @@
{% extends "main/form/base.html" %} {% extends "main/form/base.html" %}
{% load i18n main_extras statement_extras category %} {% load i18n main_extras statement_extras category %}
{% block title_new %} {% block title_new %}
{% translate "Create statement" %} {% translate "Create statement" %}
{% endblock %} {% endblock %}
{% block h2_new %} {% block h2_new %}
{% translate "New statement" %} {% translate "New statement" %}
{% endblock %} {% endblock %}
{% block pre %} {% block pre %}
{% if not instance|adding %} {% if not instance|adding %}
<p> <p>
<a href="{{ instance.get_absolute_url }}">{{ "arrow-go-back"|remix }}{% translate "Back" %}</a> <a href="{{ instance.get_absolute_url }}">{{ "arrow-go-back"|remix }}{% translate "Back" %}</a>
</p> </p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -1,12 +1,12 @@
{% extends "main/list.html" %} {% extends "main/list.html" %}
{% load i18n %} {% load i18n %}
{% block name %} {% block name %}
{% translate "Statements" %} {% translate "Statements" %}
{% endblock %} {% endblock %}
{% block h2 %} {% block h2 %}
{% translate "Statements" %} {% translate "Statements" %}
{% endblock %} {% endblock %}
{% block table %} {% block table %}
{% url "new_statement" as new_statement_url %} {% url "new_statement" as new_statement_url %}
{% include "statement/statement_table.html" %} {% include "statement/statement_table.html" %}
{% endblock %} {% endblock %}

View file

@ -1,33 +1,33 @@
{% load i18n main_extras statement_extras %} {% load i18n main_extras statement_extras %}
<div id="statements"> <div id="statements">
<ul class="statements"> <ul class="statements">
{% if new_statement_url %} {% if new_statement_url %}
<li class="new"> <li class="new">
<span> <span>
<a href="{{ new_statement_url }}">{{ "file-add"|remix }}{% translate "Create statement" %}</a> <a href="{{ new_statement_url }}">{{ "file-add"|remix }}{% translate "Create statement" %}</a>
</span> </span>
</li> </li>
{% endif %}
{% for sta in statements %}
<li>
<a href="{{ sta.get_absolute_url }}" class="date"><span>{{ sta.date|date:"d" }}</span>
<span>{{ sta.date|date:"M y" }}</span></a>
<span class="value"><span>{{ sta.value|value }}</span>
<span>{{ sta.diff|pmvalue }}</span></span>
{% if not account %}
<span class="account">
<a href="{{ sta.account.get_absolute_url }}">{{ sta.account.icon|remix }}{{ sta.account }}</a>
</span>
{% endif %} {% endif %}
{% for sta in statements %} <span class="icon">{{ sta.sum|check:sta.diff }}</span>
<li> </li>
<a href="{{ sta.get_absolute_url }}" class="date"><span>{{ sta.date|date:"d" }}</span> {% endfor %}
<span>{{ sta.date|date:"M y" }}</span></a> {% if statements_url %}
<span class="value"><span>{{ sta.value|value }}</span> <li class="more">
<span>{{ sta.diff|pmvalue }}</span></span> <span>
{% if not account %} <a href="{{ statements_url }}">{{ "gallery-view"|remixnl }}{% translate "View all statements" %}</a>
<span class="account"> </span>
<a href="{{ sta.account.get_absolute_url }}">{{ sta.account.icon|remix }}{{ sta.account }}</a> </li>
</span> {% endif %}
{% endif %} </ul>
<span class="icon">{{ sta.sum|check:sta.diff }}</span>
</li>
{% endfor %}
{% if statements_url %}
<li class="more">
<span>
<a href="{{ statements_url }}">{{ "gallery-view"|remixnl }}{% translate "View all statements" %}</a>
</span>
</li>
{% endif %}
</ul>
</div> </div>

View file

@ -5,5 +5,5 @@
{% if widget.value != None %}value="{{ widget.value|stringformat:'s' }}"{% endif %} {% if widget.value != None %}value="{{ widget.value|stringformat:'s' }}"{% endif %}
{% include "django/forms/widgets/attrs.html" %}> {% include "django/forms/widgets/attrs.html" %}>
<datalist id="{{ widget.name }}-list"> <datalist id="{{ widget.name }}-list">
{% for option in widget.options %}<option value="{{ option }}"></option>{% endfor %} {% for option in widget.options %}<option value="{{ option }}"></option>{% endfor %}
</datalist> </datalist>

View file

@ -1,8 +1,8 @@
{% extends "main/form/base.html" %} {% extends "main/form/base.html" %}
{% load i18n %} {% load i18n %}
{% block title_new %} {% block title_new %}
{% translate "Create invoice" %} {% translate "Create invoice" %}
{% endblock %} {% endblock %}
{% block h2_new %} {% block h2_new %}
{% translate "New invoice" %} {% translate "New invoice" %}
{% endblock %} {% endblock %}

View file

@ -1,17 +1,17 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
<div id="invoices"> <div id="invoices">
<ul class="invoices"> <ul class="invoices">
{% for invoice in transaction.invoices %} {% for invoice in transaction.invoices %}
<li> <li>
<a class="title" href="{{ invoice.file.url }}">{{ "file"|remix }}{{ invoice.name }} [{{ invoice.file|extension }}]</a> <a class="title" href="{{ invoice.file.url }}">{{ "file"|remix }}{{ invoice.name }} [{{ invoice.file|extension }}]</a>
<a href="{{ invoice.get_absolute_url }}">{{ "file-edit"|remix }}{% translate "Edit" %}</a> <a href="{{ invoice.get_absolute_url }}">{{ "file-edit"|remix }}{% translate "Edit" %}</a>
</li> </li>
{% endfor %} {% endfor %}
<li class="new"> <li class="new">
<span> <span>
<a href="{% url "new_invoice" transaction.pk %}">{{ "file-add"|remix }}{% translate "New invoice" %}</a> <a href="{% url "new_invoice" transaction.pk %}">{{ "file-add"|remix }}{% translate "New invoice" %}</a>
</span> </span>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -1,28 +1,28 @@
{% extends "transaction/transaction_list.html" %} {% extends "transaction/transaction_list.html" %}
{% load i18n main_extras transaction_extras static category %} {% load i18n main_extras transaction_extras static category %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block name %}{{ month|date:"F Y"|capfirst }}{% endblock %} {% block name %}{{ month|date:"F Y"|capfirst }}{% endblock %}
{% block h2 %}{{ month|date:"F Y"|capfirst }}{% endblock %} {% block h2 %}{{ month|date:"F Y"|capfirst }}{% endblock %}
{% block backlinks %} {% block backlinks %}
{{ block.super }} {{ block.super }}
{% if account or category %} {% if account or category %}
<p class="back"> <p class="back">
<a href="{% url "transaction_month" month.year month.month %}">{% translate "Back" %}{{ "arrow-go-back"|remix }}</a> <a href="{% url "transaction_month" month.year month.month %}">{% translate "Back" %}{{ "arrow-go-back"|remix }}</a>
</p> </p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block table %} {% block table %}
{% if not category %} {% if not category %}
<section>
<h3>{% translate "Categories" %}</h3>
{% category_plot transactions month=month %}
</section>
{% endif %}
<section> <section>
<h3>{% translate "Transactions" %}</h3> <h3>{% translate "Categories" %}</h3>
{{ block.super }} {% category_plot transactions month=month %}
</section> </section>
{% endif %}
<section>
<h3>{% translate "Transactions" %}</h3>
{{ block.super }}
</section>
{% endblock %} {% endblock %}

View file

@ -1,34 +1,34 @@
{% extends "transaction/transaction_list.html" %} {% extends "transaction/transaction_list.html" %}
{% load i18n main_extras static category %} {% load i18n main_extras static category %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block name %}{{ year|date:"Y" }}{% endblock %} {% block name %}{{ year|date:"Y" }}{% endblock %}
{% block h2 %}{{ year|date:"Y" }}{% endblock %} {% block h2 %}{{ year|date:"Y" }}{% endblock %}
{% block backlinks %} {% block backlinks %}
{{ block.super }} {{ block.super }}
{% if account or category %} {% if account or category %}
<p class="back"> <p class="back">
<a href="{% url "transaction_year" year.year %}">{% translate "Back" %}{{ "arrow-go-back"|remix }}</a> <a href="{% url "transaction_year" year.year %}">{% translate "Back" %}{{ "arrow-go-back"|remix }}</a>
</p> </p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block table %} {% block table %}
{% if history %} {% if history %}
<section>
<h3>{% translate "History" %}</h3>
{% include "history/plot.html" %}
</section>
{% endif %}
{% if not category %}
<section>
<h3>{% translate "Categories" %}</h3>
{% category_plot transactions year=year %}
</section>
{% endif %}
<section> <section>
<h3>{% translate "Transactions" %}</h3> <h3>{% translate "History" %}</h3>
{{ block.super }} {% include "history/plot.html" %}
</section> </section>
{% endif %}
{% if not category %}
<section>
<h3>{% translate "Categories" %}</h3>
{% category_plot transactions year=year %}
</section>
{% endif %}
<section>
<h3>{% translate "Transactions" %}</h3>
{{ block.super }}
</section>
{% endblock %} {% endblock %}

View file

@ -2,43 +2,47 @@
{% load i18n %} {% load i18n %}
{% load main_extras %} {% load main_extras %}
{% block title %} {% block title %}
{{ transaction }} {{ transaction }}
Nummi Nummi
{% endblock %} {% endblock %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
{% css "main/css/form.css" %} {% css "main/css/form.css" %}
{% css "main/css/table.css" %} {% css "main/css/table.css" %}
{% css "main/css/plot.css" %} {% css "main/css/plot.css" %}
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>{{ transaction }}</h2> <h2>{{ transaction }}</h2>
<section class="transaction-details"> <section class="transaction-details">
<ul> <ul>
{% if statement %} {% if statement %}
<li> <li>
{% with statement.account as account %} {% with statement.account as account %}
<a href="{{ account.get_absolute_url }}">{{ account.icon|remix }}{{ account }}</a> <a href="{{ account.get_absolute_url }}">{{ account.icon|remix }}{{ account }}</a>
{% endwith %} {% endwith %}
<a href="{{ statement.get_absolute_url }}">{{ statement }}</a> <a href="{{ statement.get_absolute_url }}">{{ statement }}</a>
</li> </li>
{% endif %} {% endif %}
{% if category %} {% if category %}
<li> <li>
<a href="{{ category.get_absolute_url }}">{{ category.icon|remix }}{{ category }}</a> <a href="{{ category.get_absolute_url }}">{{ category.icon|remix }}{{ category }}</a>
</li> </li>
{% endif %} {% endif %}
{% if transaction.trader %}<li class="wi">{{ "p2p"|remix }}{{ transaction.trader }}</li>{% endif %} {% if transaction.trader %}
<li class="date wi">{{ "calendar"|remix }}{{ transaction.date }}</li> <li class="wi">{{ "p2p"|remix }}{{ transaction.trader }}</li>
<li class="value">{{ transaction.value|pmvalue }}</li> {% endif %}
</ul> <li class="date wi">{{ "calendar"|remix }}{{ transaction.date }}</li>
<p> <li class="value">{{ transaction.value|pmvalue }}</li>
<a href="{% url "edit_transaction" transaction.id %}">{{ "edit"|remix }}{% translate "Edit transaction" %}</a> </ul>
</p> <p>
{% if transaction.description %}<p class="description">{{ transaction.description|linebreaksbr }}</p>{% endif %} <a href="{% url "edit_transaction" transaction.id %}">{{ "edit"|remix }}{% translate "Edit transaction" %}</a>
</section> </p>
<section> {% if transaction.description %}
<h3>{% translate "Invoices" %}</h3> <p class="description">{{ transaction.description|linebreaksbr }}</p>
{% include "transaction/invoice_table.html" %} {% endif %}
</section> </section>
<section>
<h3>{% translate "Invoices" %}</h3>
{% include "transaction/invoice_table.html" %}
</section>
{% endblock %} {% endblock %}

View file

@ -2,20 +2,20 @@
{% load i18n %} {% load i18n %}
{% load main_extras %} {% load main_extras %}
{% block title_new %} {% block title_new %}
{% translate "Create transaction" %} {% translate "Create transaction" %}
{% endblock %} {% endblock %}
{% block h2_new %} {% block h2_new %}
{% translate "New transaction" %} {% translate "New transaction" %}
{% endblock %} {% endblock %}
{% block pre %} {% block pre %}
{% if statement %} {% if statement %}
<p> <p>
<a href="{{ statement.get_absolute_url }}">{{ statement }}</a> <a href="{{ statement.get_absolute_url }}">{{ statement }}</a>
</p> </p>
{% endif %} {% endif %}
{% if not instance|adding %} {% if not instance|adding %}
<p> <p>
<a href="{{ instance.get_absolute_url }}">{{ "arrow-go-back"|remix }}{% translate "Back" %}</a> <a href="{{ instance.get_absolute_url }}">{{ "arrow-go-back"|remix }}{% translate "Back" %}</a>
</p> </p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -1,12 +1,12 @@
{% extends "main/list.html" %} {% extends "main/list.html" %}
{% load i18n %} {% load i18n %}
{% block name %} {% block name %}
{% translate "Transactions" %} {% translate "Transactions" %}
{% endblock %} {% endblock %}
{% block h2 %} {% block h2 %}
{% translate "Transactions" %} {% translate "Transactions" %}
{% endblock %} {% endblock %}
{% block table %} {% block table %}
{% url "new_transaction" as new_transaction_url %} {% url "new_transaction" as new_transaction_url %}
{% include "transaction/transaction_table.html" %} {% include "transaction/transaction_table.html" %}
{% endblock %} {% endblock %}

View file

@ -1,93 +1,95 @@
{% load main_extras transaction_extras %} {% load main_extras transaction_extras %}
{% load i18n %} {% load i18n %}
<div id="transactions" class="table"> <div id="transactions" class="table">
<table class="full-width"> <table class="full-width">
<colgroup> <colgroup>
<col class="icon"> <col class="icon">
<col class="date"> <col class="date">
<col class="desc"> <col class="desc">
<col class="value"> <col class="value">
<col class="value"> <col class="value">
<col class="desc"> <col class="desc">
{% if not category %}<col class="desc">{% endif %} {% if not category %}<col class="desc">{% endif %}
{% if not account %}<col class="desc">{% endif %} {% if not account %}<col class="desc">{% endif %}
</colgroup> </colgroup>
<thead> <thead>
{% if new_transaction_url %} {% if new_transaction_url %}
<tr class="new"> <tr class="new">
<td colspan="{% tr_colspan %}"> <td colspan="{% tr_colspan %}">
<a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a> <a href="{{ new_transaction_url }}">{% translate "Create transaction" %}</a>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<th>{{ "attachment"|remix }}</th> <th>{{ "attachment"|remix }}</th>
<th>{% translate "Date" %}</th> <th>{% translate "Date" %}</th>
<th>{% translate "Name" %}</th> <th>{% translate "Name" %}</th>
<th>{% translate "Expenses" %}</th> <th>{% translate "Expenses" %}</th>
<th>{% translate "Income" %}</th> <th>{% translate "Income" %}</th>
<th>{% translate "Trader" %}</th> <th>{% translate "Trader" %}</th>
{% if not category %} {% if not category %}
<th>{% translate "Category" %}</th> <th>{% translate "Category" %}</th>
{% endif %}
{% if not account %}
<th>{% translate "Account" %}</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for trans in transactions %}
<tr>
<td class="c">
{% for invoice in trans.invoices %}<a class="i" href="{{ invoice.file.url }}">{{ "attachment"|remix }}</a>{% endfor %}
</td>
<td class="date">
<time datetime="{{ trans.date|date:"Y-m-d" }}">
{% if month %}
{{ trans.date|date:"l d"|capfirst }}
{% elif year %}
{{ trans.date|date:"d F" }}
{% else %}
{{ trans.date|date:"Y-m-d" }}
{% endif %}
</time>
</td>
<th scope="row" class="l">
<a href="{{ trans.get_absolute_url }}">{{ trans.name }}</a>
</th>
{% if trans.value >= 0 %}<td></td>{% endif %}
<td class="value">{{ trans.value|pmvalue }}</td>
{% if trans.value < 0 %}<td></td>{% endif %}
<td>{{ trans.trader|default_if_none:"" }}</td>
{% if not category %}
{% if trans.category %}
<td>
<a href="{{ trans.category.get_absolute_url }}">{{ trans.category.icon|remix }}{{ trans.category }}</a>
</td>
{% else %}
<td></td>
{% endif %}
{% endif %}
{% if not account %}
<td>
<a href="{{ trans.account.get_absolute_url }}">{{ trans.account.icon|remix }}{{ trans.account }}</a>
</td>
{% endif %}
</tr>
{% empty %}
<tr>
<td class="empty" colspan="{% tr_colspan %}">{% translate "No transaction" %}</td>
</tr>
{% endfor %}
</tbody>
{% if transactions_url %}
<tfoot>
<tr class="more">
<td colspan="{% tr_colspan %}">
<a href="{{ transactions_url }}">{% translate "View all transactions" %}</a>
</td>
</tr>
</tfoot>
{% endif %} {% endif %}
</table> {% if not account %}
<th>{% translate "Account" %}</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for trans in transactions %}
<tr>
<td class="c">
{% for invoice in trans.invoices %}
<a class="i" href="{{ invoice.file.url }}">{{ "attachment"|remix }}</a>
{% endfor %}
</td>
<td class="date">
<time datetime="{{ trans.date|date:"Y-m-d" }}">
{% if month %}
{{ trans.date|date:"l d"|capfirst }}
{% elif year %}
{{ trans.date|date:"d F" }}
{% else %}
{{ trans.date|date:"Y-m-d" }}
{% endif %}
</time>
</td>
<th scope="row" class="l">
<a href="{{ trans.get_absolute_url }}">{{ trans.name }}</a>
</th>
{% if trans.value >= 0 %}<td></td>{% endif %}
<td class="value">{{ trans.value|pmvalue }}</td>
{% if trans.value < 0 %}<td></td>{% endif %}
<td>{{ trans.trader|default_if_none:"" }}</td>
{% if not category %}
{% if trans.category %}
<td>
<a href="{{ trans.category.get_absolute_url }}">{{ trans.category.icon|remix }}{{ trans.category }}</a>
</td>
{% else %}
<td></td>
{% endif %}
{% endif %}
{% if not account %}
<td>
<a href="{{ trans.account.get_absolute_url }}">{{ trans.account.icon|remix }}{{ trans.account }}</a>
</td>
{% endif %}
</tr>
{% empty %}
<tr>
<td class="empty" colspan="{% tr_colspan %}">{% translate "No transaction" %}</td>
</tr>
{% endfor %}
</tbody>
{% if transactions_url %}
<tfoot>
<tr class="more">
<td colspan="{% tr_colspan %}">
<a href="{{ transactions_url }}">{% translate "View all transactions" %}</a>
</td>
</tr>
</tfoot>
{% endif %}
</table>
</div> </div>

4
pyproject.toml Normal file
View file

@ -0,0 +1,4 @@
[tool.djlint]
indent=2
max_blank_lines=1
max_line_length=89