Add amount field to job creation — auto-creates bracket when > 1

Amount > 1 with no bracket selected: auto-creates a bracket named
'{customer} – {file} ×{amount}', assigns all jobs to it, and redirects
to the new bracket page. Amount = 1 behaves as before.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Hohenberg
2026-06-18 22:06:35 +02:00
parent 4c7acb1c52
commit dc73c9a8c1
2 changed files with 54 additions and 21 deletions

View File

@@ -153,14 +153,26 @@
</select>
</div>
<div>
<label class="form-label text-secondary small">Bracket <span class="text-secondary fw-normal">(optional)</span></label>
<select name="bracket_id" class="form-select bg-dark border-secondary text-white">
<option value="">— none —</option>
{% for b in brackets %}
<option value="{{ b.id }}">{{ b.name }}{% if b.customer %} · {{ b.customer }}{% endif %}</option>
{% endfor %}
</select>
<div class="row g-3">
<div class="col-md-4">
<label class="form-label text-secondary small">Amount</label>
<input type="number" name="amount"
class="form-control bg-dark border-secondary text-white"
value="1" min="1" max="500"
title="&gt;1 auto-creates a bracket">
</div>
<div class="col-md-8">
<label class="form-label text-secondary small">
Bracket
<span class="text-secondary fw-normal">(auto-created when amount &gt; 1)</span>
</label>
<select name="bracket_id" class="form-select bg-dark border-secondary text-white">
<option value="">— none / auto —</option>
{% for b in brackets %}
<option value="{{ b.id }}">{{ b.name }}{% if b.customer %} · {{ b.customer }}{% endif %}</option>
{% endfor %}
</select>
</div>
</div>
<div>