style fixes, bug fixes

This commit is contained in:
Dennis Eichhorn 2023-05-28 01:13:23 +00:00
parent b4bb2be9e7
commit b38aeb9b85
5 changed files with 33 additions and 36 deletions

View File

@ -19,14 +19,12 @@ use Modules\News\Models\NewsArticleMapper;
use Modules\News\Models\NewsSeen;
use Modules\News\Models\NewsSeenMapper;
use Modules\News\Models\NewsStatus;
use Modules\News\Models\NullNewsSeen;
use Modules\News\Models\PermissionCategory;
use phpOMS\Account\PermissionType;
use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\NullModule;
use phpOMS\Views\View;
/**
@ -160,6 +158,7 @@ final class BackendController extends Controller implements DashboardElementInte
->with('comments/comments')
->with('comments/comments/createdBy')
->with('comments/comments/media')
->with('media')
->with('tags')
->with('tags/title')
->where('status', NewsStatus::VISIBLE)

View File

@ -26,7 +26,7 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Archive'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Archive'); ?><i class="lni lni-download download btn end-xs"></i></div>
<div class="slider">
<table id="newsArchiveList" class="default sticky">
<thead>

View File

@ -34,21 +34,22 @@ echo $this->getData('nav')->render(); ?>
<div class="portlet-head">
<?= !($isSeen = \in_array($news->id, $seen)) ? '<strong>' : ''; ?>
<a href="<?= $url; ?>"><?= $this->printHtml($news->title); ?></a>
<span class="floatRight">
<a class="content" href="<?= $profile; ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$news->createdBy->name1, $news->createdBy->name2, $news->createdBy->name3, $news->createdBy->login ?? ''])); ?>
</a> - <?= $news->publish->format('Y-m-d'); ?>
</span>
<?= !$isSeen ? '</strong>' : ''; ?>
<span class="end-xs">
<a class="content" href="<?= $profile; ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$news->createdBy->name1, $news->createdBy->name2, $news->createdBy->name3, $news->createdBy->login ?? ''])); ?>
</a> - <?= $news->publish->format('Y-m-d'); ?>
</span>
</div>
<div class="portlet-body">
<article><?= Markdown::parse(\substr($news->plain, 0, 500)); ?></article>
<?php $tags = $news->getTags(); foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
</div>
<article>
<?= Markdown::parse(\substr($news->plain, 0, 500)); ?>
</article>
<div class="portlet-foot">
<div class="overflowfix">
<?php $tags = $news->getTags(); foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
<a tabindex="0" href="<?= $url; ?>" class="button floatRight"><?= $this->getHtml('More', '0', '0'); ?></a>
<a tabindex="0" href="<?= $url; ?>" class="button"><?= $this->getHtml('More', '0', '0'); ?></a>
</div>
</div>
</div>

View File

@ -26,7 +26,7 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Draft'); ?><i class="fa fa-download floatRight download btn"></i></div>
<div class="portlet-head"><?= $this->getHtml('Draft'); ?><i class="lni lni-download download btn end-xs"></i></div>
<div class="slider">
<table id="newsArchiveList" class="default sticky">
<thead>

View File

@ -31,28 +31,25 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<article>
<h1><?= $this->printHtml($news->title); ?><span class="floatRight"><a href="<?= $profile; ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$news->createdBy->name1, $news->createdBy->name2, $news->createdBy->name3, $news->createdBy->login ?? ''])); ?></a> - <?= $news->publish->format('Y-m-d'); ?></span></h1>
<?= $news->content; ?>
</article>
<?php if ($editable || !empty($tags)) : ?>
<div class="portlet-foot">
<div class="row">
<div class="col-xs-6 overflowfix">
<?php foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
<?php $files = $news->getMedia(); foreach ($files as $file) : ?>
<span><a class="content" href="<?= UriFactory::build('{/base}/media/single?id=' . $file->id);?>"><?= $file->name; ?></a></span>
<?php endforeach; ?>
</div>
<?php if ($editable) : ?>
<div class="col-xs-6 end-xs plain-grid">
<a tabindex="0" class="button" href="<?= UriFactory::build('{/base}/news/edit?id=' . $news->id); ?>"><?= $this->getHtml('Edit'); ?></a>
</div>
<?php endif; ?>
<div class="portlet-body">
<article>
<h1><?= $this->printHtml($news->title); ?><span class="floatRight"><a href="<?= $profile; ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$news->createdBy->name1, $news->createdBy->name2, $news->createdBy->name3, $news->createdBy->login ?? ''])); ?></a> - <?= $news->publish->format('Y-m-d'); ?></span></h1>
<?= $news->content; ?>
</article>
<div>
<?php $files = $news->getMedia(); foreach ($files as $file) : ?>
<span><a class="content" href="<?= UriFactory::build('{/base}/media/single?id=' . $file->id);?>"><?= $file->name; ?></a></span>
<?php endforeach; ?>
</div>
<div>
<?php foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
</div>
</div>
<?php if ($editable) : ?>
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build('{/base}/news/edit?id=' . $news->id); ?>"><?= $this->getHtml('Edit'); ?></a>
</div>
<?php endif; ?>
</section>