/
issue-list.html
97 lines (94 loc) · 4.42 KB
/
issue-list.html
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
<set headings="{{ array('id', 'title', 'type', 'priority', 'status', 'parent_id', 'author', 'assignee', 'sprint', 'repeat_cycle', 'created', 'due') }}" />
<set bulkUpdate="{{ isset(@statuses) && isset(@groups) && isset(@users) && isset(@priorities) && isset(@sprints) && isset(@issue_types) }}" />
<check if="{{ !empty(@GET.status) && @GET.status != 'open' }}">
{~ @headings[] = 'closed' ~}
</check>
<set randid="{{ rand() }}" />
<form action="{{ @BASE }}/issues" method="get" class="table-responsive filter-form" id="form-filter-issues-{{ @randid }}">
<check if="{{ !empty(@heading_links_enabled) }}">
<input type="hidden" name="orderby" value="{{ (!empty(@GET.orderby) ? @GET.orderby : 'priority') | esc }}" />
<input type="hidden" name="ascdesc" value="{{ (!empty(@GET.ascdesc) ? @GET.ascdesc : 'desc') | esc }}" />
</check>
<table class="table table-striped table-hover table-condensed issue-list">
<thead>
<check if="{{ !empty(@show_filters) }}">
<include href="blocks/issue-list/filters.html" />
</check>
<tr>
<check if="{{ @bulkUpdate }}">
<th><input type="checkbox" class="chk-toggle-all"></th>
</check>
<check if="{{ !empty(@heading_links_enabled) }}">
<true>
<repeat group="{{ @headings }}" value="{{ @heading }}">
<th class="nowrap"><a href="#" class="issue-sort nolink" id="{{ @heading }}">
<check if="{{ !empty(@GET.orderby) && @GET.orderby == @heading }}">
<true>
<check if="{{ !empty(@GET.ascdesc) && @GET.ascdesc == 'asc' }}">
<true><span class="fa fa-chevron-up"></span></true>
<false><span class="fa fa-chevron-down"></span></false>
</check>
</true>
</check>
{{ !empty(@dict.cols[@heading]) ? @dict.cols[@heading] : ucwords(str_replace(array('_', 'id'), array(' ', 'ID'), @heading)) }}
</a></th>
</repeat>
</true>
<false>
<repeat group="{{ @headings }}" value="{{ @heading }}">
<th class="nowrap">{{ !empty(@dict.cols[@heading]) ? @dict.cols[@heading] : ucwords(str_replace(array('_', 'id'), array(' ', 'ID'), @heading)) }}</th>
</repeat>
</false>
</check>
</tr>
</thead>
<tbody>
<repeat group="{{ @issues.subset }}" value="{{ @item }}">
<include href="blocks/issue-list/issue.html" />
</repeat>
</tbody>
</table>
</form>
<check if="{{ @bulkUpdate }}">
<include href="blocks/issue-list/bulk-update.html" />
</check>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
$.ajax({
url: BASE + '/js/typeahead.jquery.js',
cache: true,
dataType: "script",
success: function() {
$('input[data-typeahead="issues"]').typeahead({
classNames: {
menu: 'dropdown-menu'
}
}, {
async: true,
limit: 10,
source: function(query, syncResults, asyncResults) {
$.ajax({
url: BASE + '/issues/parent_ajax',
data: { 'q': query },
success: function(data) {
asyncResults(data.results);
},
dataType: 'json',
cache: false
});
},
display: function(element) {
return element.id;
},
templates: {
suggestion: function(element) {
return '<div><span class="text-muted">#' + element.id + '</span> ' + new Option(element.text).innerHTML + '</div>';
}
}
}).bind('typeahead:select', function() {
$('#form-filter-issues-{{ @randid }}').submit();
});
}
});
});
</script>