From 17806c26670667fcd9ed0d0be37575a4723172ec Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 25 Oct 2020 23:08:37 +0100 Subject: [PATCH] continue to implement news tpl files --- Theme/Backend/news-archive.tpl.php | 2 +- Theme/Backend/news-dashboard.tpl.php | 3 ++- Theme/Backend/news-draft.tpl.php | 2 +- Theme/Backend/news-single.tpl.php | 8 +++----- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Theme/Backend/news-archive.tpl.php b/Theme/Backend/news-archive.tpl.php index 5c2b385..c355eae 100755 --- a/Theme/Backend/news-archive.tpl.php +++ b/Theme/Backend/news-archive.tpl.php @@ -45,7 +45,7 @@ echo $this->getData('nav')->render(); ?> getHtml('TYPE' . $news->getType()); ?> printHtml($news->getTitle()); ?> - printHtml($news->getCreatedBy()->getName1()); ?> + printHtml($news->getCreatedBy()->getName2() . ', ' . $news->getCreatedBy()->getName1()); ?> printHtml($news->getPublish()->format('Y-m-d')); ?> diff --git a/Theme/Backend/news-dashboard.tpl.php b/Theme/Backend/news-dashboard.tpl.php index 89e6f2d..4eaceb3 100755 --- a/Theme/Backend/news-dashboard.tpl.php +++ b/Theme/Backend/news-dashboard.tpl.php @@ -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(); ?>
printHtml($news->getTitle()); ?>
- getContent(), 0, 500) . (\strlen($news->getContent()) > 500 ? '...' : ''); ?> + getPlain(), 0, 500)); ?>
diff --git a/Theme/Backend/news-draft.tpl.php b/Theme/Backend/news-draft.tpl.php index 9025d56..0e34d7a 100644 --- a/Theme/Backend/news-draft.tpl.php +++ b/Theme/Backend/news-draft.tpl.php @@ -45,7 +45,7 @@ echo $this->getData('nav')->render(); ?> getHtml('TYPE' . $news->getType()); ?> printHtml($news->getTitle()); ?> - printHtml($news->getCreatedBy()->getName1()); ?> + printHtml($news->getCreatedBy()->getName2() . ', ' . $news->getCreatedBy()->getName1()); ?> printHtml($news->getPublish()->format('Y-m-d')); ?> diff --git a/Theme/Backend/news-single.tpl.php b/Theme/Backend/news-single.tpl.php index dccb1e6..5ed485f 100755 --- a/Theme/Backend/news-single.tpl.php +++ b/Theme/Backend/news-single.tpl.php @@ -56,9 +56,7 @@ echo $this->getData('nav')->render(); ?> 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; ?>