aboutsummaryrefslogtreecommitdiff
path: root/app/views/pages/sales/itemPage.scala.html
blob: adfd5daee942eeb3166cad64dd3de8012f4c4ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@(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)

@templates.ebe("Item page")(request.account) {

	<h2>Item summary: @item.itemName</h2>

	<div class="pure-g">
		<div class="pure-u-1 pure-u-lg-3-4">
			<div class="l-box">
				<table class="pure-table pure-table-horizontal">
					<thead>
						<tr>
							<td colspan="2">Item summary</td>
						</tr>
					</thead>

					<tbody>
						<tr>
							<td>Item name</td>
							<td class="align-right">@item.itemName</td>
						</tr>

						<tr>
							<td>Short description</td>
							<td class="align-right">@item.shortDesc</td>
						</tr>
					</tbody>
				</table>
			</div>

			<div class="l-box">
				<table class="pure-table pure-table-horizontal">
					<thead>
						<tr>
							<td>Detailed description</td>
						</tr>
					</thead>

					<tbody>
						<tr>
							<td>@item.longDesc</td>
						</tr>
					</tbody>

				</table>
			</div>
		</div>

		<div class="pure-u-1 pure-u-lg-1-4">
			<div class="l-box">
				<table class="pure-table pure-table-horizontal">
					<thead>
						<tr>
							<td colspan="2">Bid</td>
						</tr>
					</thead>

					<tbody>
						<tr>
							<td>Current price</td>
							<td class="align-right">
								@if(bids.nonEmpty) {
									@bids.head._1.offer
								} else {
									@item.initialPrice
								} €
							</td>
						</tr>

						<tr>
							<td colspan="2">
							@helper.form(action = routes.Sale.bidSubmit(item.uuid), 'class -> "pure-form") {

								@helper.CSRF.formField

								<div class="pure-g">
									<div class="pure-u-1 pure-u-lg-1-2">
									@views.html.fragments.forms.inputField(bidForm("offer"), "number", "Offer")
									</div>

									<div class="pure-u-1 pure-u-lg-1-2">
										<button type="submit" class="pure-button pure-input-1 pure-button-primary">Bid</button>
									</div>
								</div>
							}
							</td>
						</tr>
					</tbody>
				</table>
			</div>

			<div class="l-box">
				<table class="pure-table pure-table-horizontal">
					<thead>
						<tr>
							<td colspan="2">Bid history</td>
						</tr>
					</thead>

					<tbody>
						@if(bids.isEmpty) {
							<tr>
								<td colspan="2">No bid</td>
							</tr>
						}

						@for(bid <- bids) {
							<tr>
								<td>@bid._2.username</td>
								<td>@bid._1.offer</td>
							</tr>
						}
					</tbody>
				</table>
			</div>
		</div>
	</div>


}