Skip to content

Commit 32eaf72

Browse files
committed
Removing unnecessary template overrides
Raising minimum Joomla version to 4.0
1 parent 7a6c898 commit 32eaf72

File tree

8 files changed

+174
-600
lines changed

8 files changed

+174
-600
lines changed

administrator/components/com_patchtester/PatchTester/View/Pulls/tmpl/default.php

Lines changed: 139 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -6,130 +6,158 @@
66
* @license GNU General Public License version 2 or later
77
*/
88

9+
use Joomla\CMS\Factory;
910
use Joomla\CMS\HTML\HTMLHelper;
1011
use Joomla\CMS\Language\Text;
1112
use Joomla\CMS\Router\Route;
1213

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+
);
1428

1529
HTMLHelper::_('behavior.core');
16-
HTMLHelper::_('bootstrap.tooltip');
17-
HTMLHelper::_('formbehavior.chosen', 'select');
30+
HTMLHelper::_('searchtools.form', '#adminForm', $searchToolsOptions);
1831
HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', array('version' => '3.5.0', 'relative' => true));
1932
HTMLHelper::_('script', 'com_patchtester/patchtester.js', array('version' => 'auto', 'relative' => true));
2033

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'));
2236
$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'));
2539
?>
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>
113151
<?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; ?>
127152

128-
<?php echo $this->pagination->getListFooter(); ?>
153+
<?php echo $this->pagination->getListFooter(); ?>
129154

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>
134162
</div>
135163
</form>

administrator/components/com_patchtester/PatchTester/View/Pulls/tmpl/default_items.php

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,59 @@
1414
$status = '';
1515

1616
if ($item->applied) :
17-
$status = ' class="success"';
17+
$status = ' class="table-active"';
1818
endif;
19-
?>
19+
?>
2020
<tr<?php echo $status; ?>>
21-
<td class="center">
21+
<th scope="row" class="text-center">
2222
<?php echo $item->pull_id; ?>
23-
</td>
23+
</th>
2424
<td>
25-
<span class="hasTooltip"
26-
title="<strong>Info</strong><br/><?php echo $this->escape($item->description); ?>"><?php echo $this->escape($item->title); ?></span>
27-
<?php if ($item->applied) : ?>
28-
<div class="small">
29-
<span class="label label-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>
25+
<span><?php echo $this->escape($item->title); ?></span>
26+
<div role="tooltip" id="tip<?php echo $i; ?>">
27+
<?php echo $this->escape($item->description); ?>
28+
</div>
29+
<div class="row">
30+
<div class="col-md-auto">
31+
<a class="badge badge-info" href="<?php echo $item->pull_url; ?>" target="_blank">
32+
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_GITHUB'); ?>
33+
</a>
3034
</div>
31-
<?php endif; ?>
35+
<div class="col-md-auto">
36+
<a class="badge badge-info"
37+
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
38+
target="_blank">
39+
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER'); ?>
40+
</a>
41+
</div>
42+
<?php if ($item->applied) : ?>
43+
<div class="col-md-auto">
44+
<span class="badge badge-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>
45+
</div>
46+
<?php endif; ?>
47+
</div>
3248
</td>
33-
<td class="center hidden-phone">
49+
<td class="d-none d-md-table-cell text-center">
3450
<?php echo $this->escape($item->branch); ?>
3551
</td>
36-
<td class="center hidden-phone">
52+
<td class="d-none d-md-table-cell text-center">
3753
<?php if ($item->is_rtc) : ?>
38-
<span class="label label-success"><?php echo Text::_('JYES'); ?></span>
54+
<span class="badge badge-success"><?php echo Text::_('JYES'); ?></span>
3955
<?php else : ?>
40-
<span class="label label-primary"><?php echo Text::_('JNO'); ?></span>
56+
<span class="badge badge-secondary"><?php echo Text::_('JNO'); ?></span>
4157
<?php endif; ?>
4258
</td>
43-
<td class="center">
44-
<a class="btn btn-small btn-info" href="<?php echo $item->pull_url; ?>" target="_blank">
45-
<span class="octicon octicon-mark-github"></span> <?php echo Text::_('COM_PATCHTESTER_GITHUB'); ?>
46-
</a>
47-
</td>
48-
<?php if ($this->trackerAlias !== false) : ?>
49-
<td class="center">
50-
<a class="btn btn-small btn-warning"
51-
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
52-
target="_blank">
53-
<i class="icon-joomla"></i> <?php echo Text::_('COM_PATCHTESTER_JISSUE'); ?>
54-
</a>
55-
</td>
56-
<?php endif; ?>
57-
<td class="center">
59+
<td class="text-center">
5860
<?php if ($item->applied) : ?>
59-
<div>
60-
<span class="label label-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
61-
</div>
61+
<span class="badge badge-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
6262
<?php else : ?>
63-
<span class="label">
64-
<?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?>
65-
</span>
63+
<span class="badge badge-secondary"><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></span>
6664
<?php endif; ?>
6765
</td>
68-
<td class="center">
66+
<td class="text-center">
6967
<?php if ($item->applied) : ?>
7068
<button type="button" class="btn btn-sm btn-success submitPatch"
7169
data-task="revert-<?php echo (int) $item->applied; ?>"><?php echo Text::_('COM_PATCHTESTER_REVERT_PATCH'); ?></button>
72-
<br/>
7370
<?php else : ?>
7471
<button type="button" class="btn btn-sm btn-primary submitPatch"
7572
data-task="apply-<?php echo (int) $item->pull_id; ?>"><?php echo Text::_('COM_PATCHTESTER_APPLY_PATCH'); ?></button>

administrator/components/com_patchtester/patchtester.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<extension type="component" version="3.6" method="upgrade">
2+
<extension type="component" version="4.0" method="upgrade">
33
<name>com_patchtester</name>
44
<author>Joomla! Project</author>
55
<creationDate>17-October-2019</creationDate>
@@ -15,23 +15,20 @@
1515
<file driver="mysql" charset="utf8">install/sql/mysql/install.sql</file>
1616
<file driver="postgresql" charset="utf8">install/sql/postgresql/install.sql</file>
1717
<file driver="pgsql" charset="utf8">install/sql/postgresql/install.sql</file>
18-
<file driver="sqlsrv" charset="utf8">install/sql/sqlsrv/install.sql</file>
1918
</sql>
2019
</install>
2120
<uninstall>
2221
<sql>
2322
<file driver="mysql" charset="utf8">install/sql/mysql/uninstall.sql</file>
2423
<file driver="postgresql" charset="utf8">install/sql/postgresql/uninstall.sql</file>
2524
<file driver="pgsql" charset="utf8">install/sql/postgresql/uninstall.sql</file>
26-
<file driver="sqlsrv" charset="utf8">install/sql/sqlsrv/uninstall.sql</file>
2725
</sql>
2826
</uninstall>
2927
<update>
3028
<schemas>
3129
<schemapath type="mysql">install/sql/updates/mysql</schemapath>
3230
<schemapath type="postgresql">install/sql/updates/postgresql</schemapath>
3331
<schemapath type="pgsql">install/sql/updates/postgresql</schemapath>
34-
<schemapath type="sqlsrv">install/sql/updates/sqlsrv</schemapath>
3532
</schemas>
3633
</update>
3734
<media destination="com_patchtester" folder="media">

0 commit comments

Comments
 (0)