From 715822e48f2e3623f6cac5aecebc946516b88380 Mon Sep 17 00:00:00 2001
From: "Edgar P. Burkhart" <git@edgarpierre.fr>
Date: Sat, 30 Dec 2023 10:18:17 +0100
Subject: [PATCH] Remove unused spaceless tags

---
 nummi/history/templates/history/plot.html | 142 +++++++++++-----------
 1 file changed, 69 insertions(+), 73 deletions(-)

diff --git a/nummi/history/templates/history/plot.html b/nummi/history/templates/history/plot.html
index 19d5060..1f0d858 100644
--- a/nummi/history/templates/history/plot.html
+++ b/nummi/history/templates/history/plot.html
@@ -18,60 +18,58 @@
             </tr>
         </thead>
         <tbody>
-            {% spaceless %}
-                {% for y in history.years reversed %}
-                    {% for date in y.d reversed %}
-                        {% ifchanged %}
-                            {% if date %}
-                                <tr {% if not date.month.month|divisibleby:"2" %}class="even"{% endif %}>
-                                    <td class="icon">
-                                        <span class="ri-{% if date.sum > 0 %}arrow-up-s-line green{% elif date.sum < 0 %}arrow-down-s-line red{% endif %}"></span>
-                                    </td>
-                                    <th class="date" scope="row">
-                                        {% if date.has_transactions %}
-                                            {% if account %}
-                                                <a href="{% url "account_transaction_month" account=account.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
-                                            {% elif category %}
-                                                <a href="{% url "category_transaction_month" category=category.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
-                                            {% else %}
-                                                <a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
-                                            {% endif %}
+            {% for y in history.years reversed %}
+                {% for date in y.d reversed %}
+                    {% ifchanged %}
+                        {% if date %}
+                            <tr {% if not date.month.month|divisibleby:"2" %}class="even"{% endif %}>
+                                <td class="icon">
+                                    <span class="ri-{% if date.sum > 0 %}arrow-up-s-line green{% elif date.sum < 0 %}arrow-down-s-line red{% endif %}"></span>
+                                </td>
+                                <th class="date" scope="row">
+                                    {% if date.has_transactions %}
+                                        {% if account %}
+                                            <a href="{% url "account_transaction_month" account=account.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
+                                        {% elif category %}
+                                            <a href="{% url "category_transaction_month" category=category.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
                                         {% else %}
-                                            {{ date.month|date:"Y-m" }}
+                                            <a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
                                         {% endif %}
-                                    </th>
-                                    <td class="value">{{ date.sum_m|pmrvalue }}</td>
-                                    <td class="bar m">
-                                        {% if date.sum_m %}
-                                            <div style="width: {% widthratio date.sum_m history.max -100 %}%"></div>
-                                        {% endif %}
-                                        {% if date.sum < 0 %}
-                                            <div class="tot" style="width:{% widthratio date.sum history.max -100 %}%">
-                                                <span>{{ date.sum|pmrvalue }}</span>
-                                            </div>
-                                        {% endif %}
-                                    </td>
-                                    <td class="bar p">
-                                        {% if date.sum_p %}
-                                            <div style="width: {% widthratio date.sum_p history.max 100 %}%"></div>
-                                        {% endif %}
-                                        {% if date.sum > 0 %}
-                                            <div class="tot" style="width:{% widthratio date.sum history.max 100 %}%">
-                                                <span>{{ date.sum|pmrvalue }}</span>
-                                            </div>
-                                        {% endif %}
-                                    </td>
-                                    <td class="value">{{ date.sum_p|pmrvalue }}</td>
-                                </tr>
-                            {% else %}
-                                <tr class="empty">
-                                    <td colspan="6" class="empty"></td>
-                                </tr>
-                            {% endif %}
-                        {% endifchanged %}
-                    {% endfor %}
+                                    {% else %}
+                                        {{ date.month|date:"Y-m" }}
+                                    {% endif %}
+                                </th>
+                                <td class="value">{{ date.sum_m|pmrvalue }}</td>
+                                <td class="bar m">
+                                    {% if date.sum_m %}
+                                        <div style="width: {% widthratio date.sum_m history.max -100 %}%"></div>
+                                    {% endif %}
+                                    {% if date.sum < 0 %}
+                                        <div class="tot" style="width:{% widthratio date.sum history.max -100 %}%">
+                                            <span>{{ date.sum|pmrvalue }}</span>
+                                        </div>
+                                    {% endif %}
+                                </td>
+                                <td class="bar p">
+                                    {% if date.sum_p %}
+                                        <div style="width: {% widthratio date.sum_p history.max 100 %}%"></div>
+                                    {% endif %}
+                                    {% if date.sum > 0 %}
+                                        <div class="tot" style="width:{% widthratio date.sum history.max 100 %}%">
+                                            <span>{{ date.sum|pmrvalue }}</span>
+                                        </div>
+                                    {% endif %}
+                                </td>
+                                <td class="value">{{ date.sum_p|pmrvalue }}</td>
+                            </tr>
+                        {% else %}
+                            <tr class="empty">
+                                <td colspan="6" class="empty"></td>
+                            </tr>
+                        {% endif %}
+                    {% endifchanged %}
                 {% endfor %}
-            {% endspaceless %}
+            {% endfor %}
         </tbody>
     </table>
 </div>
@@ -95,28 +93,26 @@
             </tr>
         </thead>
         <tbody>
-            {% spaceless %}
-                {% for year in history.years reversed %}
-                    <tr>
-                        <th>{{ year.y }}</th>
-                        {% for m in year.d %}
-                            {% if forloop.parentloop.last and forloop.first %}
-                                {% for _ in history.offset.0 %}<td></td>{% endfor %}
-                            {% endif %}
-                            {% if m %}
-                                <td class="{% if m.sum > 0 %}p{% else %}m{% endif %}"
-                                    style="opacity: calc( sin( abs({% widthratio m.sum history.years_max 100 %}) / 400 * 1turn ) )">
-                                </td>
-                            {% else %}
-                                <td></td>
-                            {% endif %}
-                            {% if forloop.parentloop.first and forloop.last %}
-                                {% for _ in history.offset.1 %}<td></td>{% endfor %}
-                            {% endif %}
-                        {% endfor %}
-                    </tr>
-                {% endfor %}
-            {% endspaceless %}
+            {% for year in history.years reversed %}
+                <tr>
+                    <th>{{ year.y }}</th>
+                    {% for m in year.d %}
+                        {% if forloop.parentloop.last and forloop.first %}
+                            {% for _ in history.offset.0 %}<td></td>{% endfor %}
+                        {% endif %}
+                        {% if m %}
+                            <td class="{% if m.sum > 0 %}p{% else %}m{% endif %}"
+                                style="opacity: calc( sin( abs({% widthratio m.sum history.years_max 100 %}) / 400 * 1turn ) )">
+                            </td>
+                        {% else %}
+                            <td></td>
+                        {% endif %}
+                        {% if forloop.parentloop.first and forloop.last %}
+                            {% for _ in history.offset.1 %}<td></td>{% endfor %}
+                        {% endif %}
+                    {% endfor %}
+                </tr>
+            {% endfor %}
         </tbody>
     </table>
 </div>
