summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Project-Unite/Models/BugModels.cs2
-rw-r--r--Project-Unite/Models/Download.cs9
-rw-r--r--Project-Unite/Views/Download/ViewRelease.cshtml50
3 files changed, 59 insertions, 2 deletions
diff --git a/Project-Unite/Models/BugModels.cs b/Project-Unite/Models/BugModels.cs
index 0ccca4a..0e31c7e 100644
--- a/Project-Unite/Models/BugModels.cs
+++ b/Project-Unite/Models/BugModels.cs
@@ -127,7 +127,7 @@ namespace Project_Unite.Models
{
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
{
diff --git a/Project-Unite/Models/Download.cs b/Project-Unite/Models/Download.cs
index 69de79e..545e4ff 100644
--- a/Project-Unite/Models/Download.cs
+++ b/Project-Unite/Models/Download.cs
@@ -12,6 +12,15 @@ namespace Project_Unite.Models
[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; }
diff --git a/Project-Unite/Views/Download/ViewRelease.cshtml b/Project-Unite/Views/Download/ViewRelease.cshtml
index 56b8453..e6bc1de 100644
--- a/Project-Unite/Views/Download/ViewRelease.cshtml
+++ b/Project-Unite/Views/Download/ViewRelease.cshtml
@@ -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>
@@ -40,7 +88,7 @@
<p>If you have any issues with this build, please let us know. Also, to find out a bit more about the build, if you haven't already, check out the details to the left!</p>
@if (Model.Obsolete)
- {
+ {
<h4>This build is obsolete!</h4>
<p>We no longer support this build, and thus, any issues with this build that arise as we develop the game further will not be fixed. Consider picking up a more up-to-date build?</p>