33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-11-15 17:47:10 +00:00
This commit is contained in:
dgt41 2015-05-07 00:44:44 +03:00
parent babbc3c613
commit 5ea1baccba
2 changed files with 81 additions and 29 deletions

View File

@ -13,16 +13,38 @@ JHtml::_('bootstrap.tooltip');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$filterApplied = $this->escape($this->state->get('filter.applied'));
$sortFields = $this->getSortFields();
JFactory::getDocument()->addScriptDeclaration(
"
var submitpatch = function (task, id) {
document.getElementById('pull_id').set('value', id);
jQuery('#pull_id').val(id);
console.log(id);
task = task.substr(5);
return Joomla.submitbutton(task);
}
Joomla.orderTable = function() {
table = document.getElementById('sortTable');
direction = document.getElementById('directionTable');
order = table.options[table.selectedIndex].value;
if (order != '" . $listOrder . "') {
dirn = 'asc';
} else {
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
"
);
JFactory::getDocument()->addStyleDeclaration(
'
.icon-48-patchtester { background-image:url("/media/com_patchtester/images/icon-48-patchtester.png"); }
'
);
echo JHtmlBootstrap::renderModal(
'modal-refresh', array(
'url' => JUri::root() . 'administrator/index.php?option=com_patchtester&view=fetch&tmpl=component',
@ -34,34 +56,61 @@ echo JHtmlBootstrap::renderModal(
?>
<form action="<?php echo JRoute::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container">
<fieldset id="filter-bar">
<legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend>
<div class="filter-search">
<button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button type="button" onclick="document.getElementById('filter_search').value='';document.getElementById('filter_searchid').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo \JText::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?></label>
<input type="text" name="filter_search" placeholder="<?php echo \JText::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo \JText::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>" />
</div>
<div class="btn-group pull-left hidden-phone">
<button class="btn tip hasTooltip" type="submit" title="<?php echo \JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button class="btn tip hasTooltip" type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();" title="<?php echo \JText::_('JSEARCH_FILTER_CLEAR'); ?>"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo \JText::_('JFIELD_ORDERING_DESC'); ?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo \JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo \JText::_('JGLOBAL_ORDER_ASCENDING'); ?></option>
<option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo \JText::_('JGLOBAL_ORDER_DESCENDING'); ?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo \JText::_('JGLOBAL_SORT_BY'); ?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo \JText::_('JGLOBAL_SORT_BY'); ?></option>
<?php echo \JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
</select>
</div>
<div class="btn-group pull-right">
<label for="filter_applied" class="element-invisible"><?php echo \JText::_('JGLOBAL_SORT_BY'); ?></label>
<select name="filter_applied" class="input-medium" onchange="this.form.submit();">
<option value=""><?php echo \JText::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option>
<option value="yes"<?php if ($filterApplied == 'yes') echo ' selected="selected"'; ?>><?php echo \JText::_('COM_PATCHTESTER_APPLIED'); ?></option>
<option value="no"<?php if ($filterApplied == 'no') echo ' selected="selected"'; ?>><?php echo \JText::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option>
</select>
</div>
</div>
</fieldset>
<div class="clr"> </div>
<table class="adminlist">
<thead>
<tr>
<th width="5%" class="title nowrap center">
<th width="5%" class="nowrap center">
<?php echo JHtml::_('grid.sort', 'COM_PATCHTESTER_PULL_ID', 'number', $listDirn, $listOrder); ?>
<br />
<input type="text" name="filter_searchid" id="filter_searchid" class="span10" value="<?php echo $this->escape($this->state->get('filter.searchid')); ?>" />
</th>
<th class="title nowrap center">
<th class="nowrap">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?>
<br />
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" />
</th>
<th class="title nowrap center">I</th>
<th width="20%" class="title nowrap center">
<?php echo JText::_('JSTATUS'); ?>
<th width="8%" class="nowrap center">
<?php echo \JText::_('COM_PATCHTESTER_GITHUB'); ?>
</th>
<th width="20%" class="title nowrap center">
<?php echo JText::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
<th width="8%" class="nowrap center">
<?php echo \JText::_('COM_PATCHTESTER_JISSUES'); ?>
</th>
<th width="10%" class="nowrap center">
<?php echo \JText::_('JSTATUS'); ?>
</th>
<th width="15%" class="nowrap center">
<?php echo \JText::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
</th>
</tr>
</thead>
@ -79,7 +128,7 @@ echo JHtmlBootstrap::renderModal(
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<input type="hidden" name="pull_id" id="pull_id" value=""/>
<input type="hidden" name="pull_id" id="pull_id" value="" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/>
<?php echo JHtml::_('form.token'); ?>

View File

@ -8,6 +8,7 @@
defined('_JEXEC') or die;
JHtml::stylesheet("com_patchtester/octicons.css", false, true, false);
foreach ($this->items as $i => $item) :
$status = '';
@ -21,17 +22,19 @@ foreach ($this->items as $i => $item) :
<?php echo $item->pull_id; ?>
</td>
<td>
<a class="icon icon16-github hasTooltip" title="<?php echo JText::_('COM_PATCHTESTER_OPEN_IN_GITHUB'); ?>" href="<?php echo $item->pull_url; ?>" target="_blank">
<p class="hasTooltip" title="<?php echo $this->escape(\JHtml::_('string.truncateComplex', $item->description, 100)); ?>">
<?php echo $this->escape($item->title); ?>
</p>
</td>
<td>
<a class="btn btn-small btn-info" href="<?php echo $item->pull_url; ?>" target="_blank">
<span class="octicon octicon-mark-github"></span> <?php echo \JText::_('COM_PATCHTESTER_GITHUB'); ?>
</a>
</td>
<td>
<?php if ($item->title) :
echo JHtml::_('tooltip', htmlspecialchars($item->title), 'Info');
else :
echo '&nbsp;';
endif;
?>
<a class="btn btn-small btn-warning" href="http://issues.joomla.org/tracker/joomla-cms/<?php echo $item->pull_id; ?>" target="_blank">
<i class="icon-joomla"></i> <?php echo \JText::_('COM_PATCHTESTER_JISSUE'); ?>
</a>
</td>
<td class="center">
<?php if ($item->applied) : ?>
@ -46,9 +49,9 @@ foreach ($this->items as $i => $item) :
</td>
<td class="center">
<?php if ($item->applied) :
echo '<a class="btn btn-small btn-success" href="javascript:submitpatch(\'revert\', ' . (int) $item->applied . ');">' . JText::_('COM_PATCHTESTER_REVERT_PATCH') . '</a>';
echo '<a class="btn btn-small btn-success" href="javascript:submitpatch(\'pull.revert\', ' . (int) $item->id . ');">' . JText::_('COM_PATCHTESTER_REVERT_PATCH') . '</a>';
else :
echo '<a class="btn btn-small btn-primary" href="javascript:submitpatch(\'apply\', ' . (int) $item->pull_id . ');">' . JText::_('COM_PATCHTESTER_APPLY_PATCH') . '</a>';
echo '<a class="btn btn-small btn-primary" href="javascript:submitpatch(\'pull.apply\', ' . (int) $item->id . ');">' . JText::_('COM_PATCHTESTER_APPLY_PATCH') . '</a>';
endif; ?>
</td>
</tr>