BuildFeed/Views/front/viewGroup.cshtml
Thomas Hounsell f070d2a5cd Refresh Pt 5d
2015-05-04 16:43:20 +01:00

45 lines
1.7 KiB
Plaintext

@model IGrouping<BuildFeed.Models.BuildGroup, BuildFeed.Models.Build>
@using Humanizer;
@{
ViewBag.Title = string.Format("{0} | BuildFeed", Model.Key.ToString());
}
<h1>@Model.Key.ToString()</h1>
<div class="row">
@foreach (var build in Model.OrderBy(b => b.BuildTime))
{
<div class="col-sm-3">
<h3 class="build-group-title">@build.Lab</h3>
<p>
<a href="@Url.Action("viewBuild", new { id = build.Id })" class="btn btn-info btn-xs">Info</a>
@if (User.Identity.IsAuthenticated)
{
<a href="@Url.Action("editBuild", new { id = build.Id })" class="btn btn-primary btn-xs">Edit</a>
if (Roles.IsUserInRole("Administrators"))
{
<a href="@Url.Action("deleteBuild", new { id = build.Id })" class="btn btn-danger btn-xs">Delete</a>
}
}
</p>
<p>
@if (build.BuildTime.HasValue)
{
<span title="@build.BuildTime.Value.Humanize()"><i class="fa fa-calendar fa-fw"></i> @build.BuildTime.Value.ToString("d MMMM yyyy")</span><br />
<span title="@build.BuildTime.Value.Humanize()"><i class="fa fa-clock-o fa-fw"></i> @build.BuildTime.Value.ToString("h:mm tt")</span><br />
}
</p>
<p>
@if (build.IsLeaked)
{
<span class="label label-success label-build-status">Leaked</span>
}
else
{
<span class="label label-danger label-build-status">Unleaked</span>
}
</p>
</div>
}
</div>