source: KernelRecordsMVC.Web/Views/Release/Details.cshtml@ d89d25b

main
Last change on this file since d89d25b was d89d25b, checked in by mmilevski <markomilevski3@…>, 4 weeks ago

Added few implementaions, minor UI changes.

  • Property mode set to 100644
File size: 11.0 KB
Line 
1@model KernelRecordsMVC.Models.Release
2
3@{
4 ViewData["Title"] = Model.Title;
5
6 var isAlbum = Model.Album != null;
7 var isSingle = Model.SingleRelease != null;
8
9 var releaseType =
10 isAlbum ? "ALBUM" :
11 isSingle ? "SINGLE" :
12 "RELEASE";
13
14 var artists = string.Join(
15 ", ",
16 Model.ReleaseArtists
17 .OrderBy(x => x.ReleaseOrdinal)
18 .Select(x => x.Artist.ArtistName)
19 );
20}
21
22<div class="release-details-page">
23
24 <div class="release-hero">
25
26 <div class="release-hero-cover">
27
28 @if (!string.IsNullOrWhiteSpace(Model.CoverPhoto))
29 {
30 <img src="@Model.CoverPhoto"
31 alt="@Model.Title" />
32 }
33 else
34 {
35 <div class="release-no-cover">
36 <span>♪</span>
37 </div>
38 }
39
40 </div>
41
42
43 <div class="release-hero-info">
44
45 <span class="page-eyebrow">
46 @releaseType
47 </span>
48
49 <h1>
50 @Model.Title
51 </h1>
52
53 <p class="release-artists-main">
54 @artists
55 </p>
56
57
58 <div class="release-facts">
59
60 <div>
61
62 <span>Genre</span>
63
64 <strong>
65 @Model.Genre
66 </strong>
67
68 </div>
69
70
71 <div>
72
73 <span>Released</span>
74
75 <strong>
76 @Model.ReleaseDate.ToString("MMM dd, yyyy")
77 </strong>
78
79 </div>
80
81
82 <div>
83
84 <span>Label</span>
85
86 <strong>
87 @(string.IsNullOrWhiteSpace(Model.RecordLabel)
88 ? "Independent"
89 : Model.RecordLabel)
90 </strong>
91
92 </div>
93
94 </div>
95
96
97 <div class="artist-section">
98
99 <span class="section-label">
100 ARTISTS
101 </span>
102
103 <div class="release-artists">
104
105 @foreach (var artist in Model.ReleaseArtists
106 .OrderBy(x => x.ReleaseOrdinal))
107 {
108 <a asp-controller="Artist"
109 asp-action="Details"
110 asp-route-id="@artist.ArtistId"
111 class="artist-tag">
112
113 @artist.Artist.ArtistName
114
115 @if (artist.Type.ToString() == "FEATURE")
116 {
117 <span class="artist-role">
118 Featured
119 </span>
120 }
121
122 </a>
123 }
124
125 </div>
126
127 </div>
128
129 </div>
130
131 </div>
132
133
134 <!-- =====================================================
135 PRODUCTS
136 ===================================================== -->
137
138 <section class="release-section">
139
140 <div class="section-heading">
141
142 <div>
143
144 <span class="section-label">
145 AVAILABLE FORMATS
146 </span>
147
148 <h2>
149 Choose your format
150 </h2>
151
152 </div>
153
154 <span class="track-count">
155 @Model.Products.Count product(s)
156 </span>
157
158 </div>
159
160
161 @if (!Model.Products.Any())
162 {
163 <div class="no-products">
164 No physical products are currently available.
165 </div>
166 }
167 else
168 {
169 <div class="product-grid">
170
171 @foreach (var product in Model.Products
172 .OrderBy(x => x.Format))
173 {
174 <div class="store-product-card">
175
176 <div class="product-card-top">
177
178 <span class="product-format">
179 @product.Format
180 </span>
181
182
183 @if (product.Stock > 0)
184 {
185 <span class="product-stock available">
186 In stock
187 </span>
188 }
189 else
190 {
191 <span class="product-stock unavailable">
192 Out of stock
193 </span>
194 }
195
196 </div>
197
198
199 <div class="product-price">
200 @product.Price.ToString("C")
201 </div>
202
203
204 <p class="product-description">
205 @product.ProductDescription
206 </p>
207
208
209 @if (product.Stock > 0)
210 {
211 <div class="product-actions">
212
213 <!-- ADD TO CART -->
214
215 <a asp-controller="Order"
216 asp-action="AddProduct"
217 asp-route-id="@product.ProductId"
218 class="store-button primary">
219
220 Add to Cart
221
222 </a>
223
224
225 <!-- ADD TO WISHLIST -->
226
227 <form asp-controller="Wishlist"
228 asp-action="Add"
229 method="post">
230
231 @Html.AntiForgeryToken()
232
233 <input type="hidden"
234 name="productId"
235 value="@product.ProductId" />
236
237 <button type="submit"
238 class="store-button secondary">
239
240 ♡ Wishlist
241
242 </button>
243
244 </form>
245
246 </div>
247 }
248 else
249 {
250 <div class="product-actions">
251
252 <!-- OUT OF STOCK: WISHLIST ONLY -->
253
254 <form asp-controller="Wishlist"
255 asp-action="Add"
256 method="post">
257
258 @Html.AntiForgeryToken()
259
260 <input type="hidden"
261 name="productId"
262 value="@product.ProductId" />
263
264 <button type="submit"
265 class="store-button secondary full">
266
267 ♡ Add to Wishlist
268
269 </button>
270
271 </form>
272
273 </div>
274 }
275
276 </div>
277 }
278
279 </div>
280 }
281
282 </section>
283
284
285 <!-- =====================================================
286 ALBUM
287 ===================================================== -->
288
289 @if (Model.Album != null)
290 {
291 <section class="release-section">
292
293 <div class="section-heading">
294
295 <div>
296
297 <span class="section-label">
298 ALBUM
299 </span>
300
301 <h2>
302 Track List
303 </h2>
304
305 </div>
306
307 <span class="track-count">
308 @Model.Album.AlbumSongs.Count tracks
309 </span>
310
311 </div>
312
313
314 @if (!Model.Album.AlbumSongs.Any())
315 {
316 <div class="no-products">
317 No tracks have been added to this album.
318 </div>
319 }
320 else
321 {
322 <ol class="track-list">
323
324 @{
325 var trackNumber = 1;
326 }
327
328
329 @foreach (var albumSong in Model.Album.AlbumSongs
330 .OrderBy(x => x.SongId))
331 {
332 <li class="track-row">
333
334 <span class="track-number">
335 @trackNumber.ToString("00")
336 </span>
337
338
339 <div class="track-main">
340
341 <strong>
342 @albumSong.Song.SongName
343 </strong>
344
345
346 @if (albumSong.Song.SongArtists != null &&
347 albumSong.Song.SongArtists.Any())
348 {
349 <div class="song-artists">
350
351 @string.Join(
352 ", ",
353 albumSong.Song.SongArtists
354 .OrderBy(x => x.SongOrdinal)
355 .Select(x =>
356 x.Artist.ArtistName)
357 )
358
359 </div>
360 }
361
362 </div>
363
364
365 <span class="track-duration">
366 @albumSong.Song.SongDuration
367 </span>
368
369 </li>
370
371 trackNumber++;
372 }
373
374 </ol>
375 }
376
377 </section>
378 }
379
380
381 <!-- =====================================================
382 SINGLE
383 ===================================================== -->
384
385 @if (Model.SingleRelease != null)
386 {
387 <section class="release-section">
388
389 <div class="section-heading">
390
391 <div>
392
393 <span class="section-label">
394 SINGLE
395 </span>
396
397 <h2>
398 Single Information
399 </h2>
400
401 </div>
402
403 </div>
404
405
406 <div class="single-info-card">
407
408 <div>
409
410 <span class="section-label">
411 RELEASE TYPE
412 </span>
413
414 <h2>
415 Single
416 </h2>
417
418 </div>
419
420
421 <div class="single-duration">
422
423 <span>
424 Duration
425 </span>
426
427 <strong>
428 @Model.SingleRelease.Duration
429 </strong>
430
431 </div>
432
433 </div>
434
435 </section>
436 }
437
438</div>
Note: See TracBrowser for help on using the repository browser.