Commit 070277ea authored by Stefan Busemann's avatar Stefan Busemann
Browse files

Merge branch 'bugfix/news-author' into 'develop'

Change inconsistent methods, adapt it to templates and remove whitespace between commas

See merge request !412
parents 7682bab9 0d4ad83f
Pipeline #10333 passed with stages
in 2 minutes and 57 seconds
......@@ -23,7 +23,7 @@ class News extends \GeorgRinger\News\Domain\Model\News
/**
* @var string
*/
protected $authorFeUser;
protected $authorFeUser = '';
/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\T3orgLayout\Domain\Model\Contributors>
......@@ -51,10 +51,15 @@ class News extends \GeorgRinger\News\Domain\Model\News
$this->authorFeUser = $authorFeUser;
}
public function getAuthorFeUser(): string
{
return $this->authorFeUser;
}
/**
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser[]
*/
public function getAuthorFeUser()
public function getAuthorFeUsers()
{
if (!$this->authorFeUser) {
return [];
......
......@@ -76,13 +76,10 @@
<f:if condition="{newsItem.categories -> f:count()} > 0">
<div class="news-list__item-categories d-block small">
<span>
<f:translate key="categories" />
:
<f:translate key="categories" />:
</span>
<f:for each="{newsItem.categories}" as="category" iteration="iterator">
<span>{category.title}
<f:if condition="{iterator.isLast} == false">,</f:if>
</span>
<span>{category.title}<f:if condition="{iterator.isLast} == false">,</f:if></span>
</f:for>
</div>
</f:if>
......@@ -97,11 +94,11 @@
</div>
</f:if>
<!-- author -->
<f:if condition="{newsItem.authorFeUser -> f:count()} > 0">
<f:if condition="{newsItem.authorFeUsers -> f:count()} > 0">
<f:then>
<span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.authorFeUser.name}" />
<f:for each="{newsItem.authorFeUser}" as="authorFeUser" iteration="authorFeUserIterator">
<f:translate key="author_simple" />
<f:for each="{newsItem.authorFeUsers}" as="authorFeUser" iteration="authorFeUserIterator">
<f:if condition="{authorFeUserIterator.isFirst} === false">
<f:if condition="{authorFeUserIterator.isLast} === true">
<f:then>
......@@ -119,7 +116,7 @@
<f:else>
<f:if condition="{newsItem.author}">
<span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.author}" />
<f:translate key="author_simple" />
{newsItem.author}
</span>
</f:if>
......
......@@ -115,21 +115,19 @@
<span>
<f:if condition="{category.uid}=={settings.budgetCategoryID}">
<f:then>
<f:link.page title="{category.title}" class="active" pageUid="{settings.budgetListPid}">{category.title}</f:link.page>
<f:if condition="{iterator.isLast} == false">, </f:if>
<f:link.page title="{category.title}" class="active" pageUid="{settings.budgetListPid}">{category.title}</f:link.page><f:if condition="{iterator.isLast} == false">, </f:if>
</f:then>
<f:else>
<f:link.page title="{category.title}" class="active" pageUid="{settings.listPid}" additionalParams="{tx_news_pi1:{overwriteDemand:{categories: category.uid}}}">{category.title}</f:link.page>
<f:if condition="{iterator.isLast} == false">, </f:if>
<f:link.page title="{category.title}" class="active" pageUid="{settings.listPid}" additionalParams="{tx_news_pi1:{overwriteDemand:{categories: category.uid}}}">{category.title}</f:link.page><f:if condition="{iterator.isLast} == false">, </f:if>
</f:else>
</f:if>
</span>
</f:for>
<f:if condition="{newsItem.authorFeUser -> f:count()} > 0">
<f:if condition="{newsItem.authorFeUsers -> f:count()} > 0">
<f:then>
<span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.authorFeUser.name}" />
<f:for each="{newsItem.authorFeUser}" as="authorFeUser" iteration="authorFeUserIterator">
<f:translate key="author_simple" />
<f:for each="{newsItem.authorFeUsers}" as="authorFeUser" iteration="authorFeUserIterator">
<f:if condition="{authorFeUserIterator.isFirst} === false">
<f:if condition="{authorFeUserIterator.isLast} === true">
<f:then>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment