From bb087d1492bf08e5d7f9e9c388b663d809c62447 Mon Sep 17 00:00:00 2001 From: Daniel Rahamim Date: Sat, 25 Feb 2023 12:49:16 -0800 Subject: [PATCH] 18 move between fields in form on return key (#35) * wip: return moves to next element in form * wip: move js to bottom and wrap * wip: add document ready string * wip: adding js script for functionality * wip: fix next field logic * chore: cleaning changes * feat: add auto focus to checkout page * chore: delete personal testing files --- src/invenflask/app.py | 2 +- src/invenflask/templates/base.html | 4 +- src/invenflask/templates/checkout.html | 73 ++++++++++++++++++-------- 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/src/invenflask/app.py b/src/invenflask/app.py index bc28437..f91479e 100644 --- a/src/invenflask/app.py +++ b/src/invenflask/app.py @@ -309,7 +309,7 @@ def checkout(): "Asset already checked out! Please check-in " "before checking out") return redirect(url_for('checkout')) - return render_template('checkout.html') + return render_template('checkout.html', load_checkout="onload='FocusOnLoad()'") @app.route('/checkin', methods=('GET', 'POST')) diff --git a/src/invenflask/templates/base.html b/src/invenflask/templates/base.html index 5bb8035..602ecee 100644 --- a/src/invenflask/templates/base.html +++ b/src/invenflask/templates/base.html @@ -56,9 +56,11 @@ + {% block head %} + {% endblock %} - +
{% for message in get_flashed_messages() %} diff --git a/src/invenflask/templates/checkout.html b/src/invenflask/templates/checkout.html index e1b9f64..d4da5f4 100644 --- a/src/invenflask/templates/checkout.html +++ b/src/invenflask/templates/checkout.html @@ -1,27 +1,54 @@ {% extends 'base.html' %} -{% block content %} -

{% block title %} Checkout Asset {% endblock %}

-
- -
- -
- -
- -
- -
- -
- -
+{% block head %} + + {% endblock %} +{% block content %} + +

{% block title %} Checkout Asset {% endblock %}

+
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+{% endblock %} \ No newline at end of file