Restyle resources config

This commit is contained in:
Thomas Gelf 2014-03-08 13:26:05 +01:00
parent 5c27f8153a
commit 4fef863674

View File

@ -1,35 +1,28 @@
<?php
use Icinga\Web\Url;
$createResource = $this->href('/config/createresource');
?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs ?>
</div> </div>
<div class="content"> <div class="content" data-base-target="col2">
<?php if (isset($this->messageBox)): ?> <?php
<?= $this->messageBox->render() ?>
<?php endif ?>
<h1>Create Resource</h1> if (isset($this->messageBox)) {
<p><a href="<?= $createResource ?>"><?= $this->icon('create.png'); ?> Create A New Resource</a></p> // TODO: Get rid of messageBoxes in favour of notifications
echo $this->messageBox->render();
}
<table class="configTable"> ?>
<p><a href="<?= $this->href('/config/createresource') ?>"><?= $this->icon('create.png'); ?> Create A New Resource</a></p>
<table class="action">
<thead>
<th>Resource</th>
<th style="width: 5em">Remove</th>
</thead>
<tbody>
<?php foreach ($this->resources as $name => $resource): ?> <?php foreach ($this->resources as $name => $resource): ?>
<tr> <tr>
<td class="configTable"> <td><a href="<?= $this->href('config/editresource', array('resource' => $name)) ?>"><?= $this->icon('edit.png') ?> <?= $this->escape($name); ?></td>
<div> <td style="text-align: center"><a href="<?= $this->href('config/removeresource', array('resource' => $name)) ?>"><?= $this->icon('remove.png'); ?></a></td>
<b>Resource:</b>&ensp;<?= $this->escape($name); ?>
</div>
<div>
<a href="<?= $this->href('config/editresource', array('resource' => $name));?>">
<?= $this->icon('edit.png'); ?> Edit</a>&emsp;
<?php if (count($this->resources) > 1): ?>
<a href="<?= $this->href('config/removeresource', array('resource' => $name));?>">
<?= $this->icon('remove.png'); ?> Remove</a>&emsp;
<?php endif; ?>
</div>
</td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>