aboutsummaryrefslogtreecommitdiff
path: root/budget
diff options
context:
space:
mode:
Diffstat (limited to 'budget')
-rw-r--r--budget/templates/layout.html4
-rw-r--r--budget/templates/settle_bills.html5
-rw-r--r--budget/web.py9
3 files changed, 9 insertions, 9 deletions
diff --git a/budget/templates/layout.html b/budget/templates/layout.html
index 543bcb3..ccf958f 100644
--- a/budget/templates/layout.html
+++ b/budget/templates/layout.html
@@ -42,8 +42,8 @@
{% if g.project %}
<ul class="nav primary-nav">
{% block navbar %}
- <li class="active"><a href="{{ url_for(".list_bills") }}">{{ _("Bills") }}</a></li>
- <li><a href="{{ url_for(".settle_bill") }}">{{ _("Settle") }}</a></li>
+ <li class="nav-item{% if current_view == 'list_bills' %} active{% endif %}"><a class="nav-link" href="{{ url_for(".list_bills") }}">{{ _("Bills") }}</a></li>
+ <li class="nav-item{% if current_view == 'settle_bill' %} active{% endif %}"><a class="nav-link" href="{{ url_for(".settle_bill") }}">{{ _("Settle") }}</a></li>
{% endblock %}
</ul>
{% endif %}
diff --git a/budget/templates/settle_bills.html b/budget/templates/settle_bills.html
index 16c60b3..8a9f733 100644
--- a/budget/templates/settle_bills.html
+++ b/budget/templates/settle_bills.html
@@ -1,10 +1,5 @@
{% extends "layout.html" %}
-{% block navbar %}
-<li><a href="{{ url_for(".list_bills") }}">{{ _("Bills") }}</a></li>
-<li class="active"><a href="{{ url_for(".settle_bill") }}">{{ _("Settle") }}</a></li>
-{% endblock %}
-
{% block sidebar %}
<div id="sidebar" class="sidebar">
diff --git a/budget/web.py b/budget/web.py
index 67ff31f..28ed344 100644
--- a/budget/web.py
+++ b/budget/web.py
@@ -284,7 +284,8 @@ def list_bills():
return render_template("list_bills.html",
bills=bills, member_form=MemberForm(g.project),
bill_form=bill_form,
- add_bill=request.values.get('add_bill', False)
+ add_bill=request.values.get('add_bill', False),
+ current_view="list_bills",
)
@@ -414,7 +415,11 @@ def change_lang(lang):
def settle_bill():
"""Compute the sum each one have to pay to each other and display it"""
bills = g.project.get_transactions_to_settle_bill()
- return render_template("settle_bills.html", bills=bills)
+ return render_template(
+ "settle_bills.html",
+ bills=bills,
+ current_view='settle_bill',
+ )
@main.route("/<project_id>/archives/create", methods=["GET", "POST"])