BuildFeed/Views/front/index.cshtml

30 lines
1.1 KiB
Plaintext
Raw Normal View History

2015-03-12 07:30:11 +08:00
@model IEnumerable<IGrouping<BuildFeed.Models.BuildGroup, BuildFeed.Models.Build>>
2015-03-28 10:09:26 +08:00
@using Humanizer;
2015-03-12 07:30:11 +08:00
@{
ViewBag.Title = "BuildFeed";
}
<div class="row">
@foreach (var group in Model)
{
<div class="col-sm-2">
2015-03-28 10:09:26 +08:00
<h3 class="build-group-title"><a href="#"><span class="icon"><i class="fa fa-plus-square"></i></span> @group.Key.ToString()</a></h3>
2015-03-12 07:30:11 +08:00
<p>
2015-03-28 10:09:26 +08:00
@if (group.Any(k => k.BuildTime.HasValue))
2015-03-12 07:30:11 +08:00
{
2015-03-28 10:09:26 +08:00
var maxDate = group.Max(k => k.BuildTime).Value;
if (maxDate.AddDays(28) > DateTime.Now)
{
<span title="@maxDate.ToString("dd MMMM yyyy")"><i class="fa fa-calendar fa-fw"></i> @maxDate.Humanize()</span><br />
}
else
{
<span title="@maxDate.Humanize()"><i class="fa fa-calendar fa-fw"></i> @maxDate.ToString("dd MMMM yyyy")</span><br />
}
2015-03-12 07:30:11 +08:00
}
2015-03-22 03:29:21 +08:00
<i class="fa fa-server fa-fw"></i> @group.Count().ToString() builds
2015-03-12 07:30:11 +08:00
</p>
</div>
}
</div>