From 7f3b9c7b5c961d9398aeef9e00a15b10da29c056 Mon Sep 17 00:00:00 2001
From: "Edgar P. Burkhart" <git@edgarpierre.fr>
Date: Sat, 30 Dec 2023 10:38:30 +0100
Subject: [PATCH] Structure page content with sections

---
 .../templates/account/account_form.html       | 18 ++++--
 .../templates/category/category_form.html     | 12 ++--
 nummi/main/templates/main/index.html          | 58 +++++++++++--------
 .../templates/statement/statement_form.html   | 12 ++--
 .../transaction/transaction_form.html         |  6 +-
 5 files changed, 66 insertions(+), 40 deletions(-)

diff --git a/nummi/account/templates/account/account_form.html b/nummi/account/templates/account/account_form.html
index 7045203..eaba124 100644
--- a/nummi/account/templates/account/account_form.html
+++ b/nummi/account/templates/account/account_form.html
@@ -10,13 +10,19 @@
 {% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %}
 {% block tables %}
     {% if not form.instance|adding %}
-        <h3>{% translate "Statements" %}</h3>
-        {% include "statement/statement_table.html" %}
-        <h3>{% translate "Transactions" %}</h3>
-        {% include "transaction/transaction_table.html" %}
+        <section>
+            <h3>{% translate "Statements" %}</h3>
+            {% include "statement/statement_table.html" %}
+        </section>
+        <section>
+            <h3>{% translate "Transactions" %}</h3>
+            {% include "transaction/transaction_table.html" %}
+        </section>
         {% if history %}
-            <h3>{% translate "History" %}</h3>
-            {% include "history/plot.html" %}
+            <section>
+                <h3>{% translate "History" %}</h3>
+                {% include "history/plot.html" %}
+            </section>
         {% endif %}
     {% endif %}
 {% endblock %}
diff --git a/nummi/category/templates/category/category_form.html b/nummi/category/templates/category/category_form.html
index ed9e399..f4aaa6d 100644
--- a/nummi/category/templates/category/category_form.html
+++ b/nummi/category/templates/category/category_form.html
@@ -9,10 +9,14 @@
 {% endblock %}
 {% block h2 %}{{ form.instance.icon|remix }}{{ form.instance }}{% endblock %}
 {% block tables %}
-    <h3>{% translate "Transactions" %}</h3>
-    {% include "transaction/transaction_table.html" %}
+    <section>
+        <h3>{% translate "Transactions" %}</h3>
+        {% include "transaction/transaction_table.html" %}
+    </section>
     {% if history %}
-        <h3>{% translate "History" %}</h3>
-        {% include "history/plot.html" %}
+        <section>
+            <h3>{% translate "History" %}</h3>
+            {% include "history/plot.html" %}
+        </section>
     {% endif %}
 {% endblock %}
diff --git a/nummi/main/templates/main/index.html b/nummi/main/templates/main/index.html
index df0474b..d3fd7d7 100644
--- a/nummi/main/templates/main/index.html
+++ b/nummi/main/templates/main/index.html
@@ -12,36 +12,46 @@
           type="text/css">
 {% endblock %}
 {% block body %}
-    <h2>{% translate "Accounts" %}</h2>
-    <p>
-        {% for acc in accounts %}
-            <a class="big-link" href="{{ acc.get_absolute_url }}">{{ acc.icon|remix }}{{ acc }}</a>
-        {% empty %}
-            {% translate "No account" %}
-        {% endfor %}
-    </p>
+    <section>
+        <h2>{% translate "Accounts" %}</h2>
+        <p>
+            {% for acc in accounts %}
+                <a class="big-link" href="{{ acc.get_absolute_url }}">{{ acc.icon|remix }}{{ acc }}</a>
+            {% empty %}
+                {% translate "No account" %}
+            {% endfor %}
+        </p>
+    </section>
     {% if transactions %}
-        <h2>{% translate "Transactions" %}</h2>
-        {% include "transaction/transaction_table.html" %}
+        <section>
+            <h2>{% translate "Transactions" %}</h2>
+            {% include "transaction/transaction_table.html" %}
+        </section>
     {% endif %}
     {% if 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>
-                {% empty %}
-                    {% translate "No category" %}
-                {% endfor %}
-            </p>
-        {% endspaceless %}
+        <section>
+            <h2>{% translate "Categories" %}</h2>
+            {% spaceless %}
+                <p>
+                    {% for cat in categories %}
+                        <a class="big-link" href="{{ cat.get_absolute_url }}">{{ cat.icon|remix }}{{ cat }}</a>
+                    {% empty %}
+                        {% translate "No category" %}
+                    {% endfor %}
+                </p>
+            {% endspaceless %}
+        </section>
     {% endif %}
     {% if statements %}
-        <h2>{% translate "Statements" %}</h2>
-        {% include "statement/statement_table.html" %}
+        <section>
+            <h2>{% translate "Statements" %}</h2>
+            {% include "statement/statement_table.html" %}
+        </section>
     {% endif %}
     {% if history %}
-        <h2>{% translate "History" %}</h2>
-        {% include "history/plot.html" %}
+        <section>
+            <h2>{% translate "History" %}</h2>
+            {% include "history/plot.html" %}
+        </section>
     {% endif %}
 {% endblock %}
diff --git a/nummi/statement/templates/statement/statement_form.html b/nummi/statement/templates/statement/statement_form.html
index ef28ce5..b09e993 100644
--- a/nummi/statement/templates/statement/statement_form.html
+++ b/nummi/statement/templates/statement/statement_form.html
@@ -19,9 +19,13 @@
 {% endblock %}
 {% block tables %}
     {% if not form.instance|adding %}
-        <h3>{% translate "Categories" %}</h3>
-        {% category_plot transactions %}
-        <h3>{% translate "Transactions" %} ({{ form.instance.sum|pmvalue }} / {{ form.instance.diff|pmvalue }})</h3>
-        {% include "transaction/transaction_table.html" %}
+        <section>
+            <h3>{% translate "Categories" %}</h3>
+            {% category_plot transactions %}
+        </section>
+        <section>
+            <h3>{% translate "Transactions" %} ({{ form.instance.sum|pmvalue }} / {{ form.instance.diff|pmvalue }})</h3>
+            {% include "transaction/transaction_table.html" %}
+        </section>
     {% endif %}
 {% endblock %}
diff --git a/nummi/transaction/templates/transaction/transaction_form.html b/nummi/transaction/templates/transaction/transaction_form.html
index 75eb0d4..8674742 100644
--- a/nummi/transaction/templates/transaction/transaction_form.html
+++ b/nummi/transaction/templates/transaction/transaction_form.html
@@ -16,7 +16,9 @@
 {% endblock %}
 {% block tables %}
     {% if not form.instance|adding %}
-        <h3>{% translate "Invoices" %}</h3>
-        {% include "transaction/invoice_table.html" %}
+        <section>
+            <h3>{% translate "Invoices" %}</h3>
+            {% include "transaction/invoice_table.html" %}
+        </section>
     {% endif %}
 {% endblock %}
