Admin tpl flexbox implementation

This commit is contained in:
Dennis Eichhorn 2017-01-28 19:56:13 +01:00
parent 77a44ebb1b
commit 64cf0a06ce
4 changed files with 188 additions and 162 deletions

View File

@ -28,30 +28,34 @@ $footerView->setResults($this->getData('list:count'));
echo $this->getData('nav')->render();
?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Groups'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td><?= $this->getText('Status'); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Activity'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/account/settings?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getStatus(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName1(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getLastActive()->format('Y-m-d H:i:s'); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedAt()->format('Y-m-d H:i:s'); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<table class="table">
<caption><?= $this->getText('Groups'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td><?= $this->getText('Status'); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Activity'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/account/settings?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getStatus(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName1(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getLastActive()->format('Y-m-d H:i:s'); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedAt()->format('Y-m-d H:i:s'); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>

View File

@ -20,68 +20,76 @@
$account = $this->getData('account');
echo $this->getData('nav')->render(); ?>
<section class="box w-33 floatLeft">
<header><h1><?= $this->getText('Account') ?></h1></header>
<div class="inner">
<form action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/account'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iId"><?= $this->getText('ID', 0, 0) ?></label>
<tr><td><input id="iId" name="id" type="text" value="<?= $account->getId(); ?>" disabled>
<tr><td><label for="iType"><?= $this->getText('Type') ?></label>
<tr><td><select id="iType" name="type">
<option value="<?= \phpOMS\Account\AccountType::USER; ?>"<?= $account->getType() === \phpOMS\Account\AccountType::USER ? ' selected' : ''; ?>><?= $this->getText('Person') ?>
<option value="<?= \phpOMS\Account\AccountType::GROUP; ?>"<?= $account->getType() === \phpOMS\Account\AccountType::GROUP ? ' selected' : ''; ?>><?= $this->getText('Organization') ?>
</select>
<tr><td><label for="iStatus"><?= $this->getText('Status') ?></label>
<tr><td><select id="iStatus" name="status">
<option value="<?= \phpOMS\Account\AccountStatus::ACTIVE; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::ACTIVE ? ' selected' : ''; ?>><?= $this->getText('Active') ?>
<option value="<?= \phpOMS\Account\AccountStatus::INACTIVE; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::INACTIVE ? ' selected' : ''; ?>><?= $this->getText('Inactive') ?>
<option value="<?= \phpOMS\Account\AccountStatus::TIMEOUT; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::TIMEOUT ? ' selected' : ''; ?>><?= $this->getText('Timeout') ?>
<option value="<?= \phpOMS\Account\AccountStatus::BANNED; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::BANNED ? ' selected' : ''; ?>><?= $this->getText('Banned') ?>
</select>
<tr><td><label for="iUsername"><?= $this->getText('Username') ?></label>
<tr><td><input id="iUsername" name="name" type="text" placeholder="&#xf007; Fred" value="<?= $account->getName(); ?>" disabled>
<tr><td><label for="iName1"><?= $this->getText('Name1') ?></label>
<tr><td><input id="iName1" name="name1" type="text" placeholder="&#xf007; Donald" value="<?= $account->getName1(); ?>" required>
<tr><td><label for="iName2"><?= $this->getText('Name2') ?></label>
<tr><td><input id="iName2" name="name2" type="text" placeholder="&#xf007; Fauntleroy" value="<?= $account->getName2(); ?>">
<tr><td><label for="iName3"><?= $this->getText('Name3') ?></label>
<tr><td><input id="iName3" name="name3" type="text" placeholder="&#xf007; Duck" value="<?= $account->getName3(); ?>">
<tr><td><label for="iEmail"><?= $this->getText('Email') ?></label>
<tr><td><input id="iEmail" name="email" type="email" placeholder="&#xf0e0; d.duck@duckburg.com" value="<?= $account->getEmail(); ?>">
<tr><td><label for="iPassword"><?= $this->getText('Name3') ?></label>
<tr><td><input id="iPassword" name="password" type="text" placeholder="&#xf023; Pa55ssw0rd?">
<tr><td><input type="submit" value="<?= $this->getText('Save', 0, 0); ?>">
</table>
</form>
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getText('Account') ?></h1></header>
<div class="inner">
<form action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/account'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iId"><?= $this->getText('ID', 0, 0) ?></label>
<tr><td><input id="iId" name="id" type="text" value="<?= $account->getId(); ?>" disabled>
<tr><td><label for="iType"><?= $this->getText('Type') ?></label>
<tr><td><select id="iType" name="type">
<option value="<?= \phpOMS\Account\AccountType::USER; ?>"<?= $account->getType() === \phpOMS\Account\AccountType::USER ? ' selected' : ''; ?>><?= $this->getText('Person') ?>
<option value="<?= \phpOMS\Account\AccountType::GROUP; ?>"<?= $account->getType() === \phpOMS\Account\AccountType::GROUP ? ' selected' : ''; ?>><?= $this->getText('Organization') ?>
</select>
<tr><td><label for="iStatus"><?= $this->getText('Status') ?></label>
<tr><td><select id="iStatus" name="status">
<option value="<?= \phpOMS\Account\AccountStatus::ACTIVE; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::ACTIVE ? ' selected' : ''; ?>><?= $this->getText('Active') ?>
<option value="<?= \phpOMS\Account\AccountStatus::INACTIVE; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::INACTIVE ? ' selected' : ''; ?>><?= $this->getText('Inactive') ?>
<option value="<?= \phpOMS\Account\AccountStatus::TIMEOUT; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::TIMEOUT ? ' selected' : ''; ?>><?= $this->getText('Timeout') ?>
<option value="<?= \phpOMS\Account\AccountStatus::BANNED; ?>"<?= $account->getStatus() === \phpOMS\Account\AccountStatus::BANNED ? ' selected' : ''; ?>><?= $this->getText('Banned') ?>
</select>
<tr><td><label for="iUsername"><?= $this->getText('Username') ?></label>
<tr><td><input id="iUsername" name="name" type="text" placeholder="&#xf007; Fred" value="<?= $account->getName(); ?>" disabled>
<tr><td><label for="iName1"><?= $this->getText('Name1') ?></label>
<tr><td><input id="iName1" name="name1" type="text" placeholder="&#xf007; Donald" value="<?= $account->getName1(); ?>" required>
<tr><td><label for="iName2"><?= $this->getText('Name2') ?></label>
<tr><td><input id="iName2" name="name2" type="text" placeholder="&#xf007; Fauntleroy" value="<?= $account->getName2(); ?>">
<tr><td><label for="iName3"><?= $this->getText('Name3') ?></label>
<tr><td><input id="iName3" name="name3" type="text" placeholder="&#xf007; Duck" value="<?= $account->getName3(); ?>">
<tr><td><label for="iEmail"><?= $this->getText('Email') ?></label>
<tr><td><input id="iEmail" name="email" type="email" placeholder="&#xf0e0; d.duck@duckburg.com" value="<?= $account->getEmail(); ?>">
<tr><td><label for="iPassword"><?= $this->getText('Name3') ?></label>
<tr><td><input id="iPassword" name="password" type="text" placeholder="&#xf023; Pa55ssw0rd?">
<tr><td><input type="submit" value="<?= $this->getText('Save', 0, 0); ?>">
</table>
</form>
</div>
</section>
</div>
</section>
<section class="box w-66 floatLeft">
<header><h1><?= $this->getText('Groups') ?></h1></header>
<div class="inner">
<form action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iGroup"><?= $this->getText('Name') ?></label>
<tr><td><input id="iGroup" name="group" type="text" placeholder="&#xf0c0; Guest">
<tr><td><input type="submit" value="<?= $this->getText('Add', 0, 0) ?>">
</table>
</form>
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getText('Groups') ?></h1></header>
<div class="inner">
<form action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iGroup"><?= $this->getText('Name') ?></label>
<tr><td><input id="iGroup" name="group" type="text" placeholder="&#xf0c0; Guest">
<tr><td><input type="submit" value="<?= $this->getText('Add', 0, 0) ?>">
</table>
</form>
</div>
</section>
</div>
</section>
<section class="box w-66 floatLeft">
<header><h1><?= $this->getText('Permissions') ?></h1></header>
<div class="inner">
<form action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iGroup"><?= $this->getText('Name') ?></label>
<tr><td><input id="iGroup" name="group" type="text" placeholder="&#xf084; news_create">
<tr><td><input type="submit" value="<?= $this->getText('Add', 0, 0) ?>">
</table>
</form>
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getText('Permissions') ?></h1></header>
<div class="inner">
<form action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iGroup"><?= $this->getText('Name') ?></label>
<tr><td><input id="iGroup" name="group" type="text" placeholder="&#xf084; news_create">
<tr><td><input type="submit" value="<?= $this->getText('Add', 0, 0) ?>">
</table>
</form>
</div>
</section>
</div>
</section>
</div>

View File

@ -29,34 +29,38 @@ $footerView->setPage(1);
$footerView->setResults(count($modules));
?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Modules'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Version'); ?>
<td><?= $this->getText('Status'); ?>
<tfoot>
<tr>
<td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0; foreach ($modules as $key => $module) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/module/settings?id=' . $module['name']['internal']); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $module['name']['internal']; ?></a>
<td><a href="<?= $url; ?>"><?= $module['name']['external']; ?></a>
<td><a href="<?= $url; ?>"><?= $module['version']; ?></a>
<td><a href="<?= $url; ?>"><?php if (in_array($module['name']['internal'], $active))
echo strtolower($this->getText('Active'));
elseif (in_array($module['name']['internal'], $installed))
echo strtolower($this->getText('Inactive'));
else
echo strtolower($this->getText('Available')); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
<div class="row">
<div class="col-xs-12">
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Modules'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Version'); ?>
<td><?= $this->getText('Status'); ?>
<tfoot>
<tr>
<td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0; foreach ($modules as $key => $module) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/module/settings?id=' . $module['name']['internal']); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $module['name']['internal']; ?></a>
<td><a href="<?= $url; ?>"><?= $module['name']['external']; ?></a>
<td><a href="<?= $url; ?>"><?= $module['version']; ?></a>
<td><a href="<?= $url; ?>"><?php if (in_array($module['name']['internal'], $active))
echo strtolower($this->getText('Active'));
elseif (in_array($module['name']['internal'], $installed))
echo strtolower($this->getText('Inactive'));
else
echo strtolower($this->getText('Available')); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>

View File

@ -24,63 +24,73 @@ $installed = $this->app->moduleManager->getInstalledModules();
$id = $this->request->getData('id') ?? 1;
?>
<section class="box w-33 floatLeft">
<header><h1><?= $modules[$id]['name']['external'] ?></h1></header>
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $modules[$id]['name']['external'] ?></h1></header>
<div class="inner">
<table class="list wf-100">
<tbody>
<tr>
<td><?= $this->getText('Name') ?>
<td><?= $modules[$id]['name']['external']; ?>
<tr>
<td><?= $this->getText('Version') ?>
<td><?= $modules[$id]['version'] ?>
<tr>
<td><?= $this->getText('CreatedBy') ?>
<td><?= $modules[$id]['creator']['name'] ?>
<tr>
<td><?= $this->getText('Website') ?>
<td><?= $modules[$id]['creator']['website'] ?>
<tr>
<td><?= $this->getText('Description') ?>
<td><?= $modules[$id]['description'] ?>
<tr>
<td colspan="2">
<?php if (in_array($id, $active)) : ?>
<button
data-reload="<?= \phpOMS\Uri\UriFactory::build('POST:/{/lang}/backend/admin/module/status?status=deactivate&module=' . $id); ?>"><?= $this->getText('Deactivate') ?></button>
<?php elseif (in_array($id, $installed)) : ?>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('POST:/{/lang}/backend/admin/module/deactivate?id=' . $id); ?>"><?= $this->getText('Uninstall') ?></button>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('POST:/{/lang}/backend/admin/module/deactivate?id=' . $id); ?>"><?= $this->getText('Activate') ?></button>
<?php elseif (isset($modules[$id])) : ?>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('PUT:/{/lang}/backend/admin/module/install?id=' . $id); ?>"><?= $this->getText('Install') ?></button>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('DELETE:/{/lang}/backend/admin/module/delete?id=' . $id); ?>"><?= $this->getText('Delete', 0) ?></button>
<?php endif; ?>
</table>
<div class="inner">
<table class="list wf-100">
<tbody>
<tr>
<td><?= $this->getText('Name') ?>
<td><?= $modules[$id]['name']['external']; ?>
<tr>
<td><?= $this->getText('Version') ?>
<td><?= $modules[$id]['version'] ?>
<tr>
<td><?= $this->getText('CreatedBy') ?>
<td><?= $modules[$id]['creator']['name'] ?>
<tr>
<td><?= $this->getText('Website') ?>
<td><?= $modules[$id]['creator']['website'] ?>
<tr>
<td><?= $this->getText('Description') ?>
<td><?= $modules[$id]['description'] ?>
<tr>
<td colspan="2">
<?php if (in_array($id, $active)) : ?>
<button
data-reload="<?= \phpOMS\Uri\UriFactory::build('POST:/{/lang}/backend/admin/module/status?status=deactivate&module=' . $id); ?>"><?= $this->getText('Deactivate') ?></button>
<?php elseif (in_array($id, $installed)) : ?>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('POST:/{/lang}/backend/admin/module/deactivate?id=' . $id); ?>"><?= $this->getText('Uninstall') ?></button>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('POST:/{/lang}/backend/admin/module/deactivate?id=' . $id); ?>"><?= $this->getText('Activate') ?></button>
<?php elseif (isset($modules[$id])) : ?>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('PUT:/{/lang}/backend/admin/module/install?id=' . $id); ?>"><?= $this->getText('Install') ?></button>
<button data-reload="<?= \phpOMS\Uri\UriFactory::build('DELETE:/{/lang}/backend/admin/module/delete?id=' . $id); ?>"><?= $this->getText('Delete', 0) ?></button>
<?php endif; ?>
</table>
</div>
</section>
</div>
</section>
<section class="box w-33 floatLeft">
<header><h1><?= $this->getText('Settings') ?></h1></header>
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getText('Settings') ?></h1></header>
<div class="inner">
<div class="inner">
</div>
</section>
</div>
</section>
<section class="box w-33 floatLeft">
<header><h1><?= $this->getText('Groups') ?></h1></header>
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getText('Groups') ?></h1></header>
<div class="inner">
<div class="inner">
</div>
</section>
</div>
</section>
<section class="box w-33 floatLeft">
<header><h1><?= $this->getText('Permissions') ?></h1></header>
<div class="col-xs-12 col-md-4">
<section class="box wf-100">
<header><h1><?= $this->getText('Permissions') ?></h1></header>
<div class="inner">
<div class="inner">
</div>
</section>
</div>
</section>
</div>