Reformat template files with djLint

This commit is contained in:
Edgar P. Burkhart 2022-12-25 16:24:40 +01:00
parent 3a31eec326
commit 16dba43810
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
12 changed files with 384 additions and 398 deletions

View File

@ -2,58 +2,66 @@
{% load i18n %} {% load i18n %}
<!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 %}</title> {% block title %}Nummi{% endblock %}
</title>
{% block link %} {% block link %}
<link rel="icon" href="{% static 'main/svg/logo.svg' %}" type="image/svg+xml" /> <link rel="icon"
<link rel="stylesheet" href="{% static 'main/css/main.css' %}" type="text/css" /> href="{% static 'main/svg/logo.svg' %}"
<link rel="stylesheet" href="{% static 'main/css/nav.css' %}" type="text/css" /> type="image/svg+xml"/>
<link rel="stylesheet" href="{% static 'main/fontawesome/css/all.min.css' %}" type="text/css" /> <link rel="stylesheet"
{% endblock %} href="{% static 'main/css/main.css' %}"
</head> type="text/css"/>
<body> <link rel="stylesheet"
{% block nav %} href="{% static 'main/css/nav.css' %}"
{% spaceless %} type="text/css"/>
<nav> <link rel="stylesheet"
<a href="{% url 'index' %}" href="{% static 'main/fontawesome/css/all.min.css' %}"
class="home{% if request.resolver_match.url_name == 'index' %} cur{% endif %}" type="text/css"/>
accesskey="h"> {% endblock %}
<img src="{% static 'main/svg/logo.svg' %}" alt="" />Nummi </head>
</a> <body>
<a href="{% url 'transaction' %}" {% block nav %}
class="{% if request.resolver_match.url_name == 'transaction' %}cur{% endif %}" {% spaceless %}
accesskey="n"> <nav>
{% translate "Transaction" %} <a href="{% url 'index' %}"
</a> class="home{% if request.resolver_match.url_name == 'index' %} cur{% endif %}"
<a href="{% url 'category' %}" accesskey="h">
class="{% if request.resolver_match.url_name == 'category' %}cur{% endif %}" <img src="{% static 'main/svg/logo.svg' %}" alt="" />
accesskey="c"> Nummi
{% translate "Category" %} </a>
</a> <a href="{% url 'transaction' %}"
<a href="{% url 'snapshot' %}" class="{% if request.resolver_match.url_name == 'transaction' %}cur{% endif %}"
class="{% if request.resolver_match.url_name == 'snapshot' %}cur{% endif %}" accesskey="n">
accesskey="s"> {% translate "Transaction" %}
{% translate "Snapshot" %} </a>
</a> <a href="{% url 'category' %}"
<form id="search" action="{% url 'search' %}" method="post"> class="{% if request.resolver_match.url_name == 'category' %}cur{% endif %}"
{% csrf_token %} accesskey="c">
<input type="text" name="search" placeholder="{% translate "Search" %}" {% if search %}value="{{ search }}"{% endif %} /> {% translate "Category" %}
<input type="submit" value="{% translate "Search" %}" /> </a>
</form> <a href="{% url 'snapshot' %}"
class="{% if request.resolver_match.url_name == 'snapshot' %}cur{% endif %}"
<a href="{% url 'logout' %}" accesskey="s">
class="logout" {% translate "Snapshot" %}
accesskey="l"> </a>
<i class="fa fa-right-from-bracket"></i> <form id="search" action="{% url 'search' %}" method="post">
</a> {% csrf_token %}
</nav> <input type="text"
{% endspaceless %} name="search"
{% endblock %} placeholder="{% translate "Search" %}"
{% block body %} {% if search %}value="{{ search }}"{% endif %}/>
{% endblock %} <input type="submit" value="{% translate "Search" %}" />
</body> </form>
<a href="{% url 'logout' %}" class="logout" accesskey="l">
<i class="fa fa-right-from-bracket"></i>
</a>
</nav>
{% endspaceless %}
{% endblock %}
{% block body %}{% endblock %}
</body>
</html> </html>

View File

