34 lines
1.2 KiB
Plaintext

@page
@model IndexModel
@{
ViewData["Title"] = "Song of the Day";
}
<div class="text-center">
<h1 class="display-4">Submission History</h1>
<table>
<tr>
<th>Date</th>
<th>Song</th>
<th>Submitter</th>
<th>Details</th>
</tr>
@foreach(var songSuggestion in Model.SongSuggestions)
{
@if(songSuggestion != null && songSuggestion.Song != null && songSuggestion.User != null && songSuggestion.UserHasSubmitted)
{
var displayName = string.IsNullOrEmpty(songSuggestion?.User?.NickName)
? songSuggestion?.User.Name
: songSuggestion.User.NickName;
<tr>
<td>@songSuggestion?.Date.ToString("dd. MM. yyyy")</td>
<td><a href="@songSuggestion?.Song.Url" target="_blank">@string.Format("{0} - {1}", songSuggestion?.Song.Name, songSuggestion?.Song.Artist)</a></td>
<td>@displayName</td>
<td><a href="/SongSubmission/@songSuggestion?.Id">View</a></td>
</tr>
}
}
</table>
</div>