aboutsummaryrefslogtreecommitdiff
path: root/app/views/pages/sales
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/pages/sales')
-rw-r--r--app/views/pages/sales/currentSales.scala.html4
-rw-r--r--app/views/pages/sales/sellForm.scala.html34
2 files changed, 36 insertions, 2 deletions
diff --git a/app/views/pages/sales/currentSales.scala.html b/app/views/pages/sales/currentSales.scala.html
index 30cea78..bb1851c 100644
--- a/app/views/pages/sales/currentSales.scala.html
+++ b/app/views/pages/sales/currentSales.scala.html
@@ -26,9 +26,9 @@
26 <tbody> 26 <tbody>
27 @for(sale <- sales) { 27 @for(sale <- sales) {
28 <tr> 28 <tr>
29 <td>@sale.endDate</td> 29 <td>@sale.endDate.get</td>
30 <td><a href="@routes.Sale.item(sale.itemUuid.get)">@sale.itemName</a></td> 30 <td><a href="@routes.Sale.item(sale.itemUuid.get)">@sale.itemName</a></td>
31 <td>@if(sale.bestOffer.isDefined) {@sale.bestOffer} else {sale.initialPrice} €</td> 31 <td>@if(sale.bestOffer.isDefined) {@sale.bestOffer} else {@sale.initialPrice} €</td>
32 </tr> 32 </tr>
33 } 33 }
34 </tbody> 34 </tbody>
diff --git a/app/views/pages/sales/sellForm.scala.html b/app/views/pages/sales/sellForm.scala.html
new file mode 100644
index 0000000..d3988ba
--- /dev/null
+++ b/app/views/pages/sales/sellForm.scala.html
@@ -0,0 +1,34 @@
1@(saleForm: Form[SaleData])(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token)
2
3@templates.ebe("Sell")(request.account) {
4
5 <div class="pure-g">
6 <div class="pure-u-1 pure-u-lg-1-2 centered">
7
8 <h2>Sell a new item</h2>
9
10 @views.html.fragments.forms.globalErrors(saleForm)
11
12 @helper.form(action = routes.Sale.sellSubmit(), 'class -> "pure-form pure-form-stacked") {
13
14 @helper.CSRF.formField
15
16 <fieldset>
17 @views.html.fragments.forms.labeledField(saleForm("name"), "text", "Item name")
18 @views.html.fragments.forms.labeledField(saleForm("shortDescription"), "text", "Short description")
19 @views.html.fragments.forms.labeledTextarea(saleForm("longDescription"), "text", "Long description")
20 </fieldset>
21
22 <fieldset>
23 @views.html.fragments.forms.labeledField(saleForm("endDate"), "date", "End date")
24 @views.html.fragments.forms.labeledField(saleForm("initialPrice"), "number", "Initial price")
25 </fieldset>
26
27 <button type="submit" class="pure-button pure-input-1 pure-button-primary">Save</button>
28
29 }
30
31 </div>
32 </div>
33
34}