|
30 | 30 | <HeaderTemplate> |
31 | 31 | <th>Title</th> |
32 | 32 | <th>Year</th> |
33 | | - <th>Genre</th> |
34 | 33 | <th>Rating</th> |
35 | | - <th>Notes</th> |
| 34 | + <td>First seen</td> |
36 | 35 | </HeaderTemplate> |
37 | 36 | <RowTemplate Context="movie"> |
38 | 37 | <td style="font-weight:500">@movie.Title</td> |
39 | | - <td style="color:var(--kt-text-muted)">@(movie.Year > 0 ? movie.Year : "—")</td> |
40 | | - <td style="color:var(--kt-text-muted)">@(string.IsNullOrEmpty(movie.Genre) ? "—" : movie.Genre)</td> |
41 | | - <td> |
42 | | - @if (movie.Rating > 0) |
43 | | - { |
44 | | - <span class="kt-stars"> |
45 | | - @(new string('★', movie.Rating ?? 0))<span class="empty">@(new string('★', 5 - (movie.Rating ?? 0)))</span> |
46 | | - </span> |
47 | | - } |
48 | | - else |
49 | | - { |
50 | | - <span style="color:var(--kt-text-subtle)">—</span> |
51 | | - } |
52 | | - </td> |
53 | | - <td style="color:var(--kt-text-muted); font-size:0.85rem">@(string.IsNullOrEmpty(movie.Notes) ? "—" : movie.Notes)</td> |
| 38 | + <td style="color:var(--kt-text-muted)">@(movie.Year > 0 ? movie.Year : "")</td> |
| 39 | + <td><span class="kt-stars"><StarRating Rating="movie.Rating" /></span></td> |
| 40 | + <td>@movie.FirstSeenAt?.ToString("yyyy-MM-dd")</td> |
54 | 41 | </RowTemplate> |
55 | 42 | <FormTemplate Context="movie"> |
56 | 43 | <input class="form-control" placeholder="Title" @bind="movie.Title"/> |
57 | | - <input class="form-control" placeholder="Year" type="number" @bind="movie.Year"/> |
| 44 | + <input class="form-control" @bind="movie.Year" type="number" min="1970" max="2100" /> |
58 | 45 | <input class="form-control" placeholder="Genre" @bind="movie.Genre"/> |
59 | | - <select class="form-select" @bind="movie.Rating"> |
60 | | - <option value="0">—</option> |
61 | | - @for (var i = 1; i <= 5; i++) |
62 | | - { |
63 | | - <option value="@i">@(new string('★', i))</option> |
64 | | - } |
65 | | - </select> |
66 | | - <input class="form-control" placeholder="Notes" @bind="movie.Notes"/> |
| 46 | + <input class="form-control" placeholder="Rating" @bind="movie.Rating" type="number" /> |
| 47 | + <textarea class="form-control" rows="4" @bind="movie.Notes"></textarea> |
67 | 48 | </FormTemplate> |
68 | | - <InlineEditTemplate Context="movie"> |
69 | | - <td><input class="form-control form-control-sm" @bind="movie.Title"/></td> |
70 | | - <td><input class="form-control form-control-sm" type="number" @bind="movie.Year" style="width:80px"/></td> |
71 | | - <td><input class="form-control form-control-sm" @bind="movie.Genre"/></td> |
72 | | - <td> |
73 | | - <select class="form-select form-select-sm" @bind="movie.Rating" style="width:80px"> |
74 | | - <option value="0">—</option> |
75 | | - @for (var i = 1; i <= 5; i++) |
76 | | - { |
77 | | - <option value="@i">@(new string('★', i))</option> |
78 | | - } |
79 | | - </select> |
80 | | - </td> |
81 | | - <td><input class="form-control form-control-sm" @bind="movie.Notes"/></td> |
82 | | - </InlineEditTemplate> |
| 49 | + <EditModalTemplate Context="movie"> |
| 50 | + <div class="col-12"> |
| 51 | + <label class="form-label">Title</label> |
| 52 | + <input class="form-control" @bind="movie.Title" /> |
| 53 | + </div> |
| 54 | + <div class="col-md-6"> |
| 55 | + <label class="form-label">Year</label> |
| 56 | + <input class="form-control" @bind="movie.Year" type="number" min="1970" max="2100" /> |
| 57 | + </div> |
| 58 | + <div class="col-md-6"> |
| 59 | + <label class="form-label">Genre</label> |
| 60 | + <input class="form-control" @bind="movie.Genre" /> |
| 61 | + </div> |
| 62 | + <div class="col-md-6"> |
| 63 | + <label class="form-label">Rating</label> |
| 64 | + <input class="form-control" @bind="movie.Rating" type="number" /> |
| 65 | + </div> |
| 66 | + <div class="col-md-6"> |
| 67 | + <label class="form-label">Notes</label> |
| 68 | + <textarea class="form-control" rows="4" @bind="movie.Notes"></textarea> |
| 69 | + </div> |
| 70 | + <div class="col-md-6"> |
| 71 | + <label class="form-label">First seen at</label> |
| 72 | + <input class="form-control" type="date" @bind="movie.FirstSeenAt" @bind:format="yyyy-MM-dd" /> |
| 73 | + </div> |
| 74 | + </EditModalTemplate> |
83 | 75 | </InventoryList> |
0 commit comments