More flexbox implementations

This commit is contained in:
Dennis Eichhorn 2017-01-29 12:35:33 +01:00
parent d0b0b614a2
commit bb791ee8c4
3 changed files with 68 additions and 56 deletions

View File

@ -21,33 +21,37 @@ $newsList = $this->getData('news');
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="box w-100 floatLeft"> <div class="row">
<table class="table"> <div class="col-xs-12">
<caption><?= $this->getText('News') ?></caption> <div class="box wf-100">
<thead> <table class="table">
<tr> <caption><?= $this->getText('News') ?></caption>
<td> <thead>
<td><?= $this->getText('Type'); ?> <tr>
<td class="wf-100"><?= $this->getText('Title'); ?> <td>
<td><?= $this->getText('Author'); ?> <td><?= $this->getText('Type'); ?>
<td><?= $this->getText('Date'); ?> <td class="wf-100"><?= $this->getText('Title'); ?>
<tbody> <td><?= $this->getText('Author'); ?>
<?php $count = 0; foreach($newsList as $key => $news) : $count++; <td><?= $this->getText('Date'); ?>
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/news/article?id=' . $news->getId()); <tbody>
$color = 'darkred'; <?php $count = 0; foreach($newsList as $key => $news) : $count++;
if($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; } $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/news/article?id=' . $news->getId());
elseif($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; } $color = 'darkred';
elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; } if($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
?> elseif($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
<tr> elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
<td data-label=""><a href="<?= $url; ?>"><?= $news->isFeatured() ? '<i class="fa fa-star favorite"></i>' : ''; ?></a> ?>
<td data-label="<?= $this->getText('Type'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getText('TYPE' . $news->getType()); ?></span></a> <tr>
<td data-label="<?= $this->getText('Title'); ?>"><a href="<?= $url; ?>"><?= $news->getTitle(); ?></a> <td data-label=""><a href="<?= $url; ?>"><?= $news->isFeatured() ? '<i class="fa fa-star favorite"></i>' : ''; ?></a>
<td data-label="<?= $this->getText('Author'); ?>"><a href="<?= $url; ?>"><?= $news->getCreatedBy(); ?></a> <td data-label="<?= $this->getText('Type'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->getText('TYPE' . $news->getType()); ?></span></a>
<td data-label="<?= $this->getText('Date'); ?>"><a href="<?= $url; ?>"><?= $news->getPublish()->format('Y-m-d'); ?></a> <td data-label="<?= $this->getText('Title'); ?>"><a href="<?= $url; ?>"><?= $news->getTitle(); ?></a>
<?php endforeach; ?> <td data-label="<?= $this->getText('Author'); ?>"><a href="<?= $url; ?>"><?= $news->getCreatedBy(); ?></a>
<?php if($count === 0) : ?> <td data-label="<?= $this->getText('Date'); ?>"><a href="<?= $url; ?>"><?= $news->getPublish()->format('Y-m-d'); ?></a>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?> <?php endforeach; ?>
<?php endif; ?> <?php if($count === 0) : ?>
</table> <tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
</div>
</div> </div>

View File

@ -20,12 +20,15 @@
$news = $this->getData('news'); $news = $this->getData('news');
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="row">
<section class="box w-100"> <div class="col-xs-12">
<header><h1><?= $news->getTitle(); ?></h1></header> <section class="box wf-100">
<div class="inner"> <header><h1><?= $news->getTitle(); ?></h1></header>
<article> <div class="inner">
<?= $news->getContent(); ?> <article>
</article> <?= $news->getContent(); ?>
</article>
</div>
</section>
</div> </div>
</section> </div>

View File

@ -23,23 +23,28 @@ $footerView->setPages(20);
$footerView->setPage(1); $footerView->setPage(1);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table"> <div class="row">
<caption><?= $this->getText('Archive') ?></caption> <div class="col-xs-12">
<thead> <div class="box wf-100">
<tr> <table class="table">
<td><?= $this->getText('Type'); ?> <caption><?= $this->getText('Archive') ?></caption>
<td class="wf-100"><?= $this->getText('Title'); ?> <thead>
<td><?= $this->getText('Author'); ?> <tr>
<td><?= $this->getText('Date'); ?> <td><?= $this->getText('Type'); ?>
<tfoot> <td class="wf-100"><?= $this->getText('Title'); ?>
<tr> <td><?= $this->getText('Author'); ?>
<td colspan="4"><?= $footerView->render(); ?> <td><?= $this->getText('Date'); ?>
<tbody> <tfoot>
<?php $count = 0; foreach([] as $key => $value) : $count++; ?> <tr>
<?php endforeach; ?> <td colspan="4"><?= $footerView->render(); ?>
<?php if($count === 0) : ?> <tbody>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?> <?php $count = 0; foreach([] as $key => $value) : $count++; ?>
<?php endif; ?> <?php endforeach; ?>
</table> <?php if($count === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
</div>
</div> </div>