diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 6ae16805..c913cd5c 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -20,6 +20,7 @@ This document describes changes between each past release.
- With admin credentials, one can access every project
- Add delete and edit project actions in the dashboard
- Add a new setting to activate the dashboard (ACTIVATE_DASHBOARD)
+- Add a link to the dashboard in the navigation bar when it is activated
### Removed
diff --git a/budget/templates/layout.html b/budget/templates/layout.html
index 6ecff413..bb4153d0 100644
--- a/budget/templates/layout.html
+++ b/budget/templates/layout.html
@@ -70,6 +70,9 @@
{% endif %}
fr
en
+ {% if g.is_dashboard_activated %}
+ {{ _("Dashboard") }}
+ {% endif %}
diff --git a/budget/web.py b/budget/web.py
index 0d00cd11..e97857d4 100644
--- a/budget/web.py
+++ b/budget/web.py
@@ -68,6 +68,14 @@ def add_project_id(endpoint, values):
values['project_id'] = g.project.id
+@main.url_value_preprocessor
+def set_is_dashboard_activated(endpoint, values):
+ """Set is_dashboard_activated application wide
+ so this variable can be used in the layout template
+ """
+ g.is_dashboard_activated = current_app.config["ACTIVATE_DASHBOARD"]
+
+
@main.url_value_preprocessor
def pull_project(endpoint, values):
"""When a request contains a project_id value, transform it directly