Skip to content

Commit 5c5db3f

Browse files
Update product attributes (#107)
1 parent 2fdbda9 commit 5c5db3f

File tree

9 files changed

+515
-446
lines changed

9 files changed

+515
-446
lines changed

src/Web/Grand.Web/Views/Account/Auctions.cshtml

Lines changed: 97 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -20,58 +20,56 @@
2020
<b-tab title="@Loc["Account.Auctions.Tab.Ongoing"]" active>
2121
@if (Model.ProductBidList.Where(x => !x.Ended).Any())
2222
{
23-
<div id="auction-table-ongoing"></div>
24-
<script>
25-
var AuctionTableOngoing = Vue.extend({
26-
template: '<b-table :fields="fields" :items="items"><template v-slot:cell(product)="data"><div v-html="data.value.nameraw"></div></template><template v-slot:cell(status)="data"><div v-html="data.value.statusraw"></div></template><template v-slot:cell(bid)="data"><div v-html="data.value.bidraw"></div></template><template v-slot:cell(endtime)="data"><div v-html="data.value.endtimeraw"></div></template></b-table>',
27-
data: function () {
28-
return {
29-
fields: [
30-
{ key: 'product', label: '@Loc["Account.CustomerAuctions.ProductName"]'},
31-
{ key: 'status', label: '@Loc["Account.CustomerAuctions.Status"]'},
32-
{ key: 'bid', label: '@Loc["Account.CustomerAuctions.Highestbid"]'},
33-
{ key: 'endtime', label: '@Loc["Account.CustomerAuctions.AuctionEndTime"]'},
34-
],
35-
items: [
36-
@{
37-
var ongoing = Model.ProductBidList.Where(x => !x.Ended);
38-
}
39-
@foreach (var item in ongoing)
23+
<div id="auction-table-ongoing" class="table-responsive">
24+
<table class="table">
25+
<thead role="rowgroup">
26+
<tr role="row">
27+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.ProductName"]</div></th>
28+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.Status"]</div></th>
29+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.Highestbid"]</div></th>
30+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.AuctionEndTime"]</div></th>
31+
</tr>
32+
</thead>
33+
<tbody role="rowgroup">
34+
@{
35+
var ongoing = Model.ProductBidList.Where(x => !x.Ended);
36+
}
37+
@foreach (var item in ongoing)
38+
{
39+
<tr role="row">
40+
<td>
41+
<div><a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })">@item.ProductName</a></div>
42+
</td>
43+
@if (item.HighestBidder)
4044
{
41-
<text>
45+
<td>
46+
<div>
47+
<span class="text-success">@Loc["Account.CustomerAuctions.Status.HighestBidder"]</span>
48+
</div>
49+
</td>
50+
}
51+
else
4252
{
43-
product: {
44-
nameraw: '<a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })">@item.ProductName</a>'
45-
},
46-
status: {
47-
@if (item.HighestBidder)
48-
{
49-
<text>
50-
statusraw: '<span class="text-success">@Loc["Account.CustomerAuctions.Status.HighestBidder"]</span>'
51-
</text>
52-
}
53-
else
54-
{
55-
<text>
56-
statusraw: '<span class="text-danger">@Loc["Account.CustomerAuctions.Status.Outbid"]</span>'
57-
</text>
58-
}
59-
},
60-
bid: {
61-
bidraw: '@item.CurrentBidAmount @if (item.CurrentBidAmountValue > item.BidAmountValue) { <small>(@item.BidAmount)</small> }'
62-
},
63-
endtime: {
64-
endtimeraw: '@item.EndBidDate'
65-
}
66-
},
67-
</text>
68-
}
69-
]
70-
}
71-
}
72-
})
73-
new AuctionTableOngoing().$mount('#auction-table-ongoing')
74-
</script>
53+
<td>
54+
<div>
55+
<span class="text-danger">@Loc["Account.CustomerAuctions.Status.Outbid"]</span>
56+
</div>
57+
</td>
58+
}
59+
<td>
60+
<div>
61+
@item.CurrentBidAmount @if (item.CurrentBidAmountValue > item.BidAmountValue)
62+
{<small>(@item.BidAmount)</small>}
63+
</div>
64+
</td>
65+
<td>
66+
<div>@item.EndBidDate</div>
67+
</td>
68+
</tr>
69+
}
70+
</tbody>
71+
</table>
72+
</div>
7573
}
7674
else
7775
{
@@ -84,59 +82,57 @@
8482
@if (Model.ProductBidList.Where(x => x.Ended).Any())
8583
{
8684

87-
<div id="auction-table-ended"></div>
88-
<script>
89-
var AuctionTableEnded = Vue.extend({
90-
template: '<b-table :fields="fields" :items="items"><template v-slot:cell(product)="data"><div v-html="data.value.nameraw"></div></template><template v-slot:cell(status)="data"><div v-html="data.value.statusraw"></div></template><template v-slot:cell(bid)="data"><div v-html="data.value.bidraw"></div></template><template v-slot:cell(endtime)="data"><div v-html="data.value.endtimeraw"></div></template></b-table>',
91-
data: function () {
92-
return {
93-
fields: [
94-
{ key: 'product', label: '@Loc["Account.CustomerAuctions.ProductName"]'},
95-
{ key: 'status', label: '@Loc["Account.CustomerAuctions.Status"]'},
96-
{ key: 'bid', label: '@Loc["Account.CustomerAuctions.Highestbid"]'},
97-
{ key: 'endtime', label: '@Loc["Account.CustomerAuctions.AuctionEndTime"]'},
98-
],
99-
items: [
100-
@{
101-
var ended = Model.ProductBidList.Where(x => x.Ended);
102-
}
85+
<div id="auction-table-ended" class="table-responsive">
86+
<table class="table">
87+
<thead role="rowgroup">
88+
<tr role="row">
89+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.ProductName"]</div></th>
90+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.Status"]</div></th>
91+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.Highestbid"]</div></th>
92+
<th role="columnheader"><div>@Loc["Account.CustomerAuctions.AuctionEndTime"]</div></th>
93+
</tr>
94+
</thead>
95+
<tbody role="rowgroup">
96+
@{
97+
var ended = Model.ProductBidList.Where(x => x.Ended);
98+
}
10399

104-
@foreach (var item in ended)
105-
{
106-
<text>
107-
{
108-
product: {
109-
nameraw: '<a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })">@item.ProductName</a>'
110-
},
111-
status: {
112-
@if (item.HighestBidder)
113-
{
114-
<text>
115-
statusraw: '<span class="text-success">@Loc["Account.CustomerAuctions.Status.HighestBidder"]</span>'
116-
</text>
117-
}
118-
else
119-
{
120-
<text>
121-
statusraw: '<span class="text-danger">@Loc["Account.CustomerAuctions.Status.Outbid"]</span>'
122-
</text>
123-
}
124-
},
125-
bid: {
126-
bidraw: '@item.CurrentBidAmount @if (item.CurrentBidAmountValue > item.BidAmountValue) { <small>(@item.BidAmount)</small> }'
127-
},
128-
endtime: {
129-
endtimeraw: '@item.EndBidDate'
130-
}
131-
},
132-
</text>
133-
}
134-
]
100+
@foreach (var item in ended)
101+
{
102+
<tr role="row">
103+
<td>
104+
<div><a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })">@item.ProductName</a></div>
105+
</td>
106+
@if (item.HighestBidder)
107+
{
108+
<td>
109+
<div>
110+
<span class="text-success">@Loc["Account.CustomerAuctions.Status.HighestBidder"]</span>
111+
</div>
112+
</td>
113+
}
114+
else
115+
{
116+
<td>
117+
<div>
118+
<span class="text-danger">@Loc["Account.CustomerAuctions.Status.Outbid"]</span>
119+
</div>
120+
</td>
121+
}
122+
<td>
123+
<div>
124+
@item.CurrentBidAmount @if (item.CurrentBidAmountValue > item.BidAmountValue)
125+
{<small>(@item.BidAmount)</small>}
126+
</div>
127+
</td>
128+
<td>
129+
<div>@item.EndBidDate</div>
130+
</td>
131+
</tr>
135132
}
136-
}
137-
})
138-
new AuctionTableEnded().$mount('#auction-table-ended')
139-
</script>
133+
</tbody>
134+
</table>
135+
</div>
140136
}
141137
else
142138
{

0 commit comments

Comments
 (0)