This commit is contained in:
Dennis Eichhorn 2023-06-20 22:10:23 +00:00
parent 454d1b7afe
commit 30622b03a3
5 changed files with 14 additions and 4 deletions

View File

@ -116,10 +116,12 @@ final class BackendController extends Controller
$question = QAQuestionMapper::get()
->with('answers')
->with('answers/createdBy')
->with('answers/createdBy/image')
->with('answers/createdBy/account')
->with('answers/votes')
->with('createdBy')
->with('createdBy/account')
->with('createdBy/image')
->with('votes')
->with('tags')
->with('tags/title')

View File

@ -34,6 +34,7 @@ final class NullQAAnswerVote extends QAAnswerVote
public function __construct(int $id = 0)
{
$this->id = $id;
parent::__construct();
}
/**

View File

@ -34,6 +34,7 @@ final class NullQAQuestionVote extends QAQuestionVote
public function __construct(int $id = 0)
{
$this->id = $id;
parent::__construct();
}
/**

View File

@ -56,7 +56,9 @@ echo $this->data['nav']->render(); ?>
</div>
<div class="portlet-foot qa-portlet-foot">
<div class="tag-list">
<?php $tags = $question->getTags(); foreach ($tags as $tag) : ?>
<?php $tags = $question->getTags(); foreach ($tags as $tag) :
if ($tag->id === 0) { continue; }
?>
<span class="tag"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
</div>

View File

@ -68,7 +68,11 @@ echo $this->data['nav']->render();
</div>
<div class="portlet-foot qa-portlet-foot">
<div class="tag-list">
<?php $tags = $question->getTags(); foreach ($tags as $tag) : ?>
<?php
$tags = $question->getTags();
foreach ($tags as $tag) :
if ($tag->id === 0) { continue; }
?>
<span class="tag"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
</div>
@ -84,7 +88,7 @@ echo $this->data['nav']->render();
</span>
<?php if ($question->createdBy->image->id > 0) : ?>
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/app}/' . $question->createdBy->image->getPath()); ?>">
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build($question->createdBy->image->getPath()); ?>">
<?php endif; ?>
</a>
</div>
@ -155,7 +159,7 @@ echo $this->data['nav']->render();
<div class="name-score">Score: <?= $scores[$answer->createdBy->account->id] ?? 0; ?></div>
</span>
<?php if ($answer->createdBy->image->id > 0) : ?>
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/app}/' . $answer->createdBy->image->getPath()); ?>">
<img width="40px" alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build($answer->createdBy->image->getPath()); ?>">
<?php endif; ?>
</a>
</div>