mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
Refresh Pt b4a
This commit is contained in:
parent
161dcbaf9e
commit
e486908b2c
|
@ -296,6 +296,7 @@
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="Views\front\index.cshtml" />
|
<Content Include="Views\front\index.cshtml" />
|
||||||
<Content Include="Views\front\viewGroup.cshtml" />
|
<Content Include="Views\front\viewGroup.cshtml" />
|
||||||
|
<Content Include="Views\front\viewBuild.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="App_Data\" />
|
<Folder Include="App_Data\" />
|
||||||
|
|
|
@ -37,7 +37,7 @@ bg.Key.Revision descending
|
||||||
[Route("group/{major}.{minor}.{number}.{revision}")]
|
[Route("group/{major}.{minor}.{number}.{revision}")]
|
||||||
public ActionResult viewGroup(byte major, byte minor, ushort number, ushort? revision = null)
|
public ActionResult viewGroup(byte major, byte minor, ushort number, ushort? revision = null)
|
||||||
{
|
{
|
||||||
var builds = from b in Build.Select()
|
var builds = (from b in Build.Select()
|
||||||
group b by new BuildGroup()
|
group b by new BuildGroup()
|
||||||
{
|
{
|
||||||
Major = b.MajorVersion,
|
Major = b.MajorVersion,
|
||||||
|
@ -49,9 +49,18 @@ public ActionResult viewGroup(byte major, byte minor, ushort number, ushort? rev
|
||||||
where bg.Key.Minor == minor
|
where bg.Key.Minor == minor
|
||||||
where bg.Key.Build == number
|
where bg.Key.Build == number
|
||||||
where bg.Key.Revision == revision
|
where bg.Key.Revision == revision
|
||||||
select bg;
|
select bg).Single();
|
||||||
|
|
||||||
return builds.Count() == 1 ? View(builds.Single()) as ActionResult : Redirect("~/") as ActionResult;
|
return builds.Count() == 1 ?
|
||||||
|
RedirectToAction("viewBuild", new { id = builds.Single().Id }) as ActionResult :
|
||||||
|
View(builds);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("build/{id}")]
|
||||||
|
public ActionResult viewBuild(long id)
|
||||||
|
{
|
||||||
|
Build b = Build.SelectById(id);
|
||||||
|
return View(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
168
Views/front/viewBuild.cshtml
Normal file
168
Views/front/viewBuild.cshtml
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
@model BuildFeed.Models.Build
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewBag.Title = Model.FullBuildString + " | BuildFeed";
|
||||||
|
}
|
||||||
|
|
||||||
|
@section head
|
||||||
|
{
|
||||||
|
<link href="@Url.Action()" rel="canonical" />
|
||||||
|
<meta property="og:title" content="@Model.FullBuildString" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:url" content="@Url.Action()" />
|
||||||
|
@if (Model.BuildTime.HasValue)
|
||||||
|
{
|
||||||
|
<meta name="description" content="Discover about Windows Build @Model.Number, from @Model.Lab and compiled on @Model.BuildTime.Value.ToString("d MMMM yyyy")." />
|
||||||
|
<meta property="og:description" content="Discover about Windows Build @Model.Number, from @Model.Lab and compiled on @Model.BuildTime.Value.ToString("d MMMM yyyy")." />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<meta name="description" content="Discover about Windows Build @Model.Number, from @Model.Lab. BuildFeed tracks Windows builds throughout the development process." />
|
||||||
|
<meta property="og:description" content="Discover about Windows Build @Model.Number, from @Model.Lab. BuildFeed tracks Windows builds throughout the development process." />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>@Model.FullBuildString</h2>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-horizontal form-details">
|
||||||
|
@if (User.Identity.IsAuthenticated)
|
||||||
|
{
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-sm-4">Editor Actions</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">
|
||||||
|
@Html.ActionLink("Edit", "edit", new { id = Model.Id }, new { @class = "btn btn-default btn-xs" })
|
||||||
|
|
||||||
|
@if (Roles.IsUserInRole("Administrators"))
|
||||||
|
{
|
||||||
|
@Html.ActionLink("Delete", "delete", new { id = Model.Id }, new { @class = "btn btn-danger btn-xs" })
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.MajorVersion, new { @class = "control-label col-sm-4" })
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">@Html.DisplayFor(model => model.MajorVersion)</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.MinorVersion, new { @class = "control-label col-sm-4" })
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">@Html.DisplayFor(model => model.MinorVersion)</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.Number, new { @class = "control-label col-sm-4" })
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">@Html.DisplayFor(model => model.Number)</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.Revision, new { @class = "control-label col-sm-4" })
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">@Html.DisplayFor(model => model.Revision)</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.Lab, new { @class = "control-label col-sm-4" })
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">
|
||||||
|
@Model.Lab<br />
|
||||||
|
<a href="@Url.Action("lab", new { lab = Model.Lab })" class="more-link"><i class="fa fa-plus-square-o fa-sm"></i> Find more builds from @Model.Lab</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.BuildTime, new { @class = "control-label col-sm-4" })
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<p class="form-control-static">
|
||||||
|
@if (Model.BuildTime.HasValue)
|
||||||
|
{
|
||||||
|
<time datetime="@Model.BuildTime.Value.ToString("yyyy-MM-dd HH:mm")" title="@Model.BuildTime.Value.ToString("h:mm tt on dddd, d MMMM yyyy")">@Html.DisplayFor(model => model.BuildTime, "{0:yyMMdd-HHmm}")</time>
|
||||||
|
<br />
|
||||||
|
<a href="@Url.Action("year", new { year = Model.BuildTime.Value.Year })" class="more-link"><i class="fa fa-plus-square-o fa-sm"></i> Find more builds compiled in @Model.BuildTime.Value.Year</a>
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-details">
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.SourceType, new { @class = "control-label" })
|
||||||
|
<p class="form-control-static">
|
||||||
|
@Html.DisplayFor(model => model.SourceType, "Enumeration")<br />
|
||||||
|
<a href="@Url.Action("source", new { source = Model.SourceType })" class="more-link"><i class="fa fa-plus-square-o fa-sm"></i> Find more builds sourced from @Html.DisplayFor(model => model.SourceType, "Enumeration")</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (Model.LeakDate.HasValue)
|
||||||
|
{
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.LeakDate, new { @class = "control-label" })
|
||||||
|
<div class="form-control-static"><time datetime="@Model.LeakDate.Value.ToString("yyyy-MM-dd")" title="@Model.LeakDate.Value.ToString("dddd, d MMMM yyyy")">@Html.DisplayFor(model => model.LeakDate, "{0:dd/MM/yyyy}")</time></div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if ((Model.MajorVersion == 6 && Model.MinorVersion == 4) || (Model.MajorVersion == 10 && Model.MinorVersion == 0) && Model.FlightLevel != BuildFeed.Models.LevelOfFlight.None)
|
||||||
|
{
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.FlightLevel, new { @class = "control-label" })
|
||||||
|
<p class="form-control-static">@Html.DisplayFor(model => model.FlightLevel, "Enumeration")</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">Share</label>
|
||||||
|
<div class="addthis_sharing_toolbox"></div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.SourceDetails, new { @class = "control-label" })
|
||||||
|
<div class="form-control-static">@Html.Raw(Model.SourceDetails)</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-horizontal form-details">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-sm-2">Comments</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div id="disqus_thread"></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var disqus_shortname = 'buildfeed';
|
||||||
|
var disqus_url = 'https://buildfeed.net' + '@Url.Action()';
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||||
|
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||||
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-offset-2 col-sm-8">
|
||||||
|
<a href="@Url.Action("viewGroup", new { major = Model.MajorVersion, minor = Model.MinorVersion, number = Model.Number, revision = Model.Revision })" class="btn btn-default">Return to build overview</a>
|
||||||
|
 
|
||||||
|
<a href="@Url.Action("index")" class="btn btn-default">Return to build listing</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@section scripts
|
||||||
|
{
|
||||||
|
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5431719a661cbfd0" async="async"></script>
|
||||||
|
}
|
|
@ -20,7 +20,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="#" class="btn btn-info btn-xs">Info</a>
|
<a href="@Url.Action("viewBuild", new { id = build.Id })" class="btn btn-info btn-xs">Info</a>
|
||||||
<a href="#" class="btn btn-primary btn-xs">Edit</a>
|
<a href="#" class="btn btn-primary btn-xs">Edit</a>
|
||||||
<a href="#" class="btn btn-danger btn-xs">Delete</a>
|
<a href="#" class="btn btn-danger btn-xs">Delete</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user