From 47d8ff0382aaacd7bbd87d1e5110dbf246b9633d Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 30 Dec 2023 10:54:01 +0100 Subject: [PATCH] Create tag for css imports --- nummi/main/templates/main/base.html | 5 +++-- nummi/main/templates/main/confirm_delete.html | 8 ++------ nummi/main/templates/main/form/base.html | 12 +++--------- nummi/main/templates/main/index.html | 8 ++------ nummi/main/templates/main/list.html | 4 +--- nummi/main/templates/main/login.html | 8 ++------ nummi/main/templatetags/main_extras.py | 8 ++++++++ nummi/search/templates/search/search.html | 8 ++------ .../transaction/transaction_archive_month.html | 4 +--- 9 files changed, 24 insertions(+), 41 deletions(-) diff --git a/nummi/main/templates/main/base.html b/nummi/main/templates/main/base.html index 6c60492..e725fcc 100644 --- a/nummi/main/templates/main/base.html +++ b/nummi/main/templates/main/base.html @@ -1,5 +1,6 @@ {% load static %} {% load i18n %} +{% load main_extras %} @@ -10,8 +11,8 @@ {% block link %} - - + {% css "main/css/main.css" %} + {% css "main/remixicon/remixicon.css" %} {% endblock %} diff --git a/nummi/main/templates/main/confirm_delete.html b/nummi/main/templates/main/confirm_delete.html index 7ad791e..19dd77b 100644 --- a/nummi/main/templates/main/confirm_delete.html +++ b/nummi/main/templates/main/confirm_delete.html @@ -4,12 +4,8 @@ {% load i18n %} {% block link %} {{ block.super }} - - + {% css "main/css/form.css" %} + {% css "main/css/table.css" %} {% endblock %} {% block body %} {% spaceless %} diff --git a/nummi/main/templates/main/form/base.html b/nummi/main/templates/main/form/base.html index 65c6f6e..e2b273e 100644 --- a/nummi/main/templates/main/form/base.html +++ b/nummi/main/templates/main/form/base.html @@ -12,15 +12,9 @@ {% endblock %} {% block link %} {{ block.super }} - - - + {% css "main/css/form.css" %} + {% css "main/css/table.css" %} + {% css "main/css/plot.css" %} {% endblock %} {% block body %} {% with instance=form.instance %} diff --git a/nummi/main/templates/main/index.html b/nummi/main/templates/main/index.html index d3fd7d7..3f56a84 100644 --- a/nummi/main/templates/main/index.html +++ b/nummi/main/templates/main/index.html @@ -4,12 +4,8 @@ {% load i18n %} {% block link %} {{ block.super }} - - + {% css "main/css/table.css" %} + {% css "main/css/plot.css" %} {% endblock %} {% block body %}
diff --git a/nummi/main/templates/main/list.html b/nummi/main/templates/main/list.html index aa90d98..ee3050e 100644 --- a/nummi/main/templates/main/list.html +++ b/nummi/main/templates/main/list.html @@ -13,9 +13,7 @@ {% endblock %} {% block link %} {{ block.super }} - + {% css "main/css/table.css" %} {% endblock %} {% block body %}

diff --git a/nummi/main/templates/main/login.html b/nummi/main/templates/main/login.html index ab579cb..83258a1 100644 --- a/nummi/main/templates/main/login.html +++ b/nummi/main/templates/main/login.html @@ -3,12 +3,8 @@ {% load i18n %} {% block link %} {{ block.super }} - - + {% css "main/css/table.css" %} + {% css "main/css/form.css" %} {% endblock %} {% block body %}

{% translate "Log in" %}

diff --git a/nummi/main/templatetags/main_extras.py b/nummi/main/templatetags/main_extras.py index 6b57178..a85d8db 100644 --- a/nummi/main/templatetags/main_extras.py +++ b/nummi/main/templatetags/main_extras.py @@ -1,4 +1,5 @@ from django import template +from django.templatetags.static import static from django.utils import formats from django.utils.safestring import mark_safe @@ -59,3 +60,10 @@ def verbose_name(obj): @register.filter def adding(obj): return obj._state.adding + + +@register.simple_tag +def css(href): + return mark_safe( + f"""""" + ) diff --git a/nummi/search/templates/search/search.html b/nummi/search/templates/search/search.html index 33e5ba1..18ecdc8 100644 --- a/nummi/search/templates/search/search.html +++ b/nummi/search/templates/search/search.html @@ -7,12 +7,8 @@ {% endblock %} {% block link %} {{ block.super }} - - + {% css "main/css/form.css" %} + {% css "main/css/table.css" %} {% endblock %} {% block body %}

{% translate "Search" %}

diff --git a/nummi/transaction/templates/transaction/transaction_archive_month.html b/nummi/transaction/templates/transaction/transaction_archive_month.html index 3f5dc1b..0b72f35 100644 --- a/nummi/transaction/templates/transaction/transaction_archive_month.html +++ b/nummi/transaction/templates/transaction/transaction_archive_month.html @@ -2,9 +2,7 @@ {% load i18n static category %} {% block link %} {{ block.super }} - + {% css "main/css/plot.css" %} {% endblock %} {% block h2 %}{{ month|date:"F Y"|capfirst }}{% endblock %} {% block table %}