diff --git a/budget/default_settings.py b/budget/default_settings.py index 5ee6de80..63878477 100644 --- a/budget/default_settings.py +++ b/budget/default_settings.py @@ -8,3 +8,7 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False SECRET_KEY = "tralala" MAIL_DEFAULT_SENDER = ("Budget manager", "budget@notmyidea.org") + +ADMIN_PASS = "" + +PUBLIC_PROJECT_CREATION = True diff --git a/budget/forms.py b/budget/forms.py index f4464751..f7fca9a8 100644 --- a/budget/forms.py +++ b/budget/forms.py @@ -83,6 +83,11 @@ class AuthenticationForm(FlaskForm): submit = SubmitField(_("Get in")) +class AdminAuthenticationForm(FlaskForm): + admin_pass = PasswordField(_("Admin password"), validators=[Required()]) + submit = SubmitField(_("Get in")) + + class PasswordReminder(FlaskForm): id = StringField(_("Project identifier"), validators=[Required()]) submit = SubmitField(_("Send me the code by email")) diff --git a/budget/templates/authenticate.html b/budget/templates/authenticate.html index 98914d09..d6fa3236 100644 --- a/budget/templates/authenticate.html +++ b/budget/templates/authenticate.html @@ -7,7 +7,13 @@ to") }} {{ _("create it") }}{{ _("?") }}
{% endif %} +{% if admin %} + +{% else %} +{% endif %} {% endblock %} diff --git a/budget/templates/forms.html b/budget/templates/forms.html index 01e54867..b56a59c6 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -45,6 +45,16 @@ {% endmacro %} +{% macro authenticate_admin(form) %} + + {% include "display_errors.html" %} + + {{ form.hidden_tag() }} + {{ input(form.admin_pass) }} + {{ submit(form.submit) }} + +{% endmacro %} + {% macro create_project(form, home=False) %} {% include "display_errors.html" %} diff --git a/budget/templates/home.html b/budget/templates/home.html index 399343a5..7caa6af5 100644 --- a/budget/templates/home.html +++ b/budget/templates/home.html @@ -5,7 +5,9 @@{{ _("You're sharing a house?") }}
{{ _("Going on holidays with friends?") }}
{{ _("Simply sharing money with others?") }}
{{ _("We can help!") }}