More flexbox implementations

This commit is contained in:
Dennis Eichhorn 2017-01-29 12:35:25 +01:00
parent 1552b4bb51
commit 1dfb1d2b70
3 changed files with 77 additions and 64 deletions

View File

@ -18,17 +18,21 @@
*/
echo $this->getData('nav')->render(); ?>
<section class="box w-50">
<header><h1><?= $this->getText('Upload'); ?></h1></header>
<div class="inner">
<form method="POST" id="media-uploader" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/media'); ?>">
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getText('Name'); ?></label>
<tr><td><input type="text" id="iName" name="name" placeholder="&#xf040;">
<tr><td><label for="iFiles"><?= $this->getText('Files'); ?></label>
<tr><td><input type="file" id="iFiles" name="files" multiple><input name="media" type="hidden">
<tr><td><input type="submit" value="<?= $this->getText('Create', 0, 0); ?>">
</table>
</form>
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getText('Upload'); ?></h1></header>
<div class="inner">
<form method="POST" id="media-uploader" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/media'); ?>">
<table class="layout wf-100">
<tr><td><label for="iName"><?= $this->getText('Name'); ?></label>
<tr><td><input type="text" id="iName" name="name" placeholder="&#xf040;">
<tr><td><label for="iFiles"><?= $this->getText('Files'); ?></label>
<tr><td><input type="file" id="iFiles" name="files" multiple><input name="media" type="hidden">
<tr><td><input type="submit" value="<?= $this->getText('Create', 0, 0); ?>">
</table>
</form>
</div>
</section>
</div>
</section>
</div>

View File

@ -24,31 +24,36 @@ $footerView->setPages(count($media) / 25);
$footerView->setPage(1);
echo $this->getData('nav')->render(); ?>
<div class="box">
<table class="table">
<caption><?= $this->getText('Media'); ?></caption>
<thead>
<tr>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Type'); ?>
<td><?= $this->getText('Size'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr>
<td colspan="3"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0; foreach($media as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?id=' . $value->getId()); ?>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<table class="table">
<caption><?= $this->getText('Media'); ?></caption>
<thead>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getExtension(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getSize(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedBy(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedAt()->format('Y-m-d H:i:s'); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Type'); ?>
<td><?= $this->getText('Size'); ?>
<td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?>
<tfoot>
<tr>
<td colspan="3"><?= $footerView->render(); ?>
<tbody>
<?php $count = 0; foreach($media as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getExtension(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getSize(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedBy(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedAt()->format('Y-m-d H:i:s'); ?></a>
<?php endforeach; ?>
<?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>

View File

@ -23,29 +23,33 @@ $media = $this->getData('media');
echo $this->getData('nav')->render();
?>
<section class="box w-100">
<header><h1><?= $media->getName() ?></h1></header>
<div class="inner">
<table class="list w-100">
<tbody>
<tr><td>Size<td class="wf-100"><?= $media->getSize(); ?>
<tr><td>Created at<td><?= $media->getCreatedAt()->format('Y-m-d'); ?>
<tr><td>Created by<td><?= $media->getCreatedBy(); ?>
<tr><td>Description<td><?= $media->getDescription(); ?>
<tr><td colspan="2">Content
</table>
<?php if(in_array($media->getExtension(), ['gif', 'bmp', 'jpg', 'jpeg', 'png'])) : ?>
<img src="<?= $this->request->getUri()->getBase() . $media->getPath(); ?>">
<?php elseif($media->getExtension() === 'collection') : ?>
collection
<?php else : ?>
<pre>
<?php
$output = htmlspecialchars(file_get_contents(ROOT_PATH . '/' . $media->getPath()));
$output = str_replace(["\r\n", "\r"], "\n", $output);
$output = explode("\n", $output);
foreach($output as $line) : ?><span><?= $line; ?></span><?php endforeach; ?>
</pre>
<?php endif; ?>
<div class="row">
<div class="col-xs-12">
<section class="box wf-100">
<header><h1><?= $media->getName() ?></h1></header>
<div class="inner">
<table class="list w-100">
<tbody>
<tr><td>Size<td class="wf-100"><?= $media->getSize(); ?>
<tr><td>Created at<td><?= $media->getCreatedAt()->format('Y-m-d'); ?>
<tr><td>Created by<td><?= $media->getCreatedBy(); ?>
<tr><td>Description<td><?= $media->getDescription(); ?>
<tr><td colspan="2">Content
</table>
<?php if(in_array($media->getExtension(), ['gif', 'bmp', 'jpg', 'jpeg', 'png'])) : ?>
<img src="<?= $this->request->getUri()->getBase() . $media->getPath(); ?>">
<?php elseif($media->getExtension() === 'collection') : ?>
collection
<?php else : ?>
<pre>
<?php
$output = htmlspecialchars(file_get_contents(ROOT_PATH . '/' . $media->getPath()));
$output = str_replace(["\r\n", "\r"], "\n", $output);
$output = explode("\n", $output);
foreach($output as $line) : ?><span><?= $line; ?></span><?php endforeach; ?>
</pre>
<?php endif; ?>
</div>
</section>
</div>
</section>
</div>