|
3 | 3 | TrackIt | Tickets |
4 | 4 | {% endblock %} |
5 | 5 | {% block head %} |
6 | | -<!-- <link rel="stylesheet" href="//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"> --> |
| 6 | +<!-- DataTables.net css --> |
7 | 7 | <link rel="stylesheet" type="text/css" |
8 | 8 | href="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-html5-1.6.1/cr-1.5.2/r-2.2.3/sp-1.0.1/sl-1.3.1/datatables.min.css" /> |
9 | 9 | {% endblock %} |
10 | 10 | {% block page_heading %} |
11 | 11 | <i class="material-icons-outlined">confirmation_number</i> Tickets ({{ tickets.count }}) |
12 | 12 | <a class="btn btn-primary float-right" href="{% url 'add_ticket' %}">Raise Ticket |
13 | 13 | <i class="material-icons align-bottom">add</i></a> |
| 14 | +<hr> |
14 | 15 | {% endblock %} |
| 16 | +{% block container-class %}tickets-container{% endblock %} |
15 | 17 | {% block content %} |
16 | 18 | <div class="row"> |
17 | 19 | <div class="col col-12"> |
18 | | - <br> |
19 | | - <table class="table table-hover table-responsive display" id="tickets-table"> |
| 20 | + <a href="{% url 'tickets' %}" class="btn btn-light btn-sm float-right align-top">Reset</a> |
| 21 | + <table class="table table-hover table-responsive display" style="width:100%" id="tickets-table"> |
20 | 22 | <thead> |
21 | 23 | <tr> |
22 | 24 | <th>ID</th> |
|
26 | 28 | <th>Assignee</th> |
27 | 29 | <th>Priority</th> |
28 | 30 | <th>Status</th> |
29 | | - <th>Created</th> |
30 | | - <th>Age (days)</th> |
31 | | - <th>Upvotes</th> |
| 31 | + <th>Submitted</th> |
| 32 | + <th>Resolved</th> |
32 | 33 | </tr> |
33 | 34 | </thead> |
34 | 35 | <tbody> |
35 | 36 | {% for ticket in tickets %} |
36 | 37 | {% if ticket.status == "New" %} |
37 | | - <tr data-url="{% url 'view_ticket' ticket.id %}" class="table-light clickable-row"> |
| 38 | + <tr data-url="{% url 'view_ticket' ticket.id %}" class="table-info clickable-row"> |
38 | 39 | {% elif ticket.status == "In Progress" %} |
39 | 40 | <tr data-url="{% url 'view_ticket' ticket.id %}" class="table-warning clickable-row"> |
40 | 41 | {% elif ticket.status == "Resolved" %} |
41 | 42 | <tr data-url="{% url 'view_ticket' ticket.id %}" class="table-success clickable-row"> |
| 43 | + {% elif ticket.status == "Cancelled" %} |
| 44 | + <tr data-url="{% url 'view_ticket' ticket.id %}" class="table-secondary clickable-row"> |
42 | 45 | {% endif %} |
43 | 46 | <td>{{ ticket.id }}</td> |
44 | 47 | <td><a href="{% url 'view_ticket' ticket.id %}" data-toggle="tooltip" data-placement="bottom" |
45 | 48 | title="{{ ticket.description }}">{{ ticket.summary }}</a></td> |
46 | 49 | {% if ticket.ticket_type == "Bug" %} |
47 | | - <td><i class="material-icons-outlined" data-toggle="tooltip" title="Bug" |
| 50 | + <td><i class="material-icons-outlined ticket-type-icon" data-toggle="tooltip" title="Bug" |
48 | 51 | data-placement="left">bug_report</i> |
49 | 52 | </td> |
50 | 53 | {% else %} |
51 | | - <td><i class="material-icons-outlined" data-toggle="tooltip" title="Feature" |
| 54 | + <td><i class="material-icons-outlined ticket-type-icon" data-toggle="tooltip" title="Feature" |
52 | 55 | data-placement="left">build</i><span class="d-none">Feature</span> |
53 | 56 | </td> |
54 | 57 | {% endif %} |
|
75 | 78 | <td><i class="material-icons" data-toggle="tooltip" title="Resolved" data-placement="right">done</i><span |
76 | 79 | class="d-none">Resolved</span></td> |
77 | 80 | {% elif ticket.status == "Cancelled" %} |
78 | | - <td><i class="material-icons" data-toggle="tooltip" title="Cancelled" |
| 81 | + <td><i class="material-icons-outlined" data-toggle="tooltip" title="Cancelled" |
79 | 82 | data-placement="right">cancel</i><span class="d-none">Cancelled</span></td> |
80 | 83 | {% endif %} |
81 | 84 | <td>{{ ticket.created_date.date }}</td> |
82 | | - <!-- {% if ticket.resolved_date == None %} |
| 85 | + {% if ticket.resolved_date == None %} |
83 | 86 | <td>--</td> |
84 | 87 | {% else %} |
85 | | - <td>{{ ticket.resolved_date }}</td> |
86 | | - {% endif %} --> |
87 | | - <td>{{ ticket.age }}</td> |
88 | | - <td>{{ ticket.upvotes }}</td> |
| 88 | + <td>{{ ticket.resolved_date.date }}</td> |
| 89 | + {% endif %} |
89 | 90 | </tr> |
90 | 91 | {% endfor %} |
91 | 92 | </tbody> |
| 93 | + <tfoot> |
| 94 | + <!-- Search Inputs for each column--> |
| 95 | + <tr id="ticket-search-boxes"> |
| 96 | + <th></th> |
| 97 | + <th></th> |
| 98 | + <th></th> |
| 99 | + <th></th> |
| 100 | + <th></th> |
| 101 | + <th></th> |
| 102 | + <th></th> |
| 103 | + <th></th> |
| 104 | + <th></th> |
| 105 | + </tr> |
| 106 | + </tfoot> |
92 | 107 | </table> |
93 | 108 | </div> |
94 | 109 | </div> |
95 | 110 | {% endblock %} |
96 | 111 | {% block scripts %} |
97 | | -<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script> |
| 112 | +<!-- PDF Maker js --> |
98 | 113 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script> |
| 114 | +<!-- VFS Fonts js --> |
99 | 115 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script> |
| 116 | +<!-- DataTables js --> |
100 | 117 | <script type="text/javascript" |
101 | 118 | src="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-html5-1.6.1/cr-1.5.2/r-2.2.3/sp-1.0.1/sl-1.3.1/datatables.min.js"></script> |
102 | | -<script> |
103 | | - $(document).ready(function () { |
104 | | - $('#tickets-table').DataTable({ |
105 | | - /* |
106 | | - dom: 'Prftip', |
107 | | - layout: 'columns-1', |
108 | | - searchPanes: { |
109 | | - orderable: false, |
110 | | - }, |
111 | | - columns: [2] |
112 | | - dom: '<"dtsp-verticalContainer"<"dtsp-verticalPanes"P><"dtsp-dataTable"frtip>>' |
113 | | - dataLength: 20, |
114 | | - dom: 'Brftip', |
115 | | - pageLength: 20, |
116 | | - responsive: true, |
117 | | - colReorder: true, |
118 | | - "scrollX": true, |
119 | | - buttons: ['copy', 'excel', 'pdf'] |
120 | | - */ |
121 | | - }); |
122 | | - $('.clickable-row').on("click", function () { |
123 | | - window.location = $(this).data("url"); |
124 | | - }); |
125 | | - }); |
126 | | -</script> |
127 | 119 | {% endblock %} |
0 commit comments