Skip to content

Commit

Permalink
Merge pull request #15 from pixelant/question_comment
Browse files Browse the repository at this point in the history
[TASK] added single view comment
  • Loading branch information
VladVilya authored May 6, 2021
2 parents 82e9d82 + efc5d9b commit 41bdf6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Classes/Controller/QuestionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ public function initializeListAction()
*/
public function listAction(Question $question = null, string $selectedCategory = '', int $categoryDetail = 0, string $singleViewPid = '0', array $gtag = [])
{

if ($question !== null) {
$this->forward('detail', null, null, ['question' => $question]);
$this->forward('detail', null, null, ['question' => $question, 'showCommentForm' => (int)$this->settings['flexform']['showQuestionCommentForm']]);
}

if ($this->settings['singleViewPid']) {
Expand Down Expand Up @@ -112,10 +111,10 @@ public function listAction(Question $question = null, string $selectedCategory =
*
* @param Question $question
* @param array $gtag
*
* @param int $showCommentForm
* @return void
*/
public function detailAction(Question $question, array $gtag)
public function detailAction(Question $question, array $gtag, int $showCommentForm = 0)
{
$currentUid = $this->getCurrentUid();

Expand All @@ -132,7 +131,7 @@ public function detailAction(Question $question, array $gtag)

$this->view->assignMultiple(array(
'question' => $question,
'showQuestionCommentForm' => (int)$this->settings['flexform']['showQuestionCommentForm'],
'showQuestionCommentForm' => $showCommentForm,
'currentUid' => $currentUid,
'gtag' => $gtag,
'restrictToCategories' => $restrictToCategories,
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Partials/Question/Question.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h3 class="toggleTrigger" itemprop="text">{question.question}</h3>
</f:then>
<f:else>
<f:link.action action="detail" pageUid="{singleViewPid}" arguments="{question: '{question}', gtag: gtag}">{question.question}</f:link.action>
<f:link.action action="detail" pageUid="{singleViewPid}" arguments="{question: '{question}', gtag: gtag, showCommentForm: showQuestionCommentForm}">{question.question}</f:link.action>
</f:else>
</f:if>

Expand All @@ -29,4 +29,4 @@ <h3 class="toggleTrigger" itemprop="text">{question.question}</h3>
</div>
</div>
</li>
</html>
</html>

0 comments on commit 41bdf6a

Please sign in to comment.