Show bugs on release pages

This commit is contained in:
Michael 2017-04-14 18:35:45 -04:00
parent 4fd744368c
commit efc9acb106
3 changed files with 59 additions and 2 deletions

View file

@ -127,7 +127,7 @@ public List<SelectListItem> Versions
{
var db = new ApplicationDbContext();
var items = new List<SelectListItem>();
foreach(var itm in db.Downloads.OrderByDescending(x => x.PostDate))
foreach(var itm in db.Downloads.Where(x=>x.Obsolete == false).OrderByDescending(x => x.PostDate))
{
items.Add(new SelectListItem
{

View file

@ -12,6 +12,15 @@ public class Download
[Required]
public string Id { get; set; }
public Bug[] OpenBugs
{
get
{
return new ApplicationDbContext().Bugs.Where(x => x.ReleaseId == this.Id && x.Open == true).ToArray();
}
}
[Required]
public string Name { get; set; }

View file

@ -30,6 +30,54 @@
}
@Html.Markdown(Model.Changelog)
<h4>Reported bugs</h4>
@if (Model.OpenBugs.Length == 0)
{
<p>There are no reported bugs to display.</p>
}
else
{
<table class="table">
<tr>
<th style="width:55%">Bug</th>
<th>Urgency</th>
<th>Actions</th>
</tr>
@foreach (var bug in Model.OpenBugs.OrderByDescending(x=>x.Urgency))
{
<tr>
<td>
@Html.ActionLink(bug.Name, "ViewBug", "Bugs", null, new { id=bug.Id})<br/>
Opened by @Html.UserLink(bug.Reporter) at @bug.ReportedAt
</td>
<th>
@switch (bug.Urgency)
{
case 0:
<strong>Minor</strong>
break;
case 1:
<strong>Moderate</strong>
break;
case 2:
<strong>Major</strong>
break;
case 3:
<strong>Critical</strong>
break;
}
</th>
<th>
<a href="@Url.Action("ViewBug", "Bugs", new {id=bug.Id})" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> View bug</a>
</th>
</tr>
}
</table>
}
</div>
<div class="col-xs-4">
<h3>Download</h3>