@ -2,26 +2,28 @@
{% load static %} {% load static %}
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/form.css' %}" type="text/css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" /> href="{% static 'main/css/form.css' %}"
type="text/css"/>
<link rel="stylesheet"
href="{% static 'main/css/table.css' %}"
type="text/css"/>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1><i class="fa fa-{{ category.icon }}"></i> {{ category }}</h1> <h1>
<i class="fa fa-{{ category.icon }}"></i> {{ category }}
<form action="{% url 'category' category.id %}" method="post"> </h1>
{% csrf_token %} <form action="{% url 'category' category.id %}" method="post">
{{ form }} {% csrf_token %}
{% form_buttons category %} {{ form }}
</form> {% form_buttons category %}
</form>
{% if transactions %} {% if transactions %}
<img src="{% url "plot-category" category.id %}" alt="Graph representing value over time" /> <img src="{% url "plot-category" category.id %}"
alt="Graph representing value over time"/>
<h2>{% translate "Transactions" %}</h2> <h2>{% translate "Transactions" %}</h2>
{% transaction_table transactions %} {% transaction_table transactions %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -1,12 +1,10 @@
{% if form.non_field_errors %} {% if form.non_field_errors %}
<ul class='errorlist'> <ul class='errorlist'>
{% for error in form.non_field_errors %} {% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
<li>{{ error }}</li> </ul>
{% endfor %}
</ul>
{% endif %} {% endif %}
{% for field in form %} {% for field in form %}
{{ field.errors }} {{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label> <label for="{{ field.id_for_label }}">{{ field.label }}</label>
<div>{{ field }}</div> <div>{{ field }}</div>
{% endfor %} {% endfor %}

View File

@ -2,72 +2,69 @@
{% load static %} {% load static %}
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/index.css' %}" type="text/css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" /> href="{% static 'main/css/index.css' %}"
type="text/css"/>
<link rel="stylesheet"
href="{% static 'main/css/table.css' %}"
type="text/css"/>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% if transactions %} {% if transactions %}
<h2>{% translate "Transactions" %} <a href="{% url "transactions" %}"><i class="fa fa-magnifying-glass-plus"></i></a></h2> <h2>
{% transaction_table transactions %} {% translate "Transactions" %} <a href="{% url "transactions" %}"><i class="fa fa-magnifying-glass-plus"></i></a>
{% endif %} </h2>
{% transaction_table transactions %}
{% if categories %} {% endif %}
<h2>{% translate "Categories" %}</h2> {% if categories %}
<div id="categories"> <h2>{% translate "Categories" %}</h2>
{% for cat in categories %} <div id="categories">
<a href="{% url 'category' cat.id %}"><i class="fa fa-{{ cat.icon }}"></i>{{ cat }}</a> {% for cat in categories %}
{% endfor %} <a href="{% url 'category' cat.id %}"><i class="fa fa-{{ cat.icon }}"></i>{{ cat }}</a>
</div> {% endfor %}
{% endif %} </div>
{% endif %}
{% if snapshots %} {% if snapshots %}
<h2>{% translate "Snapshots" %}</h2> <h2>{% translate "Snapshots" %}</h2>
<div id="snapshots" class="table col1-5"> <div id="snapshots" class="table col1-5">
<div class="header"> <div class="header">
<strong class="attach center"><i class="fa fa-paperclip"></i></strong> <strong class="attach center"><i class="fa fa-paperclip"></i></strong>
<strong class="date center">{% translate "Date" %}</strong> <strong class="date center">{% translate "Date" %}</strong>
<strong class="value center">{% translate "Value" %}</strong> <strong class="value center">{% translate "Value" %}</strong>
<strong class="diff center">{% translate "Difference" %}</strong> <strong class="diff center">{% translate "Difference" %}</strong>
<strong class="diff center">{% translate "Transactions" %}</strong> <strong class="diff center">{% translate "Transactions" %}</strong>
<strong class="diff center">{% translate "Valid" %}</strong> <strong class="diff center">{% translate "Valid" %}</strong>
</div> </div>
{% for snap in snapshots %} {% for snap in snapshots %}
<div class="snapshot {% cycle 'w' 'g' %}"> <div class="snapshot {% cycle 'w' 'g' %}">
<span class="attach center"> <span class="attach center">
{% if snap.file %} {% if snap.file %}
<a href="{{ snap.file.url }}"> <a href="{{ snap.file.url }}">
<i class="fa fa-paperclip"></i> <i class="fa fa-paperclip"></i>
</a> </a>
{% endif %} {% endif %}
</span> </span>
<span class="date num center"> <span class="date num center">
<a href="{% url 'snapshot' snap.id %}">{{ snap.date|date:"Y-m-d" }}</a> <a href="{% url 'snapshot' snap.id %}">{{ snap.date|date:"Y-m-d" }}</a>
</span> </span>
<span class="value num right">{{ snap.value|value }}</span> <span class="value num right">{{ snap.value|value }}</span>
<span class="diff num right"> <span class="diff num right">{{ snap.diff|pmvalue }}</span>
{{ snap.diff|pmvalue }} {% with sum=snap.sum %}
</span> <span class="sum num right">{{ sum|pmvalue }}</span>
{% with sum=snap.sum %} <span class="valid center">
<span class="sum num right"> {% if snap.previous is not None %}
{{ sum|pmvalue }} {% if sum == snap.diff %}
</span> <i class="fa fa-check green"></i>
<span class="valid center"> {% else %}
{% if snap.previous is not None %} <i class="fa fa-xmark red"></i>
{% if sum == snap.diff %} {% endif %}
<i class="fa fa-check green"></i> {% endif %}
{% else %} </span>
<i class="fa fa-xmark red"></i> {% endwith %}
{% endif %} </div>
{% endif %} {% endfor %}
</span> </div>
{% endwith %} {% endif %}
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %} {% endblock %}

View File

@ -1,35 +1,30 @@
{% extends "main/base.html" %} {% extends "main/base.html" %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/form.css' %}" type="text/css" /> <link rel="stylesheet"
href="{% static 'main/css/form.css' %}"
type="text/css"/>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1>{% translate "Log In" %}</h1>
<h1>{% translate "Log In" %}</h1> <form action="{% url 'login' %}" method="post">
{% csrf_token %}
<form action="{% url 'login' %}" method="post"> {% if form.non_field_errors %}
{% csrf_token %} <ul class='errorlist'>
{% if form.non_field_errors %} {% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
<ul class='errorlist'> </ul>
{% for error in form.non_field_errors %} {% endif %}
<li>{{ error }}</li> {% for field in form %}
{% endfor %} {{ field.errors }}
</ul> <label for="{{ field.id_for_label }}">{{ field.label }}</label>
{% endif %} <div>{{ field }}</div>
{% for field in form %} {% endfor %}
{{ field.errors }} <div class="buttons">
<label for="{{ field.id_for_label }}">{{ field.label }}</label> <input hidden value="{{ next }}" name="next" />
<div>{{ field }}</div> <input type="reset" />
{% endfor %} <input type="submit" value="{% translate "Log In" %}" />
<div class="buttons"> </div>
<input hidden value="{{ next }}" name="next" /> </form>
<input type="reset" />
<input type="submit" value="{% translate "Log In" %}" />
</div>
</form>
{% endblock %} {% endblock %}

View File

@ -2,91 +2,81 @@
{% load static %} {% load static %}
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/form.css' %}" type="text/css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" /> href="{% static 'main/css/form.css' %}"
<link rel="stylesheet" href="{% static 'main/css/chart.css' %}" type="text/css" /> type="text/css"/>
<link rel="stylesheet"
href="{% static 'main/css/table.css' %}"
type="text/css"/>
<link rel="stylesheet"
href="{% static 'main/css/chart.css' %}"
type="text/css"/>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% with sum=snapshot.sum %} {% with sum=snapshot.sum %}
<h1> <h1>
{% if snapshot.previous is not None %} {% if snapshot.previous is not None %}
{% if sum == snapshot.diff %} {% if sum == snapshot.diff %}
<i class="fa fa-check green"></i> <i class="fa fa-check green"></i>
{% else %} {% else %}
<i class="fa fa-xmark red"></i> <i class="fa fa-xmark red"></i>
{% endif %} {% endif %}
{% endif %} {% endif %}
{{ snapshot }} {{ snapshot }}
</h1> </h1>
<form action="{% url 'snapshot' snapshot.id %}"
<form action="{% url 'snapshot' snapshot.id %}" method="post" enctype="multipart/form-data"> method="post"
{% csrf_token %} enctype="multipart/form-data">
{{ form }} {% csrf_token %}
{% form_buttons snapshot %} {{ form }}
</form> {% form_buttons snapshot %}
</form>
{% if categories %} {% if categories %}
<h2>{% translate "Categories" %}</h2> <h2>{% translate "Categories" %}</h2>
<div class="chart"> <div class="chart">
{% for cat in categories %} {% for cat in categories %}
<div class="name"> <div class="name">
{% if cat.category %} {% if cat.category %}
<i class="fa fa-{{ cat.category__icon }}"></i> <i class="fa fa-{{ cat.category__icon }}"></i>
<a href="{% url 'category' cat.category %}"> <a href="{% url 'category' cat.category %}">{{ cat.category__name }}</a>
{{ cat.category__name }} {% else %}
</a> <i class="fa fa-wallet"></i></i>
{% else %} {% endif %}
<i class="fa fa-wallet"></i></i> </div>
{% endif %} <div class="value left">{{ cat.sum_m|pmvalue }}</div>
</div> <div class="left">
<div class="value left"> <div class="bar bar_m"
{{ cat.sum_m|pmvalue }} style="width:{% widthratio cat.sum_m cat_lim_m 100 %}%"
</div> title="{{ cat.sum_m }}"></div>
<div class="left"> {% if cat.sum < 0 %}
<div <div class="bar tot"
class="bar bar_m" style="width:{% widthratio cat.sum cat_lim_m 100 %}%"
style="width:{% widthratio cat.sum_m cat_lim_m 100 %}%" title="{{ cat.sum }}">
title="{{ cat.sum_m }}"> <span>{{ cat.sum|pmvalue }}</span>
</div> </div>
{% if cat.sum < 0 %} {% endif %}
<div </div>
class="bar tot" <div class="right">
style="width:{% widthratio cat.sum cat_lim_m 100 %}%" <div class="bar bar_p"
title="{{ cat.sum }}"> style="width:{% widthratio cat.sum_p cat_lim 100 %}%"
<span>{{ cat.sum|pmvalue }}</span> title="{{ cat.sum_p }}"></div>
</div> {% if cat.sum >= 0 %}
{% endif %} <div class="bar tot"
</div> style="width:{% widthratio cat.sum cat_lim 100 %}%"
<div class="right"> title="{{ cat.sum }}">
<div <span>{{ cat.sum|pmvalue }}</span>
class="bar bar_p" </div>
style="width:{% widthratio cat.sum_p cat_lim 100 %}%" {% endif %}
title="{{ cat.sum_p }}"> </div>
</div> <div class="value right">{{ cat.sum_p|pmvalue }}</div>
{% if cat.sum >= 0 %} {% endfor %}
<div </div>
class="bar tot" {% endif %}
style="width:{% widthratio cat.sum cat_lim 100 %}%" {% if snapshot.transactions %}
title="{{ cat.sum }}"> <h2>{% translate "Transactions" %} ({{ sum|pmvalue }} / {{ snapshot.diff|pmvalue }})</h2>
<span>{{ cat.sum|pmvalue }}</span> {% transaction_table snapshot.transactions %}
</div> {% endif %}
{% endif %} {% endwith %}
</div> {% endblock %}
<div class="value right">
{{ cat.sum_p|pmvalue }}
</div>
{% endfor %}
</div>
{% endif %}
{% if snapshot.transactions %}
<h2>{% translate "Transactions" %} ({{ sum|pmvalue }} / {{ snapshot.diff|pmvalue }})</h2>
{% transaction_table snapshot.transactions %}
{% endif %}
{% endwith %}
{% endblock %}

View File

@ -1,15 +1,13 @@
{% load i18n %} {% load i18n %}
<div class="buttons"> <div class="buttons">
{% if not adding %} {% if not adding %}
{% translate "Delete" as del %} {% translate "Delete" as del %}
<a <a class="btn del"
class="btn del" onclick="return confirm('{{ del }} <{{ instance }}> ?')"
onclick="return confirm('{{ del }} <{{ instance}}> ?')" href="{% url del_url instance.id %}">
href="{% url del_url instance.id %}"> {{ del }}
{{ del }} </a>
</a> {% endif %}
<input type="reset" />
{% endif %} <input type="submit" value="{% translate 'Save' %}" />
<input type="reset" />
<input type="submit" value="{% translate 'Save' %}" />
</div> </div>

View File

@ -1,8 +1,9 @@
{% extends "main/tag/value.html" %} {% extends "main/tag/value.html" %}
{% block "value" %} {% block "value" %}
{% if value %} {% if value %}
{% if value > 0 %}+{% endif %} {% if value > 0 %}+{% endif %}
{{ block.super }} {{ block.super }}
{% else %}{% endif %} {% else %}
{% endif %}
{% endblock %} {% endblock %}

View File

@ -1,42 +1,39 @@
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
<div id="transactions" class="table col1-6"> <div id="transactions" class="table col1-6">
<div class="header"> <div class="header">
<strong class="attach center"><i class="fa fa-paperclip"></i></strong> <strong class="attach center"><i class="fa fa-paperclip"></i></strong>
<strong class="date center">{% translate "Date" %}</strong> <strong class="date center">{% translate "Date" %}</strong>
<strong class="name">{% translate "Name" %}</strong> <strong class="name">{% translate "Name" %}</strong>
<strong class="value center">{% translate "Value" %}</strong> <strong class="value center">{% translate "Value" %}</strong>
<strong class="trader center">{% translate "Trader" %}</strong> <strong class="trader center">{% translate "Trader" %}</strong>
<strong class="category center">{% translate "Category" %}</strong> <strong class="category center">{% translate "Category" %}</strong>
<strong class="description">{% translate "Description" %}</strong> <strong class="description">{% translate "Description" %}</strong>
</div> </div>
{% for trans in transactions %} {% for trans in transactions %}
<div class="transaction {% cycle 'w' 'g' %}"> <div class="transaction {% cycle 'w' 'g' %}">
<span class="attach center"> <span class="attach center">
{% for invoice in trans.invoices %} {% for invoice in trans.invoices %}
{% spaceless %} {% spaceless %}
<a href="{{ invoice.file.url }}"> <a href="{{ invoice.file.url }}">
<i class="fa fa-paperclip"></i> <i class="fa fa-paperclip"></i>
</a> </a>
{% endspaceless %} {% endspaceless %}
{% endfor %} {% endfor %}
</span> </span>
<span class="date num center">{{ trans.date|date:"Y-m-d" }}</span> <span class="date num center">{{ trans.date|date:"Y-m-d" }}</span>
<span class="name text"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span> <span class="name text"><a href="{% url 'transaction' trans.id %}">{{ trans.name }}</a></span>
<span class="value num right">{{ trans.value|pmvalue }}</span> <span class="value num right">{{ trans.value|pmvalue }}</span>
<span class="trader text center">{{ trans.trader|default_if_none:"" }}</span> <span class="trader text center">{{ trans.trader|default_if_none:"" }}</span>
<span class="category text center"> <span class="category text center">
{% if trans.category %} {% if trans.category %}
<i class="fa fa-{{ trans.category.icon }}"></i> <i class="fa fa-{{ trans.category.icon }}"></i>
<a href="{% url 'category' trans.category.id %}"> <a href="{% url 'category' trans.category.id %}">{{ trans.category }}</a>
{{ trans.category }} {% else %}
</a>
{% else %} {% endif %}
</span>
{% endif %} <span class="description text">{{ trans.description }}</span>
</span> </div>
<span class="description text">{{ trans.description }}</span> {% endfor %}
</div>
{% endfor %}
</div> </div>

View File

@ -1,7 +1,5 @@
{% spaceless %} {% spaceless %}
<span> <span>
{% block "value" %} {% block "value" %}{{ value }} €{% endblock %}
{{ value }} € </span>
{% endblock %}
</span>
{% endspaceless %} {% endspaceless %}

View File

@ -2,57 +2,62 @@
{% load static %} {% load static %}
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/form.css' %}" type="text/css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" /> href="{% static 'main/css/form.css' %}"
type="text/css"/>
<link rel="stylesheet"
href="{% static 'main/css/table.css' %}"
type="text/css"/>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1>{{ transaction }}</h1> <h1>{{ transaction }}</h1>
{% spaceless %}
{% spaceless %} <form id="transaction"
<form id="transaction" action="{% url 'transaction' transaction.id %}" method="post"> action="{% url 'transaction' transaction.id %}"
{% csrf_token %} method="post">
<input type="hidden" name="form" value="transaction" /> {% csrf_token %}
{{ form }} <input type="hidden" name="form" value="transaction" />
{% form_buttons transaction %} {{ form }}
</form> {% form_buttons transaction %}
{% endspaceless %} </form>
{% endspaceless %}
<div class="split"> <div class="split">
{% if transaction.has_invoice %} {% if transaction.has_invoice %}
<div> <div>
<h2>{% translate "Invoices" %}</h2> <h2>{% translate "Invoices" %}</h2>
<div id="invoices" class="table col1-1-1"> <div id="invoices" class="table col1-1-1">
<div class="header"> <div class="header">
<strong class="attach center"><i class="fa fa-file"></i></strong> <strong class="attach center"><i class="fa fa-file"></i></strong>
<strong class="name">{% translate "Name" %}</strong> <strong class="name">{% translate "Name" %}</strong>
<strong class="attach center"><i class="fa fa-trash-can"></i></strong> <strong class="attach center"><i class="fa fa-trash-can"></i></strong>
</div> </div>
{% for inv in transaction.invoices %} {% for inv in transaction.invoices %}
<div class="invoice"> <div class="invoice">
<a href="{{ inv.file.url }}"><i class="fa-regular fa-file"></i></a> <a href="{{ inv.file.url }}"><i class="fa-regular fa-file"></i></a>
<a href="{{ inv.file.url }}">{{ inv.name }}</a> <a href="{{ inv.file.url }}">{{ inv.name }}</a>
<a href="{% url 'del_invoice' transaction.id inv.id %}" <a href="{% url 'del_invoice' transaction.id inv.id %}"
onclick="return confirm('{% translate "Delete" %} <{{ inv.name }}> ?')"> onclick="return confirm('{% translate "Delete" %} <{{ inv.name }}> ?')">
<i class="fa-regular fa-trash-can"></i> <i class="fa-regular fa-trash-can"></i>
</a> </a>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% endif %} {% endif %}
<div>
<div> <h3>{% translate "Add invoice" %}</h3>
<h3>{% translate "Add invoice" %}</h3> <form action="{% url 'transaction' transaction.id %}"
<form action="{% url 'transaction' transaction.id %}" method="post" enctype="multipart/form-data"> method="post"
{% csrf_token %} enctype="multipart/form-data">
<input type="hidden" name="form" value="invoice" /> {% csrf_token %}
{{ invoice_form }} <input type="hidden" name="form" value="invoice" />
<div class="buttons"><input class="btn" type="submit" value="{% translate "Add" %}" /></div> {{ invoice_form }}
</form> <div class="buttons">
</div> <input class="btn" type="submit" value="{% translate "Add" %}" />
</div> </div>
{% endblock %} </form>
</div>
</div>
{% endblock %}

View File

@ -2,34 +2,31 @@
{% load static %} {% load static %}
{% load main_extras %} {% load main_extras %}
{% load i18n %} {% load i18n %}
{% block link %} {% block link %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" href="{% static 'main/css/table.css' %}" type="text/css" /> <link rel="stylesheet"
<link rel="stylesheet" href="{% static 'main/css/page.css' %}" type="text/css" /> href="{% static 'main/css/table.css' %}"
type="text/css"/>
<link rel="stylesheet"
href="{% static 'main/css/page.css' %}"
type="text/css"/>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1>{% translate "Transactions" %}</h1> <h1>{% translate "Transactions" %}</h1>
{% transaction_table transactions %} {% transaction_table transactions %}
{% if page_obj %}
{% if page_obj %} <div class="pagination">
<div class="pagination"> <span class="step-links">
<span class="step-links"> {% if page_obj.has_previous %}
{% if page_obj.has_previous %} <a href="?page=1"></a>
<a href="?page=1"></a> <a href="?page={{ page_obj.previous_page_number }}"></a>
<a href="?page={{ page_obj.previous_page_number }}"></a> {% endif %}
{% endif %} <span class="current">{{ page_obj.number }}/{{ page_obj.paginator.num_pages }}</span>
{% if page_obj.has_next %}
<span class="current"> <a href="?page={{ page_obj.next_page_number }}"></a>
{{ page_obj.number }}/{{ page_obj.paginator.num_pages }} <a href="?page={{ page_obj.paginator.num_pages }}"></a>
</span> {% endif %}
</span>
{% if page_obj.has_next %} </div>
<a href="?page={{ page_obj.next_page_number }}"></a> {% endif %}
<a href="?page={{ page_obj.paginator.num_pages }}"></a>
{% endif %}
</span>
</div>
{% endif %}
{% endblock %} {% endblock %}