diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/fragments/ebeMainActions.scala.html | 2 | ||||
-rw-r--r-- | app/views/fragments/forms/labeledTextarea.scala.html | 4 | ||||
-rw-r--r-- | app/views/pages/sales/currentSales.scala.html | 4 | ||||
-rw-r--r-- | app/views/pages/sales/sellForm.scala.html | 34 |
4 files changed, 41 insertions, 3 deletions
diff --git a/app/views/fragments/ebeMainActions.scala.html b/app/views/fragments/ebeMainActions.scala.html index 9976d17..36c3192 100644 --- a/app/views/fragments/ebeMainActions.scala.html +++ b/app/views/fragments/ebeMainActions.scala.html | |||
@@ -1,5 +1,5 @@ | |||
1 | <div class="pure-u-1 pure-u-lg-1-2"> | 1 | <div class="pure-u-1 pure-u-lg-1-2"> |
2 | <a class="pure-button blue-bg" href="@routes.Sale.sell(null)"> | 2 | <a class="pure-button blue-bg" href="@routes.Sale.sell()"> |
3 | <i class="fa fa-gavel fa-5x"></i> | 3 | <i class="fa fa-gavel fa-5x"></i> |
4 | <span>Sell</span> | 4 | <span>Sell</span> |
5 | </a> | 5 | </a> |
diff --git a/app/views/fragments/forms/labeledTextarea.scala.html b/app/views/fragments/forms/labeledTextarea.scala.html new file mode 100644 index 0000000..a086278 --- /dev/null +++ b/app/views/fragments/forms/labeledTextarea.scala.html | |||
@@ -0,0 +1,4 @@ | |||
1 | @(field: Field, inputType: String, label: String) | ||
2 | |||
3 | @views.html.fragments.forms.inputLabel(field, label) | ||
4 | @views.html.fragments.forms.textarea(field, label) | ||
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 | } | ||