BuildFeed/Views/front/viewLab.cshtml
Thomas Hounsell 75c71432a4 All paginated now
Issue #5 closed and resolved.
2015-05-30 13:26:16 +01:00

75 lines
3.1 KiB
Plaintext

@model IEnumerable<BuildFeed.Models.Build>
@using Humanizer;
@{
ViewBag.Title = string.Format("Builds from {0}{1} | BuildFeed", ViewBag.ItemId, ViewBag.PageNumber == 1 ? "" : string.Format(" | Page {0}", ViewBag.PageNumber));
}
@section head
{
@if (ViewBag.MetaItem != null)
{
<meta name="description" content="@ViewBag.MetaItem.MetaDescription" />
<meta property="og:description" content="@ViewBag.MetaItem.MetaDescription" />
}
else
{
<meta name="description" content="Check out all the known builds to come out of the Windows development lab @ViewBag.ItemId through BuildFeed, a collaborative Windows build list" />
<meta property="og:description" content="Check out all the known builds to come out of the Windows development lab @ViewBag.ItemId through BuildFeed, a collaborative Windows build list" />
}
@if(ViewBag.PageNumber != 1)
{
<meta name="robots" content="noindex, follow" />
}
}
<h2>@string.Format("Builds from {0}", ViewBag.ItemId)</h2>
@if (ViewBag.MetaItem != null && !string.IsNullOrWhiteSpace(ViewBag.MetaItem.PageContent))
{
<h3>About</h3>
@Html.Raw(ViewBag.MetaItem.PageContent)
}
<h3>Share</h3>
<div class="addthis_sharing_toolbox"></div>
<h3>Listing</h3>
<div class="row">
@foreach (var build in Model)
{
<div class="col-sm-2">
<h3 class="build-group-title">@string.Format("{0}.{1}.{2}.{3}", build.MajorVersion, build.MinorVersion, build.Number, build.Revision)</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>
@PaginationHelpers.PaginationBlock((int)ViewBag.PageNumber, (int)ViewBag.PageCount, "viewLab", ViewContext.RouteData.Values)
@section scripts
{
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5431719a661cbfd0" async="async"></script>
}