mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 20:51:49 +02:00
Rename ACTIVATE_DASHBOARD to ACTIVATE_ADMIN_DASHBOARD
This commit is contained in:
parent
59c94fe07e
commit
503bbff0c9
6 changed files with 7 additions and 7 deletions
|
@ -21,7 +21,7 @@ This document describes changes between each past release.
|
||||||
- Add a new setting to allow public project creation (ALLOW_PUBLIC_PROJECT_CREATION)
|
- Add a new setting to allow public project creation (ALLOW_PUBLIC_PROJECT_CREATION)
|
||||||
- With admin credentials, one can access every project
|
- With admin credentials, one can access every project
|
||||||
- Add delete and edit project actions in the dashboard
|
- Add delete and edit project actions in the dashboard
|
||||||
- Add a new setting to activate the dashboard (ACTIVATE_DASHBOARD)
|
- Add a new setting to activate the dashboard (ACTIVATE_ADMIN_DASHBOARD)
|
||||||
- Add a link to the dashboard in the navigation bar when it is activated
|
- Add a link to the dashboard in the navigation bar when it is activated
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
|
@ -15,4 +15,4 @@ ADMIN_PASSWORD = "pbkdf2:sha256:50000$jc3isZTD$b3be8d04ed5c2c1ac89d5eb777facc94a
|
||||||
|
|
||||||
ALLOW_PUBLIC_PROJECT_CREATION = True
|
ALLOW_PUBLIC_PROJECT_CREATION = True
|
||||||
|
|
||||||
ACTIVATE_DASHBOARD = False
|
ACTIVATE_ADMIN_DASHBOARD = False
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if is_dashboard_activated %}
|
{% if is_admin_dashboard_activated %}
|
||||||
<table id="bill_table" class="table table-striped">
|
<table id="bill_table" class="table table-striped">
|
||||||
<thead><tr><th>{{ _("Project") }}</th><th>{{ _("Number of members") }}</th><th>{{ _("Number of bills") }}</th><th>{{_("Newest bill")}}</th><th>{{_("Oldest bill")}}</th><th>{{_("Actions")}}</th></tr></thead>
|
<thead><tr><th>{{ _("Project") }}</th><th>{{ _("Number of members") }}</th><th>{{ _("Number of bills") }}</th><th>{{_("Newest bill")}}</th><th>{{_("Oldest bill")}}</th><th>{{_("Actions")}}</th></tr></thead>
|
||||||
<tbody>{% for project in projects|sort(attribute='name') %}
|
<tbody>{% for project in projects|sort(attribute='name') %}
|
||||||
|
|
|
@ -613,7 +613,7 @@ class BudgetTestCase(TestCase):
|
||||||
self.assertIn('<div class="alert alert-danger">', resp.data.decode('utf-8'))
|
self.assertIn('<div class="alert alert-danger">', resp.data.decode('utf-8'))
|
||||||
|
|
||||||
# test access to the dashboard when it is activated
|
# test access to the dashboard when it is activated
|
||||||
run.app.config['ACTIVATE_DASHBOARD'] = True
|
run.app.config['ACTIVATE_ADMIN_DASHBOARD'] = True
|
||||||
resp = self.app.post("/admin?goto=%2Fdashboard", data={'admin_password': 'adminpass'},
|
resp = self.app.post("/admin?goto=%2Fdashboard", data={'admin_password': 'adminpass'},
|
||||||
follow_redirects=True)
|
follow_redirects=True)
|
||||||
self.assertIn('<thead><tr><th>Project</th><th>Number of members', resp.data.decode('utf-8'))
|
self.assertIn('<thead><tr><th>Project</th><th>Number of members', resp.data.decode('utf-8'))
|
||||||
|
|
|
@ -517,6 +517,6 @@ def settle_bill():
|
||||||
@main.route("/dashboard")
|
@main.route("/dashboard")
|
||||||
@requires_admin()
|
@requires_admin()
|
||||||
def dashboard():
|
def dashboard():
|
||||||
is_dashboard_activated = current_app.config['ACTIVATE_DASHBOARD']
|
is_admin_dashboard_activated = current_app.config['ACTIVATE_ADMIN_DASHBOARD']
|
||||||
return render_template("dashboard.html", projects=Project.query.all(),
|
return render_template("dashboard.html", projects=Project.query.all(),
|
||||||
is_dashboard_activated=is_dashboard_activated)
|
is_admin_dashboard_activated=is_admin_dashboard_activated)
|
||||||
|
|
|
@ -93,7 +93,7 @@ properly.
|
||||||
+------------------------------+---------------------------+----------------------------------------------------------------------------------------+
|
+------------------------------+---------------------------+----------------------------------------------------------------------------------------+
|
||||||
| ALLOW_PUBLIC_PROJECT_CREATION| ``True`` | If set to `True`, everyone can create a project without entering the admin password |
|
| ALLOW_PUBLIC_PROJECT_CREATION| ``True`` | If set to `True`, everyone can create a project without entering the admin password |
|
||||||
+------------------------------+---------------------------+----------------------------------------------------------------------------------------+
|
+------------------------------+---------------------------+----------------------------------------------------------------------------------------+
|
||||||
| ACTIVATE_DASHBOARD | ``False`` | If set to `True`, the dashboard will become accessible entering the admin password |
|
| ACTIVATE_ADMIN_DASHBOARD | ``False`` | If set to `True`, the dashboard will become accessible entering the admin password |
|
||||||
+------------------------------+---------------------------+----------------------------------------------------------------------------------------+
|
+------------------------------+---------------------------+----------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
.. _`the SQLAlechemy documentation`: http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
|
.. _`the SQLAlechemy documentation`: http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
|
||||||
|
|
Loading…
Reference in a new issue