33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-23 03:19:00 +00:00

Merge pull request #83 from dgt41/hathor

Hathor is broken
This commit is contained in:
Michael Babker 2015-05-06 18:01:35 -04:00
commit f479a355c3
2 changed files with 102 additions and 42 deletions

View File

@ -8,50 +8,109 @@
defined('_JEXEC') or die;
JHtml::_('behavior.tooltip');
JHtml::_('behavior.modal');
JHtml::_('behavior.core');
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();
?>
<script type="text/javascript">
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);
}
</script>
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',
'title' => JText::_('COM_PATCHTESTER_TOOLBAR_FETCH_DATA'),
'width' => '800px',
'height' => '300px'
)
);
?>
<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>
</fieldset>
<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>
<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>
@ -69,7 +128,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<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,35 +8,36 @@
defined('_JEXEC') or die;
JHtml::stylesheet("com_patchtester/octicons.css", false, true, false);
foreach ($this->items as $i => $item) :
$status = '';
if (isset($this->patches[$item->number])) :
$patch = $this->patches[$item->number];
$status = ($patch->applied) ? ' success' : '';
else :
$patch = false;
if ($item->applied) :
$status = ' success';
endif;
?>
<tr class="row<?php echo $i % 2; ?><?php echo $status ?>">
<td class="center">
<?php echo $item->number; ?>
<?php echo $item->pull_id; ?>
</td>
<td>
<a class="icon icon16-github hasTip" title="<?php echo JText::_('COM_PATCHTESTER_OPEN_IN_GITHUB'); ?>" href="<?php echo $item->html_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->body) :
echo JHtml::_('tooltip', htmlspecialchars($item->body), '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 ($patch && $patch->applied) : ?>
<?php if ($item->applied) : ?>
<span class="label label-success">
<?php echo JText::_('COM_PATCHTESTER_APPLIED'); ?>
</span>
@ -47,10 +48,10 @@ foreach ($this->items as $i => $item) :
<?php endif; ?>
</td>
<td class="center">
<?php if ($patch && $patch->applied) :
echo '<a class="btn btn-small btn-success" href="javascript:submitpatch(\'pull.revert\', ' . (int) $patch->id . ');">' . JText::_('COM_PATCHTESTER_REVERT_PATCH') . '</a>';
<?php if ($item->applied) :
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(\'pull.apply\', ' . (int) $item->number . ');">' . 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>