diff --git a/Controller.php b/Controller.php
index 85b8abc..f13fb8d 100644
--- a/Controller.php
+++ b/Controller.php
@@ -21,6 +21,7 @@ use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
use phpOMS\Views\View;
+use phpOMS\Asset\AssetType;
use Modules\QA\Models\QAQuestionMapper;
@@ -79,7 +80,7 @@ class Controller extends ModuleAbstract implements WebInterface
protected static $dependencies = [
];
- public function setUpBackend()
+ public function setUpBackend(RequestAbstract $request, ResponseAbstract $response, $data = null)
{
$head = $response->get('Content')->getData('head');
$head->addAsset(AssetType::CSS, $request->getUri()->getBase() . 'Modules/QA/Theme/Backend/styles.css');
@@ -107,4 +108,15 @@ class Controller extends ModuleAbstract implements WebInterface
return $view;
}
+ public function viewQADoc(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
+ {
+ $view = new View($this->app, $request, $response);
+ $view->setTemplate('/Modules/QA/Theme/Backend/qa-question');
+ $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006001001, $request, $response));
+
+ $question = QAQuestionMapper::get((int) $request->getData('id'));
+ $view->addData('question', $question);
+
+ return $view;
+ }
}
diff --git a/Theme/Backend/qa-dashboard.tpl.php b/Theme/Backend/qa-dashboard.tpl.php
index 6931b98..144b704 100644
--- a/Theme/Backend/qa-dashboard.tpl.php
+++ b/Theme/Backend/qa-dashboard.tpl.php
@@ -6,10 +6,21 @@ echo $this->getData('nav')->render(); ?>
- = count($question->getAnswers()); ?>
= $question->getName(); ?>
- getBadges(); foreach($badges as $badge) : ?>
- = $badge->getName(); ?>
-
+
+
+
+ = count($question->getAnswers()); ?>
+
+
+
+
+ getBadges(); foreach($badges as $badge) : ?>
+ = $badge->getName(); ?>
+
+
+
diff --git a/Theme/Backend/qa-question.tpl.php b/Theme/Backend/qa-question.tpl.php
new file mode 100644
index 0000000..452e41d
--- /dev/null
+++ b/Theme/Backend/qa-question.tpl.php
@@ -0,0 +1,29 @@
+getData('question');
+$answers = $question->getAnswers();
+
+echo $this->getData('nav')->render();
+?>
+
+
+
+
+ = $question->getName(); ?>
+
+ = $question->getQuestion(); ?>
+
+
+
+
+
+
+
+
+
+
+ = $answer->getAnswer(); ?>= $answer->getCreatedAt()->format('Y-m-d'); ?>= $answer->getCreatedBy(); ?>= $answer->getStatus(); ?>= $answer->isAccepted(); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/Theme/Backend/styles.css b/Theme/Backend/styles.css
index e2a6532..6f80943 100644
--- a/Theme/Backend/styles.css
+++ b/Theme/Backend/styles.css
@@ -1,8 +1,16 @@
-.qa-list .score.closed {
- background: #f00; }
-.qa-list .score.open {
- background: #ff0; }
-.qa-list .score.done {
- background: #0f0; }
-.qa-list h1 {
+.qa-list .score {
+ padding: 10px;
+ margin-right: 10px;
+ border: 1px solid #ccc; }
+ .qa-list .score.closed {
+ background: #f00; }
+ .qa-list .score.open {
+ background: #ff0; }
+ .qa-list .score.done {
+ background: #0f0; }
+.qa-list .scores {
+ flex-basis: min-content; }
+.qa-list .title a {
font-size: 2rem; }
+.qa-list .tags {
+ margin-top: 10px; }
diff --git a/Theme/Backend/styles.scss b/Theme/Backend/styles.scss
index b59f646..000395c 100644
--- a/Theme/Backend/styles.scss
+++ b/Theme/Backend/styles.scss
@@ -11,17 +11,23 @@
&.done {
background: #0f0;
}
+
+ padding: 10px;
+ margin-right: 10px;
+ border: 1px solid #ccc;
}
- h1 {
- font-size: 2rem;
+ .scores {
+ flex-basis: min-content;
}
- .date {
-
+ .title {
+ a {
+ font-size: 2rem;
+ }
}
- .user {
-
+ .tags {
+ margin-top: 10px;
}
}