From 6670a94890c1a0cd07bc203d3073b989174b7cf2 Mon Sep 17 00:00:00 2001 From: Noelle Leigh Date: Sat, 6 Nov 2021 13:15:05 -0400 Subject: [PATCH] jobs.submit_GET: make note input a textarea Since job notes can have multiple lines, their form input field was changed to a textarea. The number of rows displayed is determined by the number of lines in the note. --- buildsrht/blueprints/jobs.py | 2 ++ buildsrht/templates/submit.html | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/buildsrht/blueprints/jobs.py b/buildsrht/blueprints/jobs.py index 263af0d..0f267ea 100644 --- a/buildsrht/blueprints/jobs.py +++ b/buildsrht/blueprints/jobs.py @@ -171,6 +171,7 @@ def index(): def submit_GET(): manifest = session.pop("manifest", default=None) note = session.pop("note", default=None) + note_rows = len(note.splitlines()) if isinstance(note, str) else 1 status = 200 payment_required = requires_payment(current_user) if payment_required: @@ -178,6 +179,7 @@ def submit_GET(): return render_template("submit.html", manifest=manifest, note=note, + note_rows=note_rows, payment_required=payment_required), status def addsuffix(note: str, suffix: str) -> str: diff --git a/buildsrht/templates/submit.html b/buildsrht/templates/submit.html index 2e6f642..a01d0a6 100644 --- a/buildsrht/templates/submit.html +++ b/buildsrht/templates/submit.html @@ -62,13 +62,13 @@
- + rows="{{note_rows}}" + >{{note if note else ""}}