This commit is contained in:
Dennis Eichhorn 2017-07-17 19:48:42 +02:00
parent 93426a8a9d
commit bd2351dc28
2 changed files with 12 additions and 1 deletions

View File

@ -59,6 +59,17 @@ class QAQuestion implements \JsonSerializable
return $this->id;
}
public function hasAccepted() : bool
{
foreach($this->answers as $answer) {
if($answer->isAccepted()) {
return true;
}
}
return false;
}
public function getLanguage() : string
{
return $this->language;

View File

@ -9,7 +9,7 @@ echo $this->getData('nav')->render(); ?>
<div class="inner">
<div class="row middle-xs">
<div class="col-xs-1 scores">
<span class="score"><?= count($question->getAnswers()); ?></span>
<span class="score<?= $question->hasAccepted() ? ' done' : ''; ?>"><?= count($question->getAnswers()); ?></span>
</div>
<div class="title col-xs-11">
<a href="<?= \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/qa/question?{?}&id=' . $question->getId()) ?>"><?= $question->getName(); ?></a>