85 lines
2.3 KiB
Plaintext
85 lines
2.3 KiB
Plaintext
@page
|
|
@using MediaManager.database
|
|
@model MediaManager.Pages.Movies
|
|
@{
|
|
ViewData["Title"] = "Movies";
|
|
}
|
|
|
|
<div class="text-center">
|
|
<h1 class="display-5">
|
|
Movies
|
|
<a class="btn btn-lg btn-primary" href="/AddMovie">Add</a>
|
|
|
|
</h1>
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Title</th>
|
|
<th scope="col">Rating</th>
|
|
<th scope="col">Rewatchability</th>
|
|
<th scope="col">Watch count</th>
|
|
<th scope="col">Last Watch</th>
|
|
<th scope="col">Comment</th>
|
|
<th scope="col">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var movie in new Database.DbConn().Movies.Where(p => p.UserId == Model.AuthorizedUser.UserId).OrderBy(p => p.Title.ToLower())) {
|
|
<tr>
|
|
<td>
|
|
<b>@movie.Title</b>
|
|
<br/>
|
|
<small>@movie.Year</small>
|
|
</td>
|
|
<td class="td-progress">
|
|
@if (movie.Rating > 0) {
|
|
<div class="progress">
|
|
<div class="progress-bar progress-@(movie.Rating)0" role="progressbar" style="width: @(movie.Rating * 10)%">@(movie.Rating)</div>
|
|
</div>
|
|
}
|
|
else {
|
|
<div class="progress">
|
|
<div class="progress-bar progress-00" role="progressbar" style="width: 0"></div>
|
|
</div>
|
|
}
|
|
</td>
|
|
<td class="td-progress">
|
|
@if (movie.Rewatchability > 0) {
|
|
<div class="progress">
|
|
<div class="progress-bar progress-@(movie.Rewatchability)0" role="progressbar" style="width: @(movie.Rewatchability * 10)%">@(movie.Rewatchability)</div>
|
|
</div>
|
|
}
|
|
else {
|
|
<div class="progress">
|
|
<div class="progress-bar progress-00" role="progressbar" style="width: 0"></div>
|
|
</div>
|
|
}
|
|
</td>
|
|
<td class="td-progress">
|
|
<div class="progress">
|
|
<div class="progress-bar progress-@(Math.Min(movie.WatchCount, 5) * 2)0" role="progressbar" style="width: @(Math.Min(movie.WatchCount, 5) * 20)%">@(movie.WatchCount)</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
@if (movie.LastSeen.Year > 1800) {
|
|
@movie.LastSeen.ToString("yyyy-MM-dd")
|
|
}
|
|
else {
|
|
@Html.Raw("-")
|
|
}
|
|
</td>
|
|
<td>
|
|
@movie.Comment
|
|
</td>
|
|
<td>
|
|
<div class="btn-group" role="group">
|
|
<a class="btn btn-sm btn-secondary" href="/EditMovie/@movie.MovieId?action=autoinc">W+1</a>
|
|
<a class="btn btn-sm btn-primary" href="/EditMovie/@movie.MovieId">Edit</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|