+ {{ limit_message }}
+ {{ _("Please retry after %(date)s.", date=breached_limit.reset_at | from_timestamp | datetimeformat("short") )}}
+
diff --git a/ihatemoney/forms.py b/ihatemoney/forms.py index 62f4f979..0ca6e557 100644 --- a/ihatemoney/forms.py +++ b/ihatemoney/forms.py @@ -295,7 +295,9 @@ class AuthenticationForm(FlaskForm): class AdminAuthenticationForm(FlaskForm): - admin_password = PasswordField(_("Admin password"), validators=[DataRequired()]) + admin_password = PasswordField( + _("Admin password"), validators=[DataRequired()], render_kw={"autofocus": True} + ) submit = SubmitField(_("Get in")) diff --git a/ihatemoney/run.py b/ihatemoney/run.py index 69b9b32f..88f49463 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -1,3 +1,4 @@ +from datetime import datetime import os import os.path import warnings @@ -21,6 +22,7 @@ from ihatemoney.utils import ( IhmJSONEncoder, PrefixedWSGI, em_surround, + limiter, locale_from_iso, localize_list, minimal_round, @@ -170,6 +172,7 @@ def create_app( app.register_blueprint(web_interface) app.register_blueprint(apiv1) app.register_error_handler(404, page_not_found) + limiter.init_app(app) # Configure the a, root="main"pplication setup_database(app) @@ -187,6 +190,7 @@ def create_app( app.jinja_env.filters["minimal_round"] = minimal_round app.jinja_env.filters["em_surround"] = lambda text: Markup(em_surround(text)) app.jinja_env.filters["localize_list"] = localize_list + app.jinja_env.filters["from_timestamp"] = datetime.fromtimestamp # Translations and time zone (used to display dates). The timezone is # taken from the BABEL_DEFAULT_TIMEZONE settings, and falls back to diff --git a/ihatemoney/static/css/main.css b/ihatemoney/static/css/main.css index 4c61fbea..e0d8e86e 100644 --- a/ihatemoney/static/css/main.css +++ b/ihatemoney/static/css/main.css @@ -310,6 +310,11 @@ footer .footer-left { background: url("../images/delete.png") no-repeat right; } +.bill-actions > form > .confirm.btn-danger { + outline-color: #c82333; + box-shadow: none; +} + .bill-actions > .edit { background: url("../images/edit.png") no-repeat right; } diff --git a/ihatemoney/static/favicon.ico b/ihatemoney/static/favicon.ico index 9db04f25..070642e3 100644 Binary files a/ihatemoney/static/favicon.ico and b/ihatemoney/static/favicon.ico differ diff --git a/ihatemoney/templates/layout.html b/ihatemoney/templates/layout.html index 67819adb..c99960eb 100644 --- a/ihatemoney/templates/layout.html +++ b/ihatemoney/templates/layout.html @@ -134,7 +134,14 @@
+ {{ limit_message }}
+ {{ _("Please retry after %(date)s.", date=breached_limit.reset_at | from_timestamp | datetimeformat("short") )}}
+