Fix collection regexes testing page

This commit is contained in:
DariusIII
2017-06-15 23:16:00 +02:00
parent 56e4505a39
commit 10bf1821f8
3 changed files with 38 additions and 41 deletions
+2
View File
@@ -1,3 +1,5 @@
2017-06-15 DariusIII
* Fix: Fix collection regexes testing page
2017-06-14 DariusIII
* Chg: Use monolog/monolog to handle logging
* Chg: Update composer libraries
+1 -3
View File
@@ -6,9 +6,7 @@ use nntmux\Regexes;
$page = new AdminPage();
$page->title = "Collections Regex Test";
$page->smarty->assign('tpg', $tpg);
$page->title = 'Collections Regex Test';
$group = trim(isset($_POST['group']) && !empty($_POST['group']) ? $_POST['group'] : '');
$regex = trim(isset($_POST['regex']) && !empty($_POST['regex']) ? $_POST['regex'] : '');
@@ -2,45 +2,42 @@
<div class="well well-sm">
<p>This page is used for testing regex for grouping usenet collections.<br />Enter the group name to test and a regex. Limit is how many collections to show max on the page, 0 for no limit(slow).</p>
{if $tpg}
<form name="search" action="" method="post" style="margin-bottom:5px;">
<label for="group" style="padding-right:1px">Group:</label>
<input id="group" type="text" name="group" value="{$group|htmlentities}" size="20" /><br />
<label for="regex" style="padding-right:1px">Regex:</label>
<input id="regex" type="text" name="regex" value="{$regex|htmlentities}" size="100" /><br/>
<label for="limit" style="padding-right:7px">Limit:</label>
<input id="limit" type="text" name="limit" value="{$limit}" size="8" /><br/>
<input class="btn btn-default" type="submit" value="Test" />
</form>
{if isset($data)}
<form name="search" action="" method="post" style="margin-bottom:5px;">
<label for="group" style="padding-right:1px">Group:</label>
<input id="group" type="text" name="group" value="{$group|htmlentities}" size="20" /><br />
<label for="regex" style="padding-right:1px">Regex:</label>
<input id="regex" type="text" name="regex" value="{$regex|htmlentities}" size="100" /><br/>
<label for="limit" style="padding-right:7px">Limit:</label>
<input id="limit" type="text" name="limit" value="{$limit}" size="8" /><br/>
<input class="btn btn-default" type="submit" value="Test" />
</form>
{if isset($data)}
{foreach from=$data key=hash item=collection}
<table style="margin-top:10px;" class="data table table-striped responsive-utilities jambo-table">
<tr>
<th>{$hash}<br />Current Files: {count($collection)}</th>
{foreach from=$data key=hash item=collection}
<table style="margin-top:10px;" class="data table table-striped responsive-utilities jambo-table">
<tr>
<th>{$hash}<br />Current Files: {count($collection)}</th>
</tr>
</table>
<table style="margin-top:10px;" class="data table table-striped responsive-utilities jambo-table Sortable">
<tr>
<th>name</th>
<th>current parts</th>
<th>total parts</th>
<th>poster</th>
<th>old hash</th>
</tr>
{foreach from=$collection item=row}
<tr id="row-{$row.new_collection_hash}" class="{cycle values=",alt"}">
<td>{$row.file_name}</td>
<td>{$row.file_current_parts}</td>
<td>{$row.file_total_parts}</td>
<td>{$row.collection_poster}</td>
<td>{$row.old_collection_hash}</td>
</tr>
</table>
<table style="margin-top:10px;" class="data table table-striped responsive-utilities jambo-table Sortable">
<tr>
<th>name</th>
<th>current parts</th>
<th>total parts</th>
<th>poster</th>
<th>old hash</th>
</tr>
{foreach from=$collection item=row}
<tr id="row-{$row.new_collection_hash}" class="{cycle values=",alt"}">
<td>{$row.file_name}</td>
<td>{$row.file_current_parts}</td>
<td>{$row.file_total_parts}</td>
<td>{$row.collection_poster}</td>
<td>{$row.old_collection_hash}</td>
</tr>
{/foreach}
</table>
{/foreach}
{/if}
{else}
<p>The Table Per Group setting is required to be on to use this page, for performance reasons.</p>
{/foreach}
</table>
{/foreach}
{/if}
</div>