Skip to content
Snippets Groups Projects
Commit 7f432f5b authored by ynerant's avatar ynerant
Browse files

Fix categories in front (fields weren't well named)

parent 1f004191
No related branches found
No related tags found
1 merge request!57Page de consommations
...@@ -58,16 +58,16 @@ ...@@ -58,16 +58,16 @@
</div> </div>
{# Regroup buttons under categories #} {# 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"> <div class="card border-primary text-center shadow mb-4">
{# Tabs for button categories #} {# Tabs for button categories #}
<div class="card-header"> <div class="card-header">
<ul class="nav nav-tabs nav-fill card-header-tabs"> <ul class="nav nav-tabs nav-fill card-header-tabs">
{% for template_type in template_types %} {% for category in categories %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link font-weight-bold" data-toggle="tab" href="#{{ template_type.grouper|slugify }}"> <a class="nav-link font-weight-bold" data-toggle="tab" href="#{{ category.grouper|slugify }}">
{{ template_type.grouper }} {{ category.grouper }}
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
...@@ -77,10 +77,10 @@ ...@@ -77,10 +77,10 @@
{# Tabs content #} {# Tabs content #}
<div class="card-body"> <div class="card-body">
<div class="tab-content"> <div class="tab-content">
{% for template_type in template_types %} {% for category in categories %}
<div class="tab-pane" id="{{ template_type.grouper|slugify }}"> <div class="tab-pane" id="{{ category.grouper|slugify }}">
<div class="d-inline-flex flex-wrap justify-content-center"> <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" <button class="btn btn-outline-dark rounded-0 flex-fill"
name="button" value="{{ button.name }}"> name="button" value="{{ button.name }}">
{{ button.name }} ({{ button.amount | pretty_money }}) {{ button.name }} ({{ button.amount | pretty_money }})
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<td><a href="{{object.get_absolute_url}}">{{ object.name }}</a></td> <td><a href="{{object.get_absolute_url}}">{{ object.name }}</a></td>
<td>{{ object.destination }}</td> <td>{{ object.destination }}</td>
<td>{{ object.amount | pretty_money }}</td> <td>{{ object.amount | pretty_money }}</td>
<td>{{ object.template_type }}</td> <td>{{ object.category }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment