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 ...@@ -23,7 +23,7 @@ class News extends \GeorgRinger\News\Domain\Model\News
/** /**
* @var string * @var string
*/ */
protected $authorFeUser; protected $authorFeUser = '';
/** /**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\T3orgLayout\Domain\Model\Contributors> * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\T3orgLayout\Domain\Model\Contributors>
...@@ -51,10 +51,15 @@ class News extends \GeorgRinger\News\Domain\Model\News ...@@ -51,10 +51,15 @@ class News extends \GeorgRinger\News\Domain\Model\News
$this->authorFeUser = $authorFeUser; $this->authorFeUser = $authorFeUser;
} }
public function getAuthorFeUser(): string
{
return $this->authorFeUser;
}
/** /**
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser[] * @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser[]
*/ */
public function getAuthorFeUser() public function getAuthorFeUsers()
{ {
if (!$this->authorFeUser) { if (!$this->authorFeUser) {
return []; return [];
......
...@@ -76,13 +76,10 @@ ...@@ -76,13 +76,10 @@
<f:if condition="{newsItem.categories -> f:count()} > 0"> <f:if condition="{newsItem.categories -> f:count()} > 0">
<div class="news-list__item-categories d-block small"> <div class="news-list__item-categories d-block small">
<span> <span>
<f:translate key="categories" /> <f:translate key="categories" />:
:
</span> </span>
<f:for each="{newsItem.categories}" as="category" iteration="iterator"> <f:for each="{newsItem.categories}" as="category" iteration="iterator">
<span>{category.title} <span>{category.title}<f:if condition="{iterator.isLast} == false">,</f:if></span>
<f:if condition="{iterator.isLast} == false">,</f:if>
</span>
</f:for> </f:for>
</div> </div>
</f:if> </f:if>
...@@ -97,11 +94,11 @@ ...@@ -97,11 +94,11 @@
</div> </div>
</f:if> </f:if>
<!-- author --> <!-- author -->
<f:if condition="{newsItem.authorFeUser -> f:count()} > 0"> <f:if condition="{newsItem.authorFeUsers -> f:count()} > 0">
<f:then> <f:then>
<span class="news-list__item-author d-block small"> <span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.authorFeUser.name}" /> <f:translate key="author_simple" />
<f:for each="{newsItem.authorFeUser}" as="authorFeUser" iteration="authorFeUserIterator"> <f:for each="{newsItem.authorFeUsers}" as="authorFeUser" iteration="authorFeUserIterator">
<f:if condition="{authorFeUserIterator.isFirst} === false"> <f:if condition="{authorFeUserIterator.isFirst} === false">
<f:if condition="{authorFeUserIterator.isLast} === true"> <f:if condition="{authorFeUserIterator.isLast} === true">
<f:then> <f:then>
...@@ -119,7 +116,7 @@ ...@@ -119,7 +116,7 @@
<f:else> <f:else>
<f:if condition="{newsItem.author}"> <f:if condition="{newsItem.author}">
<span class="news-list__item-author d-block small"> <span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.author}" /> <f:translate key="author_simple" />
{newsItem.author} {newsItem.author}
</span> </span>
</f:if> </f:if>
......
...@@ -115,21 +115,19 @@ ...@@ -115,21 +115,19 @@
<span> <span>
<f:if condition="{category.uid}=={settings.budgetCategoryID}"> <f:if condition="{category.uid}=={settings.budgetCategoryID}">
<f:then> <f:then>
<f:link.page title="{category.title}" class="active" pageUid="{settings.budgetListPid}">{category.title}</f:link.page> <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:if condition="{iterator.isLast} == false">, </f:if>
</f:then> </f:then>
<f:else> <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: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:if condition="{iterator.isLast} == false">, </f:if>
</f:else> </f:else>
</f:if> </f:if>
</span> </span>
</f:for> </f:for>
<f:if condition="{newsItem.authorFeUser -> f:count()} > 0"> <f:if condition="{newsItem.authorFeUsers -> f:count()} > 0">
<f:then> <f:then>
<span class="news-list__item-author d-block small"> <span class="news-list__item-author d-block small">
<f:translate key="author" arguments="{0:dd.authorFeUser.name}" /> <f:translate key="author_simple" />
<f:for each="{newsItem.authorFeUser}" as="authorFeUser" iteration="authorFeUserIterator"> <f:for each="{newsItem.authorFeUsers}" as="authorFeUser" iteration="authorFeUserIterator">
<f:if condition="{authorFeUserIterator.isFirst} === false"> <f:if condition="{authorFeUserIterator.isFirst} === false">
<f:if condition="{authorFeUserIterator.isLast} === true"> <f:if condition="{authorFeUserIterator.isLast} === true">
<f:then> <f:then>
......
Supports Markdown
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