oms-QA/Theme/Backend/qa-question.tpl.php
2021-06-05 11:01:03 +02:00

50 lines
1.4 KiB
PHP
Executable File

<?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Modules\QA
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
$question = $this->getData('question');
$answers = $question->getAnswers();
echo $this->getData('nav')->render();
?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->printHtml($question->name); ?></div>
<div class="portlet-body">
<?= $question->question; ?>
</div>
<div class="inner">
<?php if ($question->createdBy->image !== null) : ?>
<img alt="<?= $this->getHtml('AccountImage', '0', '0'); ?>" loading="lazy" src="<?= UriFactory::build('{/prefix}' . $question->createdBy->image->getPath()); ?>">
<?php endif; ?>
</div>
</section>
</div>
</div>
<?php foreach ($answers as $answer) : ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-body">
<?= $answer->answer; ?><?= $this->printHtml($answer->createdAt->format('Y-m-d')); ?><?= $answer->createdBy->getId(); ?><?= $answer->getStatus(); ?><?= $this->printHtml((string) $answer->isAccepted()); ?>
</div>
</section>
</div>
</div>
<?php endforeach; ?>