summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Bugs/Index.cshtml
blob: fba2f91d1323e1a53ad5e9453d16171dc5801e94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@model IEnumerable<Project_Unite.Models.BugTag>
@using Project_Unite.Models;
@{
    var db = new ApplicationDbContext();
    ViewBag.Title = "Bugtracker";
}

<h2>Bugtracker</h2>

@{ 
    Html.RenderPartial("~/Views/Bugs/_BugBar.cshtml");
}

<div class="row">
    <div class="col-xs-4">
        <h4>Bug types</h4>

        <ul id="tabs" data-tabs="tabs" class="nav nav-stacked nav-pills">
            @foreach(var cat in Model.ToArray())
            {
                string c = "";
                if(cat == Model.First())
                {
                    c = "active";
                }
                <li class="@c"><a href="#[email protected]" data-toggle="tab">@cat.Name (@cat.Open.Length)</a></li>
            }
        </ul>
    </div>

    <div class="tab-content col-xs-8">
        @foreach(var category in Model.ToArray())
        {
            string c = "tab-pane fade in";
            if(category == Model.First())
            {
                c += " active";
            }
            <div class="@c" id="[email protected]">
                <h2>@category.Name</h2>
                <p>@category.Description</p>

                <table class="table">
                    <tr>
                        <th class="width:50%">Open</th>
                        <th>Urgency</th>
                        <th>Actions</th>
                    </tr>
                @foreach(var bug in category.Open.OrderByDescending(x=>x.Urgency))
                {
                    <tr>
                        <td>
                            <div class="modal fade in"   id="[email protected]">
                                <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h2>View bug</h2>
                                    </div>
                                    <div class="modal-body">
                                        @Html.Partial("~/Views/Bugs/ViewBug.cshtml", new ViewBugViewModel
                                   {
                                       BugData = bug,
                                        Comment = ""
                                   })
                                    </div>
                                    <div class="modal-footer">
                                        <button data-dissmiss="modal" data-target="#[email protected]" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span> Done</button>
                                    </div>
                                </div>
                                    </div> @*I'm gonna regret this...*@
                            </div>
                            <strong><a href="#[email protected]" data-toggle="modal">@bug.Name</a></strong><br/>
                            <p>Reported at: @bug.ReportedAt &bull; Reported by: @Html.UserLink(bug.Reporter)</p>
                        </td>
                        @switch (bug.Urgency)
                                {
                                    case 0:
                                        <td><strong>Minor</strong></td>
                                break;
                            case 1:
                                <td><strong>Moderate</strong></td>
                                break;
                            case 2:
                                <td class="warning"><sttrong>Major</sttrong></td>
                                break;
                            case 3:
                                <td class="danger"><strong>Critical</strong></td>
                                break;
                        }
                        <td>
                            <a class="btn btn-primary" href="@Url.Action("CloseBug", new {id=bug.Id})"><span class="glyphicon glyphicon-ok"></span> Close bug report</a>
                        </td>
                    </tr>
                }
                </table>
            </div>
        }
    </div>
</div>