31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-01 05:10:48 +00:00

Move out items template

This commit is contained in:
Nikolai Plath 2012-06-12 13:42:03 -05:00
parent 9bf2f103e2
commit d1a8e14e64
2 changed files with 162 additions and 116 deletions

View File

@ -1,146 +1,103 @@
<?php <?php
/** /**
* @package PatchTester * @package PatchTester
* @copyright Copyright (C) 2011 Ian MacLennan, Inc. All rights reserved. * @copyright Copyright (C) 2011 Ian MacLennan, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt * @license GNU General Public License version 2 or later; see LICENSE.txt
*/ */
// no direct access // No direct access
defined('_JEXEC') or die; defined('_JEXEC') or die;
JHtml::_('behavior.tooltip'); JHtml::_('behavior.tooltip');
JHtml::_('behavior.modal'); JHtml::_('behavior.modal');
$listOrder = $this->escape($this->state->get('list.ordering')); $listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction')); $listDirn = $this->escape($this->state->get('list.direction'));
?> ?>
<script type="text/javascript"> <script type="text/javascript">
var submitpatch = function(task, id) { var submitpatch = function (task, id) {
document.id('pull_id').set('value', id); document.id('pull_id').set('value', id);
return Joomla.submitbutton(task); return Joomla.submitbutton(task);
} }
</script> </script>
<form action="<?php echo JRoute::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm"> <form action="<?php echo JRoute::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm"
id="adminForm">
<table class="adminlist"> <table class="adminlist">
<thead> <thead>
<tr> <tr>
<th colspan="6" style="text-align: left;"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></th> <th colspan="7" style="text-align: left;"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></th>
</tr> </tr>
<tr> <tr>
<td> <td>
<button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button type="button" onclick="document.id('filter_search').value='';document.id('filter_searchid').value='';this.form.submit();"> <button type="button"
<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?> onclick="document.id('filter_search').value='';document.id('filter_searchid').value='';this.form.submit();">
</button> <?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>
</td> </button>
<td> </td>
<label class="filter-search-lbl" for="filter_searchid"><?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_PULL_ID'); ?></label> <td>
<input type="text" name="filter_searchid" id="filter_searchid" size="5" <label class="filter-search-lbl"
value="<?php echo $this->escape($this->state->get('filter.searchid')); ?>" for="filter_searchid"><?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_PULL_ID'); ?></label>
title="<?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_PULL_ID'); ?>" /> <input type="text" name="filter_searchid" id="filter_searchid" size="5"
</td> value="<?php echo $this->escape($this->state->get('filter.searchid')); ?>"
<td> title="<?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_PULL_ID'); ?>"/>
<label class="filter-search-lbl" for="filter_search"><?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_TITLE'); ?></label> </td>
<br /> <td>
<input type="text" name="filter_search" id="filter_search" <label class="filter-search-lbl"
value="<?php echo $this->escape($this->state->get('filter.search')); ?>" for="filter_search"><?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_TITLE'); ?></label>
title="<?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_TITLE'); ?>" /> <br/>
</td> <input type="text" name="filter_search" id="filter_search"
<td> value="<?php echo $this->escape($this->state->get('filter.search')); ?>"
</td> title="<?php echo JText::_('COM_PATCHTESTER_SEARCH_IN_TITLE'); ?>"/>
<td> </td>
</td> <td colspan="4">
<td> </td>
</td> </tr>
</tr> <tr>
<tr> <th colspan="7" style="text-align: left;"><?php echo JText::_('COM_PATCHTESTER_SORT'); ?></th>
<th colspan="6" style="text-align: left;"><?php echo JText::_('COM_PATCHTESTER_SORT'); ?></th> </tr>
</tr> <tr>
<tr> <th width="1%">
<th width="1%"> <input type="checkbox" name="checkall-toggle" value=""
<input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)"/>
</th> </th>
<th width="5%"> <th width="5%">
<?php echo JHtml::_('grid.sort', 'COM_PATCHTESTER_PULL_ID', 'number', $listDirn, $listOrder); ?> <?php echo JHtml::_('grid.sort', 'COM_PATCHTESTER_PULL_ID', 'number', $listDirn, $listOrder); ?>
</th> </th>
<th class="title"> <th class="title">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'title', $listDirn, $listOrder); ?>
</th> </th>
<th class="title"> <th>I</th>
<?php echo JText::_('COM_PATCHTESTER_JOOMLACODE_ISSUE'); ?> <th class="title">
</th> <?php echo JText::_('COM_PATCHTESTER_JOOMLACODE_ISSUE'); ?>
<th width="20%"> </th>
<?php echo JText::_('JSTATUS'); ?> <th width="20%">
</th> <?php echo JText::_('JSTATUS'); ?>
<th width="20%"> </th>
<?php echo JText::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?> <th width="20%">
</th> <?php echo JText::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
</tr> </th>
</tr>
</thead> </thead>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="10"> <td colspan="10">
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
<tbody> <tbody>
<?php foreach ($this->items as $i => $item) : <?php echo $this->loadTemplate('items'); ?>
if (isset($this->patches[$item->number])) {
$patch = $this->patches[$item->number];
} else {
$patch = false;
}
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo $item->number; ?>
</td>
<td>
<a href="<?php echo $item->html_url; ?>" title="<?php echo htmlspecialchars($item->body); ?>"><?php echo $item->title; ?></a>
</td>
<td>
<?php
if ($item->joomlacode_issue > 0) {
echo '<a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=';
echo $item->joomlacode_issue . '" class="modal" rel="{handler: \'iframe\', size: {x: 900, y: 500}}">';
echo '[#' . $item->joomlacode_issue . ']</a>';
}
?>
</td>
<td class="center">
<?php
if ($patch && $patch->applied) {
echo JText::_('COM_PATCHTESTER_APPLIED');
} else {
echo JText::_('COM_PATCHTESTER_NOT_APPLIED');
}
?>
</td>
<td class="center">
<?php
if ($patch && $patch->applied) {
echo '<a href="javascript:submitpatch(\'pull.revert\', '.(int)$patch->id.');">'.JText::_('COM_PATCHTESTER_REVERT_PATCH').'</a>';
} else {
echo '<a href="javascript:submitpatch(\'pull.apply\', '.(int)$item->number.');">'.JText::_('COM_PATCHTESTER_APPLY_PATCH').'</a>';
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody> </tbody>
</table> </table>
<div> <div>
<input type="hidden" name="task" value="" /> <input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0" /> <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" value="<?php echo $listOrder; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/>
<?php echo JHtml::_('form.token'); ?> <?php echo JHtml::_('form.token'); ?>
</div> </div>
</form> </form>

View File

@ -0,0 +1,89 @@
<?php
/**
* @package PatchTester
* @copyright Copyright (C) 2011 Ian MacLennan, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
foreach ($this->items as $i => $item) :
if (isset($this->patches[$item->number])) :
$patch = $this->patches[$item->number];
else :
$patch = false;
endif;
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo $item->number; ?>
</td>
<td>
<a class="icon icon16-github hasTip"
title="<?php echo JText::_('COM_PATCHTESTER_OPEN_IN_GITHUB'); ?>"
href="<?php echo $item->html_url; ?>">
<?php echo $item->title; ?>
</a>
</td>
<td>
<?php
if ($item->body) :
echo JHtml::_('tooltip', htmlspecialchars($item->body), 'Info');
else :
echo '&nbsp;';
endif;
?>
</td>
<td>
<?php
if ($item->joomlacode_issue)
{
$title = ' title="Open link::'.JText::_('COM_PATCHTESTER_OPEN_IN_JOOMLACODE').'"';
if(is_int($item->joomlacode_issue))
{
echo '<a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=';
echo $item->joomlacode_issue . '"'.$title.' class="modal hasTip" rel="{handler: \'iframe\', size: {x: 900, y: 500}}">';
echo '[#' . $item->joomlacode_issue . ']</a>';
}
else
{
echo '<a href="' . $item->joomlacode_issue . '"'.$title;
echo ' class="modal hasTip" rel="{handler: \'iframe\', size: {x: 900, y: 500}}">';
echo '[#joomlacode]</a>';
}
}
?>
</td>
<td class="center">
<?php
if ($patch && $patch->applied)
{
echo '<div class="patchApplied" style="background-color: #adff2f;">';
echo JText::_('COM_PATCHTESTER_APPLIED');
echo '</div>';
}
else
{
echo JText::_('COM_PATCHTESTER_NOT_APPLIED');
}
?>
</td>
<td class="center">
<?php
if ($patch && $patch->applied)
{
echo '<a href="javascript:submitpatch(\'pull.revert\', ' . (int) $patch->id . ');">' . JText::_('COM_PATCHTESTER_REVERT_PATCH') . '</a>';
}
else
{
echo '<a href="javascript:submitpatch(\'pull.apply\', ' . (int) $item->number . ');">' . JText::_('COM_PATCHTESTER_APPLY_PATCH') . '</a>';
}
?>
</td>
</tr>
<?php endforeach;