1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00
phorge-phorge/src/applications/ponder/view/PonderAddAnswerView.php
epriestley ba8803af96 Hide Ponder comments and "add comment" form behind a disclosure link
Summary: Ref T3373. This is probably about as good as I can get without actual design, but it seems mostly improved over what we had going on before?

Test Plan: {F52087}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3373

Differential Revision: https://secure.phabricator.com/D6613
2013-07-29 12:04:12 -07:00

55 lines
1.3 KiB
PHP

<?php
final class PonderAddAnswerView extends AphrontView {
private $question;
private $actionURI;
private $draft;
public function setQuestion($question) {
$this->question = $question;
return $this;
}
public function setActionURI($uri) {
$this->actionURI = $uri;
return $this;
}
public function render() {
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$question = $this->question;
$header = id(new PhabricatorHeaderView())
->setHeader(pht('Add Answer'));
$form = new AphrontFormView();
$form
->setFlexible(true)
->setUser($this->user)
->setAction($this->actionURI)
->setWorkflow(true)
->addHiddenInput('question_id', $question->getID())
->appendChild(
id(new PhabricatorRemarkupControl())
->setName('answer')
->setLabel(pht('Answer'))
->setError(true)
->setID('answer-content')
->setUser($this->user))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue($is_serious ?
pht('Submit') :
pht('Make it so')));
return id(new AphrontNullView())
->appendChild(
array(
$header,
$form,
))
->render();
}
}