From a3f28631df0b94487e320354212bd89147425306 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 22 Apr 2023 14:06:24 +0200 Subject: [PATCH] Create base template for lists --- nummi/main/static/main/css/page.css | 3 -- nummi/main/templates/main/list.html | 42 +++++++++++++++ .../templates/statement/statement_list.html | 40 +++----------- .../transaction/transaction_list.html | 52 +++---------------- 4 files changed, 54 insertions(+), 83 deletions(-) delete mode 100644 nummi/main/static/main/css/page.css create mode 100644 nummi/main/templates/main/list.html diff --git a/nummi/main/static/main/css/page.css b/nummi/main/static/main/css/page.css deleted file mode 100644 index 188aa6d..0000000 --- a/nummi/main/static/main/css/page.css +++ /dev/null @@ -1,3 +0,0 @@ -.pagination .current { - font-feature-settings: "tnum", "ss01"; -} diff --git a/nummi/main/templates/main/list.html b/nummi/main/templates/main/list.html new file mode 100644 index 0000000..1e9d53f --- /dev/null +++ b/nummi/main/templates/main/list.html @@ -0,0 +1,42 @@ +{% extends "main/base.html" %} +{% load static %} +{% load main_extras %} +{% load i18n %} +{% block title %} + {% block name %}{% endblock %} + {% if account %}– {{ account }}{% endif %} + {% if category %}– {{ category }}{% endif %} + {% if search %} + – {% translate "Search" %} + {% endif %} + – Nummi +{% endblock %} +{% block link %} + {{ block.super }} + +{% endblock %} +{% block body %} +

+ {% block h2 %}{% endblock %} +

+ {% if account %} +

+ {{ account.icon|remix }}{{ account }} +

+ {% endif %} + {% if category %} +

+ {{ category.icon|remix }}{{ category }} +

+ {% endif %} + {% if search %} +

+ {% translate "Search" %} +

+ {% endif %} + {% include "main/pagination.html" %} + {% block table %}{% endblock %} + {% include "main/pagination.html" %} +{% endblock %} diff --git a/nummi/statement/templates/statement/statement_list.html b/nummi/statement/templates/statement/statement_list.html index 3e4d97f..73bc595 100644 --- a/nummi/statement/templates/statement/statement_list.html +++ b/nummi/statement/templates/statement/statement_list.html @@ -1,39 +1,11 @@ -{% extends "main/base.html" %} -{% load static %} -{% load main_extras %} +{% extends "main/list.html" %} {% load i18n %} -{% block title %} +{% block name %} {% translate "Statements" %} - {% if account %}– {{ account }}{% endif %} - {% if category %}– {{ category }}{% endif %} - – Nummi {% endblock %} -{% block link %} - {{ block.super }} - - +{% block h2 %} + {% translate "Statements" %} {% endblock %} -{% block body %} -

{% translate "Statements" %}

- {% if account %} -

- {{ account.icon|remix }}{{ account }} -

- {% endif %} - {% if category %} -

- {{ category.icon|remix }}{{ category }} -

- {% endif %} - {% if statements %} - {% include "main/pagination.html" %} - {% include "statement/statement_table.html" %} - {% include "main/pagination.html" %} - {% else %} -

{% translate "No statements to show" %}

- {% endif %} +{% block table %} + {% include "statement/statement_table.html" %} {% endblock %} diff --git a/nummi/transaction/templates/transaction/transaction_list.html b/nummi/transaction/templates/transaction/transaction_list.html index 069e6aa..a7e8dea 100644 --- a/nummi/transaction/templates/transaction/transaction_list.html +++ b/nummi/transaction/templates/transaction/transaction_list.html @@ -1,51 +1,11 @@ -{% extends "main/base.html" %} -{% load static %} -{% load main_extras %} +{% extends "main/list.html" %} {% load i18n %} -{% block title %} +{% block name %} {% translate "Transactions" %} - {% if account %}– {{ account }}{% endif %} - {% if category %}– {{ category }}{% endif %} - {% if search %} - – {% translate "Search" %} - {% endif %} - – Nummi {% endblock %} -{% block link %} - {{ block.super }} - - +{% block h2 %} + {% translate "Transactions" %} {% endblock %} -{% block body %} -

- {% block h2 %} - {% translate "Transactions" %} - {% endblock %} -

- {% if account %} -

- {{ account.icon|remix }}{{ account }} -

- {% endif %} - {% if category %} -

- {{ category.icon|remix }}{{ category }} -

- {% endif %} - {% if search %} -

- {% translate "Search" %} -

- {% endif %} - {% if transactions %} - {% include "main/pagination.html" %} - {% include "transaction/transaction_table.html" %} - {% include "main/pagination.html" %} - {% else %} -

{% translate "No transactions to show" %}

- {% endif %} +{% block table %} + {% include "transaction/transaction_table.html" %} {% endblock %}