aboutsummaryrefslogtreecommitdiff
path: root/app/views/pages/sales/itemPage.scala.html
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/pages/sales/itemPage.scala.html')
-rw-r--r--app/views/pages/sales/itemPage.scala.html120
1 files changed, 120 insertions, 0 deletions
diff --git a/app/views/pages/sales/itemPage.scala.html b/app/views/pages/sales/itemPage.scala.html
new file mode 100644
index 0000000..adfd5da
--- /dev/null
+++ b/app/views/pages/sales/itemPage.scala.html
@@ -0,0 +1,120 @@
1@(item: Tables.Item, seller: Tables.User, bids: Seq[(Tables.Bid, Tables.User)], bidForm: Form[BidData])(implicit request: AuthRequest[AnyContent], flash: Flash, token: play.filters.csrf.CSRF.Token)
2
3@templates.ebe("Item page")(request.account) {
4
5 <h2>Item summary: @item.itemName</h2>
6
7 <div class="pure-g">
8 <div class="pure-u-1 pure-u-lg-3-4">
9 <div class="l-box">
10 <table class="pure-table pure-table-horizontal">
11 <thead>
12 <tr>
13 <td colspan="2">Item summary</td>
14 </tr>
15 </thead>
16
17 <tbody>
18 <tr>
19 <td>Item name</td>
20 <td class="align-right">@item.itemName</td>
21 </tr>
22
23 <tr>
24 <td>Short description</td>
25 <td class="align-right">@item.shortDesc</td>
26 </tr>
27 </tbody>
28 </table>
29 </div>
30
31 <div class="l-box">
32 <table class="pure-table pure-table-horizontal">
33 <thead>
34 <tr>
35 <td>Detailed description</td>
36 </tr>
37 </thead>
38
39 <tbody>
40 <tr>
41 <td>@item.longDesc</td>
42 </tr>
43 </tbody>
44
45 </table>
46 </div>
47 </div>
48
49 <div class="pure-u-1 pure-u-lg-1-4">
50 <div class="l-box">
51 <table class="pure-table pure-table-horizontal">
52 <thead>
53 <tr>
54 <td colspan="2">Bid</td>
55 </tr>
56 </thead>
57
58 <tbody>
59 <tr>
60 <td>Current price</td>
61 <td class="align-right">
62 @if(bids.nonEmpty) {
63 @bids.head._1.offer
64 } else {
65 @item.initialPrice
66 } €
67 </td>
68 </tr>
69
70 <tr>
71 <td colspan="2">
72 @helper.form(action = routes.Sale.bidSubmit(item.uuid), 'class -> "pure-form") {
73
74 @helper.CSRF.formField
75
76 <div class="pure-g">
77 <div class="pure-u-1 pure-u-lg-1-2">
78 @views.html.fragments.forms.inputField(bidForm("offer"), "number", "Offer")
79 </div>
80
81 <div class="pure-u-1 pure-u-lg-1-2">
82 <button type="submit" class="pure-button pure-input-1 pure-button-primary">Bid</button>
83 </div>
84 </div>
85 }
86 </td>
87 </tr>
88 </tbody>
89 </table>
90 </div>
91
92 <div class="l-box">
93 <table class="pure-table pure-table-horizontal">
94 <thead>
95 <tr>
96 <td colspan="2">Bid history</td>
97 </tr>
98 </thead>
99
100 <tbody>
101 @if(bids.isEmpty) {
102 <tr>
103 <td colspan="2">No bid</td>
104 </tr>
105 }
106
107 @for(bid <- bids) {
108 <tr>
109 <td>@bid._2.username</td>
110 <td>@bid._1.offer</td>
111 </tr>
112 }
113 </tbody>
114 </table>
115 </div>
116 </div>
117 </div>
118
119
120}