aboutsummaryrefslogtreecommitdiff
path: root/budget/templates/home.html
diff options
context:
space:
mode:
author0livd <0livd@users.noreply.github.com>2017-05-18 10:48:09 +0100
committerAlexis Metaireau <alexis@notmyidea.org>2017-05-18 11:48:09 +0200
commitea8eda35a7bd831964c38b38cc9a5b19bcb44d6a (patch)
tree5a5efbe2523a1f8f84aec65c298a9b4fd6a9421e /budget/templates/home.html
parent091553be566d97816ed898207b56d2694eb2efdd (diff)
downloadihatemoney-mirror-ea8eda35a7bd831964c38b38cc9a5b19bcb44d6a.zip
ihatemoney-mirror-ea8eda35a7bd831964c38b38cc9a5b19bcb44d6a.tar.gz
ihatemoney-mirror-ea8eda35a7bd831964c38b38cc9a5b19bcb44d6a.tar.bz2
Public project creation and admin permissions (#210)
* Add a @requires_admin decorator It can be used to protect specific endpoints with ADMIN_PASSWORD (a password that is stored unencrypted in the settings) The decorator has no effect if ADMIN_PASSWORD is an empty string (default value) * Require admin permissions to access create project endpoint When ADMIN_PASSWORD is not empty, project creation form on the home page will be replaced by a link to the create project endpoint so one is able to enter the admin password before filling the form
Diffstat (limited to 'budget/templates/home.html')
-rw-r--r--budget/templates/home.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/budget/templates/home.html b/budget/templates/home.html
index edbee61..c7a9d1e 100644
--- a/budget/templates/home.html
+++ b/budget/templates/home.html
@@ -28,6 +28,9 @@
</form>
</div>
<div class="col-3 offset-md-1">
+ {% if is_admin_mode_enabled %}
+ <a href="{{ url_for(".create_project") }}">...{{ _("or create a new one") }}</a>
+ {% else %}
<form id="creation-form" class="form-horizontal" action="{{ url_for(".create_project") }}" method="post">
<fieldset class="form-group">
<legend>...{{ _("or create a new one") }}</legend>
@@ -37,6 +40,7 @@
<button class="btn" type="submit">{{ _("let's get started") }}</button>
</div>
</form>
+ {% endif %}
</main>
</div>
{% endblock %}