mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 18:32:41 +01:00
ef214e94ce
Summary: This is used in every other view. Test Plan: Browsed around. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4248
51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
final class PonderQuestionDetailView extends AphrontView {
|
|
|
|
private $question;
|
|
private $handles;
|
|
|
|
public function setQuestion($question) {
|
|
$this->question = $question;
|
|
return $this;
|
|
}
|
|
|
|
public function setHandles($handles) {
|
|
$this->handles = $handles;
|
|
return $this;
|
|
}
|
|
|
|
public function render() {
|
|
require_celerity_resource('ponder-core-view-css');
|
|
|
|
$question = $this->question;
|
|
$handles = $this->handles;
|
|
$user = $this->user;
|
|
|
|
$panel = id(new AphrontPanelView())
|
|
->addClass("ponder-panel");
|
|
|
|
$contentview = new PonderPostBodyView();
|
|
$contentview
|
|
->setTarget($question)
|
|
->setQuestion($question)
|
|
->setUser($user)
|
|
->setHandles($handles)
|
|
->setAction(PonderConstants::ASKED_LITERAL);
|
|
|
|
$commentview = new PonderCommentListView();
|
|
$commentview
|
|
->setUser($user)
|
|
->setHandles($handles)
|
|
->setComments($question->getComments())
|
|
->setTarget($question->getPHID())
|
|
->setQuestionID($question->getID())
|
|
->setActionURI(new PhutilURI('/ponder/comment/add/'));
|
|
|
|
$panel->appendChild($contentview);
|
|
$panel->appendChild($commentview);
|
|
|
|
return $panel->render();
|
|
}
|
|
|
|
}
|