blocked dates page and warning for special-cake orders
Add blocked_date table (migration 5), model, and store CRUD methods. Add management page at /blocked with add/delete functionality. Add nav link 'Terminy zablokowane' with event_busy icon. Pass blocked dates to order form as JSON data attribute. On form submit, if the order has special cakes and the date is blocked, show a confirm() dialog warning the user.
This commit is contained in:
parent
5a5372b831
commit
5f156ab6a0
13 changed files with 175 additions and 16 deletions
|
|
@ -6,12 +6,12 @@ import (
|
|||
"git.bronku.xyz/bronku/cake-order-tracker/models"
|
||||
)
|
||||
|
||||
templ OrderPage(order models.Order, catalogue []models.Cake, allTags []models.Tag) {
|
||||
@Layout(OrderTitle(order), templ.NopComponent, OrderForm(order, catalogue, allTags))
|
||||
templ OrderPage(order models.Order, catalogue []models.Cake, allTags []models.Tag, blockedDates []models.BlockedDate) {
|
||||
@Layout(OrderTitle(order), templ.NopComponent, OrderForm(order, catalogue, allTags, blockedDates))
|
||||
}
|
||||
|
||||
templ OrderForm(order models.Order, catalogue []models.Cake, allTags []models.Tag) {
|
||||
<form method="post" class="split-pane">
|
||||
templ OrderForm(order models.Order, catalogue []models.Cake, allTags []models.Tag, blockedDates []models.BlockedDate) {
|
||||
<form method="post" class="split-pane" onsubmit="return confirmBlockedDate(this)" data-blocked-dates={ blockedDatesJSON(blockedDates) }>
|
||||
<input type="hidden" name="id" value={ strconv.Itoa(order.ID) }/>
|
||||
<div class="order-left">
|
||||
<section class="card">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue