From 7f432f5bc5c12d77b366db9e199795125f75f94c Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <yohann.danello@gmail.com>
Date: Wed, 11 Mar 2020 20:59:15 +0100
Subject: [PATCH] Fix categories in front (fields weren't well named)

---
 templates/note/conso_form.html               | 14 +++++++-------
 templates/note/transactiontemplate_list.html |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/templates/note/conso_form.html b/templates/note/conso_form.html
index 2c2066e8..8945a919 100644
--- a/templates/note/conso_form.html
+++ b/templates/note/conso_form.html
@@ -58,16 +58,16 @@
             </div>
 
             {# Regroup buttons under categories #}
-            {% regroup transaction_templates by template_type as template_types %}
+            {% regroup transaction_templates by category as categories %}
 
             <div class="card border-primary text-center shadow mb-4">
                 {# Tabs for button categories #}
                 <div class="card-header">
                     <ul class="nav nav-tabs nav-fill card-header-tabs">
-                        {% for template_type in template_types %}
+                        {% for category in categories %}
                             <li class="nav-item">
-                                <a class="nav-link font-weight-bold" data-toggle="tab" href="#{{ template_type.grouper|slugify }}">
-                                    {{ template_type.grouper }}
+                                <a class="nav-link font-weight-bold" data-toggle="tab" href="#{{ category.grouper|slugify }}">
+                                    {{ category.grouper }}
                                 </a>
                             </li>
                         {% endfor %}
@@ -77,10 +77,10 @@
                 {# Tabs content #}
                 <div class="card-body">
                     <div class="tab-content">
-                        {% for template_type in template_types %}
-                            <div class="tab-pane" id="{{ template_type.grouper|slugify }}">
+                        {% for category in categories %}
+                            <div class="tab-pane" id="{{ category.grouper|slugify }}">
                                 <div class="d-inline-flex flex-wrap justify-content-center">
-                                    {% for button in template_type.list %}
+                                    {% for button in category.list %}
                                         <button class="btn btn-outline-dark rounded-0 flex-fill"
                                                 name="button" value="{{ button.name }}">
                                             {{ button.name }} ({{ button.amount | pretty_money }})
diff --git a/templates/note/transactiontemplate_list.html b/templates/note/transactiontemplate_list.html
index 62e4d164..49600236 100644
--- a/templates/note/transactiontemplate_list.html
+++ b/templates/note/transactiontemplate_list.html
@@ -15,7 +15,7 @@
     <td><a href="{{object.get_absolute_url}}">{{ object.name }}</a></td>
     <td>{{ object.destination }}</td>
     <td>{{ object.amount | pretty_money }}</td>
-    <td>{{ object.template_type }}</td>
+    <td>{{ object.category }}</td>
 </tr>
 {% endfor %}
 </table>
-- 
GitLab