trying to fix price
This commit is contained in:
parent
7feee7f8a3
commit
8194cea85e
10 changed files with 145 additions and 54 deletions
|
|
@ -12,7 +12,7 @@ templ OrderPage(order models.Order, catalogue []models.Cake) {
|
|||
|
||||
templ OrderForm(order models.Order, catalogue []models.Cake) {
|
||||
<form method="post" class="split-pane" style="flex:1;min-height:0">
|
||||
<input type="hidden" name="id" value={ strconv.Itoa(order.ID) } />
|
||||
<input type="hidden" name="id" value={ strconv.Itoa(order.ID) }/>
|
||||
<div class="split-pane-left">
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
|
|
@ -25,34 +25,44 @@ templ OrderForm(order models.Order, catalogue []models.Cake) {
|
|||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label>Imię *</label>
|
||||
<input class="form-input" type="text" name="name" value={ order.Name } placeholder="Jan" />
|
||||
<input class="form-input" type="text" name="name" value={ order.Name } placeholder="Jan"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Nazwisko *</label>
|
||||
<input class="form-input" type="text" name="surname" value={ order.Surname } placeholder="Kowalski" />
|
||||
<input class="form-input" type="text" name="surname" value={ order.Surname } placeholder="Kowalski"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Telefon</label>
|
||||
<input class="form-input" type="tel" name="phone" value={ order.Phone } placeholder="+48 123 456 789" />
|
||||
<input class="form-input" type="tel" name="phone" value={ order.Phone } placeholder="+48 123 456 789"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Lokalizacja</label>
|
||||
<select class="form-input" name="location">
|
||||
<option if order.Location == "Kartuzy" { selected } value="Kartuzy">Kartuzy</option>
|
||||
<option if order.Location == "Somonino" { selected } value="Somonino">Somonino</option>
|
||||
<option
|
||||
if order.Location == "Kartuzy" {
|
||||
selected
|
||||
}
|
||||
value="Kartuzy"
|
||||
>Kartuzy</option>
|
||||
<option
|
||||
if order.Location == "Somonino" {
|
||||
selected
|
||||
}
|
||||
value="Somonino"
|
||||
>Somonino</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Data dostawy *</label>
|
||||
<input class="form-input" type="date" name="date" value={ order.Date.Format("2006-01-02") } />
|
||||
<input class="form-input" type="date" name="date" value={ order.Date.Format("2006-01-02") }/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Zaliczka</label>
|
||||
<input class="form-input" type="number" name="paid" min="0" value={ strconv.Itoa(order.Paid) } />
|
||||
<input class="form-input" type="number" name="paid" min="0" step="0.01" value={ order.Paid.String() }/>
|
||||
</div>
|
||||
<div class="form-group" style="grid-column:span 2">
|
||||
<label>Uwagi</label>
|
||||
<input class="form-input" type="text" placeholder="Alergie, specjalne życzenia..." />
|
||||
<input class="form-input" type="text" placeholder="Alergie, specjalne życzenia..."/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -65,7 +75,7 @@ templ OrderForm(order models.Order, catalogue []models.Cake) {
|
|||
</h2>
|
||||
<div class="topnav-search" style="width:180px">
|
||||
<span class="material-symbols-outlined" style="left:6px;font-size:14px">search</span>
|
||||
<input class="form-input" style="height:28px;padding-left:26px;font-size:12px" type="text" placeholder="Filtruj produkty..." oninput="filterCatalogue(this)" />
|
||||
<input class="form-input" style="height:28px;padding-left:26px;font-size:12px" type="text" placeholder="Filtruj produkty..." oninput="filterCatalogue(this)"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" style="overflow-y:auto">
|
||||
|
|
@ -78,7 +88,7 @@ templ OrderForm(order models.Order, catalogue []models.Cake) {
|
|||
</div>
|
||||
<div style="min-width:0">
|
||||
<div class="catalogue-item-name">{ c.Name }</div>
|
||||
<div class="catalogue-item-price">{ strconv.Itoa(c.Price) } PLN</div>
|
||||
<div class="catalogue-item-price">{ c.Price.String() } PLN</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="catalogue-item-actions">
|
||||
|
|
@ -109,28 +119,28 @@ templ OrderForm(order models.Order, catalogue []models.Cake) {
|
|||
<div class="summary-item" data-cake-id={ strconv.Itoa(c.ID) }>
|
||||
<div class="summary-item-info">
|
||||
<div class="summary-item-name cake-name">{ c.Name }</div>
|
||||
<div class="summary-item-detail cake-price">{ strconv.Itoa(c.Price) } PLN × <span class="cake-qty">{ strconv.Itoa(c.Amount) }</span></div>
|
||||
<div class="summary-item-detail cake-price">{ c.Price.String() } PLN × <span class="cake-qty">{ strconv.Itoa(c.Amount) }</span></div>
|
||||
</div>
|
||||
<div class="summary-item-price cake-total">{ strconv.Itoa(c.Total()) } PLN</div>
|
||||
<div class="summary-item-price cake-total">{ c.Total().String() } PLN</div>
|
||||
<button type="button" class="summary-item-remove" onclick="removeCake(this)">
|
||||
<span class="material-symbols-outlined">close</span>
|
||||
</button>
|
||||
<input type="hidden" name={ "cake[" + strconv.Itoa(c.ID) + "]" } value={ strconv.Itoa(c.Amount) } />
|
||||
<input type="hidden" name={ "cake[" + strconv.Itoa(c.ID) + "]" } value={ strconv.Itoa(c.Amount) }/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="summary-totals">
|
||||
<div class="summary-total-row">
|
||||
<span>Subtotal</span>
|
||||
<span id="subtotal-price">{ strconv.Itoa(orderSubtotal(order)) } PLN</span>
|
||||
<span id="subtotal-price">{ order.Subtotal().String() } PLN</span>
|
||||
</div>
|
||||
<div class="summary-total-row">
|
||||
<span>Zaliczka</span>
|
||||
<span id="paid-amount">{ strconv.Itoa(order.Paid) } PLN</span>
|
||||
<span id="paid-amount">{ order.Paid.String() } PLN</span>
|
||||
</div>
|
||||
<div class="summary-total-row total">
|
||||
<span>Do zapłaty</span>
|
||||
<span id="total-price">{ strconv.Itoa(orderSubtotal(order) - order.Paid) } PLN</span>
|
||||
<span id="total-price">{ order.Total().String() } PLN</span>
|
||||
</div>
|
||||
<button type="submit" class="btn-finalize">
|
||||
<span class="material-symbols-outlined">check_circle</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue