mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-01-27 07:38:41 +00:00
add css version
This commit is contained in:
parent
95f07a91c9
commit
09368ea9fb
|
|
@ -280,14 +280,14 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('news',
|
||||
NewsArticleMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute()
|
||||
NewsArticleMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '<')->where('status', NewsStatus::DRAFT)->limit(25)->execute()
|
||||
);
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('news',
|
||||
NewsArticleMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute()
|
||||
NewsArticleMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '>')->where('status', NewsStatus::DRAFT)->limit(25)->execute()
|
||||
);
|
||||
} else {
|
||||
$view->setData('news', NewsArticleMapper::getAll()->where('id', 0, '>')->limit(25)->execute());
|
||||
$view->setData('news', NewsArticleMapper::getAll()->where('id', 0, '>')->where('status', NewsStatus::DRAFT)->limit(25)->execute());
|
||||
}
|
||||
|
||||
return $view;
|
||||
|
|
|
|||
|
|
@ -40,11 +40,9 @@ echo $this->getData('nav')->render(); ?>
|
|||
</span>
|
||||
<?= !$isSeen ? '</strong>' : ''; ?>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<article>
|
||||
<?= Markdown::parse(\substr($news->plain, 0, 500)); ?>
|
||||
</article>
|
||||
</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) : ?>
|
||||
|
|
|
|||
|
|
@ -12,15 +12,14 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\News\Models\NewsType;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
/** @var \Modules\News\Models\NewsArticle[] $newsList */
|
||||
$newsList = $this->getData('news') ?? [];
|
||||
|
||||
$previous = empty($newsList) ? '{/prefix}news/draft/list' : '{/prefix}news/draft/list?{?}&id=' . \reset($newsList)->getId() . '&ptype=p';
|
||||
$next = empty($newsList) ? '{/prefix}news/draft/list' : '{/prefix}news/draft/list?{?}&id=' . \end($newsList)->getId() . '&ptype=n';
|
||||
$previous = empty($newsList) ? '{/prefix}news/archive' : '{/prefix}news/archive?{?}&id=' . \reset($newsList)->getId() . '&ptype=p';
|
||||
$next = empty($newsList) ? '{/prefix}news/archive' : '{/prefix}news/archive?{?}&id=' . \end($newsList)->getId() . '&ptype=n';
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
|
|
@ -28,77 +27,76 @@ echo $this->getData('nav')->render(); ?>
|
|||
<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>
|
||||
<table id="newsDraftList" class="default">
|
||||
<div class="slider">
|
||||
<table id="newsArchiveList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Type'); ?>
|
||||
<label for="newsDraftList-sort-1">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-1">
|
||||
<label for="newsArchiveList-sort-1">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-1">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="newsDraftList-sort-2">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-2">
|
||||
<label for="newsArchiveList-sort-2">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-2">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Title'); ?>
|
||||
<label for="newsDraftList-sort-3">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-3">
|
||||
<label for="newsArchiveList-sort-3">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-3">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="newsDraftList-sort-4">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-4">
|
||||
<label for="newsArchiveList-sort-4">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-4">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Author'); ?>
|
||||
<label for="newsDraftList-sort-5">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-5">
|
||||
<label for="newsArchiveList-sort-5">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-5">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="newsDraftList-sort-6">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-6">
|
||||
<label for="newsArchiveList-sort-6">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-6">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<label for="newsDraftList-sort-7">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-7">
|
||||
<label for="newsArchiveList-sort-7">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-7">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="newsDraftList-sort-8">
|
||||
<input type="radio" name="newsDraftList-sort" id="newsDraftList-sort-8">
|
||||
<label for="newsArchiveList-sort-8">
|
||||
<input type="radio" name="newsArchiveList-sort" id="newsArchiveList-sort-8">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<tbody>
|
||||
<?php $count = 0;
|
||||
<?php
|
||||
$count = 0;
|
||||
|
||||
foreach ($newsList as $key => $news) : ++$count;
|
||||
$url = UriFactory::build('{/prefix}news/edit?{?}&id=' . $news->getId());
|
||||
$color = 'darkred';
|
||||
|
||||
if ($news->getType() === NewsType::ARTICLE) { $color = 'green'; }
|
||||
elseif ($news->getType() === NewsType::HEADLINE) { $color = 'purple'; }
|
||||
elseif ($news->getType() === NewsType::LINK) { $color = 'yellow'; }
|
||||
?>
|
||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()); ?></span></a>
|
||||
<td><span class="tag"><?= $this->getHtml('TYPE' . $news->getType()); ?></span></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->title); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->createdBy->name2 . ', ' . $news->createdBy->name1); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getPublish()->format('Y-m-d')); ?></a>
|
||||
<td><a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $news->createdBy->getId()); ?>"><?= $this->printHtml($news->createdBy->name2 . ', ' . $news->createdBy->name1); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->publish->format('Y-m-d')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<a class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
|
||||
<a class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user