|
6 | 6 | * @license GNU General Public License version 2 or later |
7 | 7 | */ |
8 | 8 |
|
| 9 | +use Joomla\CMS\Factory; |
9 | 10 | use Joomla\CMS\HTML\HTMLHelper; |
10 | 11 | use Joomla\CMS\Language\Text; |
11 | 12 | use Joomla\CMS\Router\Route; |
12 | 13 |
|
13 | | -/** @var \PatchTester\View\Pulls\PullsHtmlView $this */ |
| 14 | +/** @var \PatchTester\View\Pulls\PullsHtmlView $this */ |
| 15 | + |
| 16 | +$searchToolsOptions = array( |
| 17 | + 'filtersHidden' => true, |
| 18 | + 'filterButton' => true, |
| 19 | + 'defaultLimit' => Factory::getApplication()->get('list_limit', 20), |
| 20 | + 'searchFieldSelector' => '#filter_search', |
| 21 | + 'selectorFieldName' => 'client_id', |
| 22 | + 'showSelector' => false, |
| 23 | + 'orderFieldSelector' => '#list_fullordering', |
| 24 | + 'showNoResults' => false, |
| 25 | + 'noResultsText' => '', |
| 26 | + 'formSelector' => '#adminForm', |
| 27 | +); |
14 | 28 |
|
15 | 29 | HTMLHelper::_('behavior.core'); |
16 | | -HTMLHelper::_('bootstrap.tooltip'); |
17 | | -HTMLHelper::_('formbehavior.chosen', 'select'); |
| 30 | +HTMLHelper::_('searchtools.form', '#adminForm', $searchToolsOptions); |
18 | 31 | HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', array('version' => '3.5.0', 'relative' => true)); |
19 | 32 | HTMLHelper::_('script', 'com_patchtester/patchtester.js', array('version' => 'auto', 'relative' => true)); |
20 | 33 |
|
21 | | -$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC')); |
| 34 | +$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC')); |
| 35 | +$listLimit = (int) ($this->state->get('list.limit')); |
22 | 36 | $filterApplied = $this->escape($this->state->get('filter.applied')); |
23 | | -$filterBranch = $this->escape($this->state->get('filter.branch')); |
24 | | -$filterRtc = $this->escape($this->state->get('filter.rtc')); |
| 37 | +$filterBranch = $this->escape($this->state->get('filter.branch')); |
| 38 | +$filterRtc = $this->escape($this->state->get('filter.rtc')); |
25 | 39 | ?> |
26 | | -<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" |
27 | | - id="adminForm" data-order="<?php echo $listOrder; ?>"> |
28 | | - <div id="j-main-container"> |
29 | | - <div id="filter-bar" class="btn-toolbar"> |
30 | | - <div class="filter-search btn-group pull-left"> |
31 | | - <label for="filter_search" |
32 | | - class="element-invisible"><?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?></label> |
33 | | - <input type="text" name="filter_search" |
34 | | - placeholder="<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>" |
35 | | - id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" |
36 | | - title="<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>"/> |
37 | | - </div> |
38 | | - <div class="btn-group pull-left hidden-phone"> |
39 | | - <button class="btn tip hasTooltip" type="submit" |
40 | | - title="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button> |
41 | | - <button class="btn tip hasTooltip" type="button" |
42 | | - onclick="document.getElementById('filter_search').value='';this.form.submit();" |
43 | | - title="<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>"><i class="icon-remove"></i></button> |
44 | | - </div> |
45 | | - <div class="btn-group pull-right hidden-phone"> |
46 | | - <label for="limit" |
47 | | - class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label> |
48 | | - <?php echo $this->pagination->getLimitBox(); ?> |
49 | | - </div> |
50 | | - <div class="btn-group pull-right"> |
51 | | - <label for="list_fullordering" |
52 | | - class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label> |
53 | | - <select name="list_fullordering" id="list_fullordering" class="input-medium" |
54 | | - onchange="this.form.submit();"> |
55 | | - <option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option> |
56 | | - <?php echo HTMLHelper::_('select.options', $this->getSortFields(), 'value', 'text', $listOrder); ?> |
57 | | - </select> |
58 | | - </div> |
59 | | - <div class="btn-group pull-right"> |
60 | | - <label for="filter_applied" |
61 | | - class="element-invisible"><?php echo Text::_('JSEARCH_TOOLS_DESC'); ?></label> |
62 | | - <select name="filter_applied" class="input-medium" onchange="this.form.submit();"> |
63 | | - <option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option> |
64 | | - <option value="yes"<?php if ($filterApplied == 'yes') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></option> |
65 | | - <option value="no"<?php if ($filterApplied == 'no') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option> |
66 | | - </select> |
67 | | - </div> |
68 | | - <div class="btn-group pull-right"> |
69 | | - <label for="filter_rtc" class="element-invisible"><?php echo Text::_('JSEARCH_TOOLS_DESC'); ?></label> |
70 | | - <select name="filter_rtc" class="input-medium" onchange="this.form.submit();"> |
71 | | - <option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_RTC_PATCHES'); ?></option> |
72 | | - <option value="yes"<?php if ($filterRtc == 'yes') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_RTC'); ?></option> |
73 | | - <option value="no"<?php if ($filterRtc == 'no') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_RTC'); ?></option> |
74 | | - </select> |
75 | | - </div> |
76 | | - <div class="btn-group pull-right"> |
77 | | - <label for="filter_branch" |
78 | | - class="element-invisible"><?php echo Text::_('JSEARCH_TOOLS_DESC'); ?></label> |
79 | | - <select name="filter_branch" class="input-medium" onchange="this.form.submit();"> |
80 | | - <option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_BRANCH'); ?></option> |
81 | | - <?php echo HTMLHelper::_('select.options', $this->branches, 'text', 'text', $filterBranch, false); ?> |
82 | | - </select> |
83 | | - </div> |
84 | | - </div> |
85 | | - |
86 | | - <?php if (empty($this->items)) : ?> |
87 | | - <div class="alert alert-no-items"> |
88 | | - <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> |
89 | | - </div> |
90 | | - <?php else : ?> |
91 | | - <table class="table table-striped"> |
92 | | - <thead> |
93 | | - <tr> |
94 | | - <th width="5%" class="nowrap center"> |
95 | | - <?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?> |
96 | | - </th> |
97 | | - <th class="nowrap"> |
98 | | - <?php echo Text::_('JGLOBAL_TITLE'); ?> |
99 | | - </th> |
100 | | - <th width="8%" class="nowrap center hidden-phone"> |
101 | | - <?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?> |
102 | | - </th> |
103 | | - <th width="8%" class="nowrap center hidden-phone"> |
104 | | - <?php echo Text::_('COM_PATCHTESTER_READY_TO_COMMIT'); ?> |
105 | | - </th> |
106 | | - <th width="8%" class="nowrap center"> |
107 | | - <?php echo Text::_('COM_PATCHTESTER_GITHUB'); ?> |
108 | | - </th> |
109 | | - <?php if ($this->trackerAlias !== false) : ?> |
110 | | - <th width="8%" class="nowrap center"> |
111 | | - <?php echo Text::_('COM_PATCHTESTER_JISSUES'); ?> |
112 | | - </th> |
| 40 | +<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm"> |
| 41 | + <div class="row"> |
| 42 | + <div class="col-md-12"> |
| 43 | + <div id="j-main-container" class="j-main-container"> |
| 44 | + <div class="js-stools" role="search"> |
| 45 | + <div class="js-stools-container-bar"> |
| 46 | + <div class="btn-toolbar"> |
| 47 | + <div class="btn-group mr-2"> |
| 48 | + <div class="input-group"> |
| 49 | + <label for="filter_search" class="sr-only"> |
| 50 | + <?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?> |
| 51 | + </label> |
| 52 | + <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="form-control" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>"> |
| 53 | + <div role="tooltip" id="filter_search-desc"> |
| 54 | + <?php echo $this->escape(Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION')); ?> |
| 55 | + </div> |
| 56 | + <span class="input-group-append"> |
| 57 | + <button type="submit" class="btn btn-primary" aria-label="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>"> |
| 58 | + <span class="fa fa-search" aria-hidden="true"></span> |
| 59 | + </button> |
| 60 | + </span> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + <div class="btn-group"> |
| 64 | + <button type="button" class="btn btn-primary hasTooltip js-stools-btn-filter"> |
| 65 | + <?php echo Text::_('JFILTER_OPTIONS'); ?> |
| 66 | + <span class="fa fa-angle-down" aria-hidden="true"></span> |
| 67 | + </button> |
| 68 | + <button type="button" class="btn btn-primary js-stools-btn-clear mr-2"> |
| 69 | + <?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?> |
| 70 | + </button> |
| 71 | + </div> |
| 72 | + <div class="ordering-select"> |
| 73 | + <div class="js-stools-field-list"> |
| 74 | + <select name="list_fullordering" id="list_fullordering" class="custom-select" onchange="this.form.submit()"> |
| 75 | + <option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option> |
| 76 | + <?php echo HTMLHelper::_('select.options', $this->getSortFields(), 'value', 'text', $listOrder); ?> |
| 77 | + </select> |
| 78 | + </div> |
| 79 | + <div class="js-stools-field-list"> |
| 80 | + <span class="sr-only"> |
| 81 | + <label id="list_limit-lbl" for="list_limit">Select number of items per page.</label> |
| 82 | + </span> |
| 83 | + <select name="list_limit" id="list_limit" class="custom-select" onchange="this.form.submit()"> |
| 84 | + <?php echo HTMLHelper::_('select.options', $this->getLimitOptions(), 'value', 'text', $listLimit); ?> |
| 85 | + </select> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + <!-- Filters div --> |
| 91 | + <div class="js-stools-container-filters clearfix"> |
| 92 | + <div class="js-stools-field-filter"> |
| 93 | + <select name="filter_applied" class="custom-select" onchange="this.form.submit();"> |
| 94 | + <option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option> |
| 95 | + <option value="yes"<?php echo $filterApplied == 'yes' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></option> |
| 96 | + <option value="no"<?php echo $filterApplied == 'no' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option> |
| 97 | + </select> |
| 98 | + </div> |
| 99 | + <div class="js-stools-field-filter"> |
| 100 | + <select name="filter_rtc" class="custom-select" onchange="this.form.submit();"> |
| 101 | + <option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_RTC_PATCHES'); ?></option> |
| 102 | + <option value="yes"<?php echo $filterRtc == 'yes' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_RTC'); ?></option> |
| 103 | + <option value="no"<?php echo $filterRtc == 'no' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_RTC'); ?></option> |
| 104 | + </select> |
| 105 | + </div> |
| 106 | + <div class="js-stools-field-filter"> |
| 107 | + <select name="filter_branch" class="custom-select" onchange="this.form.submit();"> |
| 108 | + <option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_BRANCH'); ?></option> |
| 109 | + <?php echo HTMLHelper::_('select.options', $this->branches, 'text', 'text', $filterBranch, false); ?> |
| 110 | + </select> |
| 111 | + </div> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + <div id="j-main-container" class="j-main-container"> |
| 115 | + <?php if (empty($this->items)) : ?> |
| 116 | + <div class="alert alert-info"> |
| 117 | + <span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span> |
| 118 | + <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> |
| 119 | + </div> |
| 120 | + <?php else : ?> |
| 121 | + <table class="table"> |
| 122 | + <caption id="captionTable" class="sr-only"> |
| 123 | + <?php echo Text::_('COM_PATCHTESTER_PULLS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?> |
| 124 | + </caption> |
| 125 | + <thead> |
| 126 | + <tr> |
| 127 | + <th scope="col" style="width:5%" class="text-center"> |
| 128 | + <?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?> |
| 129 | + </th> |
| 130 | + <th scope="col" style="min-width:100px"> |
| 131 | + <?php echo Text::_('JGLOBAL_TITLE'); ?> |
| 132 | + </th> |
| 133 | + <th scope="col" style="width:8%" class="d-none d-md-table-cell text-center"> |
| 134 | + <?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?> |
| 135 | + </th> |
| 136 | + <th scope="col" style="width:8%" class="d-none d-md-table-cell text-center"> |
| 137 | + <?php echo Text::_('COM_PATCHTESTER_READY_TO_COMMIT'); ?> |
| 138 | + </th> |
| 139 | + <th scope="col" style="width:10%" class="text-center"> |
| 140 | + <?php echo Text::_('JSTATUS'); ?> |
| 141 | + </th> |
| 142 | + <th scope="col" style="width:15%" class="text-center"> |
| 143 | + <?php echo Text::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?> |
| 144 | + </th> |
| 145 | + </tr> |
| 146 | + </thead> |
| 147 | + <tbody> |
| 148 | + <?php echo $this->loadTemplate('items'); ?> |
| 149 | + </tbody> |
| 150 | + </table> |
113 | 151 | <?php endif; ?> |
114 | | - <th width="10%" class="nowrap center"> |
115 | | - <?php echo Text::_('JSTATUS'); ?> |
116 | | - </th> |
117 | | - <th width="15%" class="nowrap center"> |
118 | | - <?php echo Text::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?> |
119 | | - </th> |
120 | | - </tr> |
121 | | - </thead> |
122 | | - <tbody> |
123 | | - <?php echo $this->loadTemplate('items'); ?> |
124 | | - </tbody> |
125 | | - </table> |
126 | | - <?php endif; ?> |
127 | 152 |
|
128 | | - <?php echo $this->pagination->getListFooter(); ?> |
| 153 | + <?php echo $this->pagination->getListFooter(); ?> |
129 | 154 |
|
130 | | - <input type="hidden" name="task" value=""/> |
131 | | - <input type="hidden" name="boxchecked" value="0"/> |
132 | | - <input type="hidden" name="pull_id" id="pull_id" value=""/> |
133 | | - <?php echo HTMLHelper::_('form.token'); ?> |
| 155 | + <input type="hidden" name="task" value="" /> |
| 156 | + <input type="hidden" name="boxchecked" value="0" /> |
| 157 | + <input type="hidden" name="pull_id" id="pull_id" value="" /> |
| 158 | + <?php echo HTMLHelper::_('form.token'); ?> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | + </div> |
134 | 162 | </div> |
135 | 163 | </form> |
0 commit comments