feat: add cancel buttons to all add forms
Match the edit form pattern by adding a Cancel button (history.back()) below each Save button in the sticky submit bar.
This commit is contained in:
parent
720ebcbad3
commit
67f218495f
1 changed files with 56 additions and 7 deletions
|
|
@ -190,13 +190,20 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{ img::deferred_upload("roaster-image", "Add image (optional)") }}
|
{{ img::deferred_upload("roaster-image", "Add image (optional)") }}
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::plus("h-4 w-4") }} Save Roaster
|
{{ icons::plus("h-4 w-4") }} Save Roaster
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -403,13 +410,20 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{ img::deferred_upload("roast-image", "Add image (optional)") }}
|
{{ img::deferred_upload("roast-image", "Add image (optional)") }}
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::plus("h-4 w-4") }} Save Roast
|
{{ icons::plus("h-4 w-4") }} Save Roast
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -498,13 +512,20 @@
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::plus("h-4 w-4") }} Save Bag
|
{{ icons::plus("h-4 w-4") }} Save Bag
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -947,13 +968,20 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{{ img::deferred_upload("brew-image", "Add image (optional)") }}
|
{{ img::deferred_upload("brew-image", "Add image (optional)") }}
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::beaker("h-4 w-4") }} Save Brew
|
{{ icons::beaker("h-4 w-4") }} Save Brew
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -1023,13 +1051,20 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{ img::deferred_upload("gear-image", "Add image (optional)") }}
|
{{ img::deferred_upload("gear-image", "Add image (optional)") }}
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::plus("h-4 w-4") }} Save Gear
|
{{ icons::plus("h-4 w-4") }} Save Gear
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1188,13 +1223,20 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{ img::deferred_upload("cafe-image", "Add image (optional)") }}
|
{{ img::deferred_upload("cafe-image", "Add image (optional)") }}
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::plus("h-4 w-4") }} Save Cafe
|
{{ icons::plus("h-4 w-4") }} Save Cafe
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1297,13 +1339,20 @@
|
||||||
</searchable-select>
|
</searchable-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sticky-submit flex items-center justify-end">
|
<div class="sticky-submit flex flex-col gap-2">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-semibold text-accent-text transition hover:bg-accent-hover"
|
||||||
>
|
>
|
||||||
{{ icons::plus("h-4 w-4") }} Save Cup
|
{{ icons::plus("h-4 w-4") }} Save Cup
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick="history.back()"
|
||||||
|
class="inline-flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-surface-alt"
|
||||||
|
>
|
||||||
|
{{ icons::x_mark("h-4 w-4") }} Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue