aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/templates/dashboard.html
diff options
context:
space:
mode:
author0livd <github@destras.fr>2017-09-04 15:44:20 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2017-09-04 15:44:20 +0200
commit7a918c93498c2eb4f85b3b0198c03f3c2edf51fe (patch)
tree885fe498c3f27acb8fc73f5d37765c7e42669762 /ihatemoney/templates/dashboard.html
parentee1ecbf3e747daa711744a05027a667a302cc7e9 (diff)
downloadihatemoney-mirror-7a918c93498c2eb4f85b3b0198c03f3c2edf51fe.zip
ihatemoney-mirror-7a918c93498c2eb4f85b3b0198c03f3c2edf51fe.tar.gz
ihatemoney-mirror-7a918c93498c2eb4f85b3b0198c03f3c2edf51fe.tar.bz2
Enhance the dashboard. (#262)
* Update to a more flexible admin authentication * Admin can now access any project * Add delete and edit options in the dashboard * Add a link to the dashboard in the nav bar This is a rework of the changes proposed by @Olivd, so they can apply on top of the latest master without trouble. All credit goes to him for the code.
Diffstat (limited to 'ihatemoney/templates/dashboard.html')
-rw-r--r--ihatemoney/templates/dashboard.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/ihatemoney/templates/dashboard.html b/ihatemoney/templates/dashboard.html
index 3f50915..b1220bd 100644
--- a/ihatemoney/templates/dashboard.html
+++ b/ihatemoney/templates/dashboard.html
@@ -1,8 +1,8 @@
{% extends "layout.html" %}
{% block content %}
-
+{% if is_admin_dashboard_activated %}
<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></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') %}
<tr class="{{ loop.cycle("odd", "even") }}">
<td>{{ project.name }}</td><td>{{ project.members | count }}</td><td>{{ project.get_bills().count() }}</td>
@@ -13,9 +13,15 @@
<td></td>
<td></td>
{% endif %}
+ <td class="project-actions">
+ <a class="edit" href="{{ url_for(".edit_project", project_id=project.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a>
+ <a class="delete" href="{{ url_for(".delete_project", project_id=project.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a>
+ </td>
</tr>
{% endfor %}
</tbody>
</table>
+{% else %}
+<div class="alert alert-danger">{{ _("The Dashboard is currently deactivated.") }}</div>
+{% endif %}
{% endblock %}
-