mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-11 06:18:40 +00:00
continue to implement news tpl files
This commit is contained in:
parent
c79c019f3e
commit
17806c2667
|
|
@ -45,7 +45,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()); ?></span></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getTitle()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getCreatedBy()->getName2() . ', ' . $news->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getPublish()->format('Y-m-d')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use \phpOMS\Uri\UriFactory;
|
||||
use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
/** @var \Modules\News\Models\NewsArticle[] $newsList */
|
||||
|
|
@ -30,7 +31,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<div class="portlet-head"><a href="<?= $url; ?>"><?= $this->printHtml($news->getTitle()); ?></a></div>
|
||||
<div class="portlet-body">
|
||||
<article>
|
||||
<?= \substr($news->getContent(), 0, 500) . (\strlen($news->getContent()) > 500 ? '...' : ''); ?>
|
||||
<?= Markdown::parse(\substr($news->getPlain(), 0, 500)); ?>
|
||||
</article>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td><span class="tag <?= $this->printHtml($color); ?>"><?= $this->getHtml('TYPE' . $news->getType()); ?></span></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getTitle()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getCreatedBy()->getName2() . ', ' . $news->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($news->getPublish()->format('Y-m-d')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
|
|
|
|||
|
|
@ -56,9 +56,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<?php
|
||||
$commentList = $news->getComments();
|
||||
if (!empty($commentList) && $commentList->isActive()) :
|
||||
/* @todo: check if user has permission to create a comment here, maybe he is only allowed to read comments */
|
||||
/* @todo: instead of creating a custom news list or news textarea I should create a component which simply gets loaded on the pages by passing the commentList id and the comments to show */
|
||||
$this->getData('commentCreate')->render(1);
|
||||
|
||||
$this->getData('commentList')->render(1);
|
||||
/* @todo: check if user has permission to create a comment here, maybe he is only allowed to read comments */
|
||||
echo $this->getData('commentCreate')->render(1);
|
||||
echo $this->getData('commentList')->render($commentList);
|
||||
endif; ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user