impl. more static translations

This commit is contained in:
Dennis Eichhorn 2021-02-12 18:01:52 +01:00
parent 1160541bb8
commit 0e3887911c
3 changed files with 10 additions and 5 deletions

View File

@ -110,7 +110,7 @@ class NewsArticle implements \JsonSerializable, ArrayableInterface
* @var \DateTime
* @since 1.0.0
*/
private \DateTime $publish;
public \DateTime $publish;
/**
* Featured.

View File

@ -26,9 +26,12 @@ echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<?php foreach ($newsList as $news) : $url = UriFactory::build('{/prefix}news/article?id=' . $news->getId()); ?>
<?php foreach ($newsList as $news) :
$url = UriFactory::build('{/prefix}news/article?id=' . $news->getId());
$profile = UriFactory::build('{/prefix}profile/single?{?}&id=' . $news->createdBy->getId());
?>
<div class="portlet">
<div class="portlet-head"><a href="<?= $url; ?>"><?= $this->printHtml($news->title); ?></a></div>
<div class="portlet-head"><a href="<?= $url; ?>"><?= $this->printHtml($news->title); ?></a><span class="floatRight"><a href="<?= $profile; ?>"><?= $this->printHtml($news->createdBy->name3 . ' ' . $news->createdBy->name2 . ' ' . $news->createdBy->name1); ?></a> - <?= $news->publish->format('Y-m-d'); ?></span></div>
<div class="portlet-body">
<article>
<?= Markdown::parse(\substr($news->plain, 0, 500)); ?>

View File

@ -24,13 +24,15 @@ $editable = $this->getData('editable');
/** @var \Modules\Tag\Models\Tag[] $tag */
$tags = $news->getTags();
$profile = UriFactory::build('{/prefix}profile/single?{?}&id=' . $news->createdBy->getId());
/** @var \phpOMS\Views\View $this */
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<article>
<h1><?= $this->printHtml($news->title); ?></h1>
<h1><?= $this->printHtml($news->title); ?><span class="floatRight"><a href="<?= $profile; ?>"><?= $this->printHtml($news->createdBy->name3 . ' ' . $news->createdBy->name2 . ' ' . $news->createdBy->name1); ?></a> - <?= $news->publish->format('Y-m-d'); ?></span></h1>
<?= $news->content; ?>
</article>
<?php if ($editable || !empty($tags)) : ?>
@ -43,7 +45,7 @@ echo $this->getData('nav')->render(); ?>
</div>
<?php if ($editable) : ?>
<div class="col-xs-6 end-xs plain-grid">
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}news/edit?id=' . $news->getId()); ?>">Edit</a>
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}news/edit?id=' . $news->getId()); ?>"><?= $this->getHtml('Edit'); ?></a>
</div>
<?php endif; ?>
</div>