2014-10-20 21:09:42 +08:00
@model IEnumerable<BuildFeed.Models.Build>
@{
2014-10-29 07:39:18 +08:00
ViewBag.Action = ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString().ToLower();
2014-10-20 21:09:42 +08:00
ViewBag.Title = "BuildFeed";
if (ViewBag.PageNumber > 1)
{
ViewBag.Title = string.Format("Page {1} | {0}", ViewBag.Title, ViewBag.PageNumber);
}
switch (ViewBag.Action as string)
{
2014-10-29 07:39:18 +08:00
case "index":
2014-10-28 07:42:51 +08:00
ViewBag.Title = "BuildFeed | The collaborative build list";
2014-10-20 21:09:42 +08:00
break;
2014-10-29 07:39:18 +08:00
case "lab":
2014-10-28 07:42:51 +08:00
ViewBag.ItemId = ViewContext.Controller.ValueProvider.GetValue("lab").RawValue;
ViewBag.Title = string.Format("Builds from {1} | {0}", ViewBag.Title, ViewBag.ItemId);
2014-10-20 21:09:42 +08:00
break;
2014-10-29 07:39:18 +08:00
case "year":
2014-10-28 07:42:51 +08:00
ViewBag.ItemId = ViewContext.Controller.ValueProvider.GetValue("year").RawValue;
ViewBag.Title = string.Format("Builds from {1} | {0}", ViewBag.Title, ViewBag.ItemId);
break;
2014-10-29 07:39:18 +08:00
case "version":
2014-10-28 07:42:51 +08:00
ViewBag.ItemId = string.Format("{0}.{1}", ViewContext.Controller.ValueProvider.GetValue("major").RawValue, ViewContext.Controller.ValueProvider.GetValue("minor").RawValue);
ViewBag.Title = string.Format("Windows NT {1} | {0}", ViewBag.Title, ViewBag.ItemId);
2014-10-20 21:09:42 +08:00
break;
2014-10-29 07:39:18 +08:00
case "source":
ViewBag.ItemId = DisplayHelpers.GetDisplayTextForEnum(Enum.Parse(typeof(BuildFeed.Models.TypeOfSource), ViewContext.Controller.ValueProvider.GetValue("source").RawValue.ToString()));
2014-10-28 07:42:51 +08:00
ViewBag.Title = string.Format("{1} | {0}", ViewBag.Title, ViewBag.ItemId);
2014-10-20 21:09:42 +08:00
break;
2014-10-28 07:42:51 +08:00
}
}
@section head
{
@switch (ViewBag.Action as string)
{
2014-10-29 07:39:18 +08:00
case "index":
2014-10-28 07:42:51 +08:00
<meta name="description" content="BuildFeed is a collaborative build list for Microsoft Windows. Keep up to date with the latest Windows 10 builds or take a peek at the list back to 2000" />
<meta property="og:description" content="BuildFeed is a collaborative build list for Microsoft Windows. Keep up to date with the latest Windows 10 builds or take a peek at the list back to 2000" />
break;
2014-10-29 07:39:18 +08:00
case "lab":
2014-10-28 07:42:51 +08:00
<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" />
break;
2014-10-29 07:39:18 +08:00
case "year":
2014-10-28 07:42:51 +08:00
<meta name="description" content="View a list of all Windows builds compiled in @ViewBag.ViewId, and watch how Windows developed steadily over time, through the collaborative build list, BuildFeed" />
<meta property="og:description" content="View a list of all Windows builds compiled in @ViewBag.ViewId, and watch how Windows developed steadily over time, through the collaborative build list, BuildFeed" />
2014-10-20 21:09:42 +08:00
break;
}
}
<div class="row">
<div class="col-sm-9">
<ul class="list-unstyled">
@foreach (var item in Model)
{
<li>
<div class="build-head">
2014-10-29 07:39:18 +08:00
@Html.ActionLink("Info", "info", new { id = item.Id }, new { @class = "btn btn-info btn-xs" })
2014-10-20 21:09:42 +08:00
@if (User.Identity.IsAuthenticated)
{
2014-10-29 07:39:18 +08:00
@Html.ActionLink("Edit", "edit", new { id = item.Id }, new { @class = "btn btn-default btn-xs" })
2014-10-20 21:09:42 +08:00
}
2014-12-16 22:43:26 +08:00
@if (Roles.IsUserInRole("Administrators"))
2014-10-20 21:09:42 +08:00
{
2014-10-29 07:39:18 +08:00
@Html.ActionLink("Delete", "delete", new { id = item.Id }, new { @class = "btn btn-danger btn-xs" })
2014-10-20 21:09:42 +08:00
}
<h3>@Html.DisplayFor(modelItem => item.FullBuildString)</h3>
</div>
<div class="build-foot">
<span class="badge">@Html.DisplayFor(TypeOfSource => item.SourceType, "Enumeration")</span>
2015-01-05 06:14:43 +08:00
@if ((item.MajorVersion == 6 && item.MinorVersion == 4) || (item.MajorVersion == 10 && item.MinorVersion == 0) && item.FlightLevel != BuildFeed.Models.LevelOfFlight.None)
2014-10-20 21:09:42 +08:00
{
<span class="badge">Flight Level: @Html.DisplayFor(TypeOfSource => item.FlightLevel, "Enumeration")</span>
}
@if (item.BetaWikiUri != null)
{
<a href="@item.BetaWikiServerUri" target="_blank" class="badge"><i class="fa fa-sm fa-link"></i> BetaWiki (Client)</a>
}
@if (item.BetaWikiServerUri != null)
{
<a href="@item.BetaWikiServerUri" target="_blank" class="badge"><i class="fa fa-sm fa-link"></i> BetaWiki (Server)</a>
}
@if (item.WinWorldPCUri != null)
{
<a href="@item.WinWorldPCUri" target="_blank" class="badge"><i class="fa fa-sm fa-link"></i> WinWorldPC</a>
}
@if (item.BetaArchiveUri != null)
{
<a href="@item.BetaArchiveUri" target="_blank" class="badge"><i class="fa fa-sm fa-link"></i> BetaArchive Wiki</a>
}
@if (item.LonghornMsUri != null)
{
<a href="@item.LonghornMsUri" target="_blank" class="badge"><i class="fa fa-sm fa-link"></i> Longhorn.ms</a>
}
</div>
</li>
}
</ul>
</div>
<div class="col-sm-3">
2014-11-28 03:34:20 +08:00
<div class="panel panel-default panel-search">
<div class="panel-body">
@Html.TextBox("search-input", "", new { @class = "form-control" })
2014-10-20 21:09:42 +08:00
</div>
</div>
2014-12-03 18:54:14 +08:00
@if (ViewBag.Action != "index")
{
<div class="list-group">
@Html.ActionLink("Return to full listing", "index", new { controller = "build", area = "", page = 1 }, new { @class = "list-group-item" })
</div>
}
2014-11-28 03:34:20 +08:00
<div class="list-group">
@if (User.Identity.IsAuthenticated)
{
2014-12-16 22:43:26 +08:00
if (Roles.IsUserInRole("Administrators"))
2014-11-28 03:34:20 +08:00
{
@Html.ActionLink("Administration", "index", new { controller = "base", area = "admin" }, new { @class = "list-group-item" })
}
@Html.ActionLink("Add a build", "create", new { controller = "build" }, new { @class = "list-group-item" })
@Html.ActionLink("Change your password", "password", new { controller = "support" }, new { @class = "list-group-item" })
@Html.ActionLink("Log out", "logout", new { controller = "support" }, new { @class = "list-group-item" })
}
else
{
@Html.ActionLink("Log in", "login", new { controller = "support" }, new { @class = "list-group-item" })
@Html.ActionLink("Register", "register", new { controller = "support" }, new { @class = "list-group-item" })
}
2015-01-05 06:14:43 +08:00
@Html.ActionLink("Ask a question", "question", new { controller = "support" }, new { @class = "list-group-item" })
2014-11-28 03:34:20 +08:00
</div>
2014-10-20 21:09:42 +08:00
</div>
</div>
@if (ViewBag.PageCount > 1)
{
<ul class="pagination">
@if (ViewBag.PageNumber > 1)
{
<li>@Html.ActionLink(HttpUtility.HtmlDecode("«"), ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(), new { page = ViewBag.PageNumber - 1 })</li>
}
else
{
<li class="disabled"><span>«</span></li>
}
@for (int i = 1; i <= ViewBag.PageCount; i++)
{
<li @((i == ViewBag.PageNumber) ? "class=active" : "")>@Html.ActionLink(i.ToString(), ViewBag.Action as string, new { page = i })</li>
}
@if (ViewBag.PageNumber < ViewBag.PageCount)
{
<li>@Html.ActionLink(HttpUtility.HtmlDecode("»"), ViewBag.Action as string, new { page = ViewBag.PageNumber + 1 })</li>
}
else
{
<li class="disabled"><span>»</span></li>
}
</ul>
2014-11-28 03:34:20 +08:00
}
@section scripts
{
@Scripts.Render("~/bundles/jsrender")
<script type="text/javascript" src="~/Scripts/bfs.js"></script>
<script id="result-template" type="text/x-jsrender">
2014-12-11 20:24:42 +08:00
<a href="{{:Url}}" class="list-group-item" title="{{:Title}}">
2014-11-28 03:34:20 +08:00
<h4 class="list-group-item-heading">{{:Label}}</h4>
<p class="list-group-item-text">{{:Group}}</p>
</a>
</script>
2014-10-20 21:09:42 +08:00
}