~comcloudway/builds.sr.ht

6670a94890c1a0cd07bc203d3073b989174b7cf2 — Noelle Leigh 2 years ago b5af172
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.
2 files changed, 5 insertions(+), 3 deletions(-)

M buildsrht/blueprints/jobs.py
M buildsrht/templates/submit.html
M buildsrht/blueprints/jobs.py => buildsrht/blueprints/jobs.py +2 -0
@@ 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:

M buildsrht/templates/submit.html => buildsrht/templates/submit.html +3 -3
@@ 62,13 62,13 @@
    </div>
    <div class="form-group">
      <label for="note">Add note</label>
      <input
        type="text"
      <textarea
        class="form-control"
        id="note"
        name="note"
        placeholder="Submitted on the web"
        value="{{note if note else ""}}" />
        rows="{{note_rows}}"
      >{{note if note else ""}}</textarea>
    </div>
    <div class="form-group">
      <a