1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Use responsive elements for Ponder "add answer" view

Summary: Side nav, plus "add answer".

Test Plan: {F19533}

Reviewers: pieter, starruler

Reviewed By: pieter

CC: aran

Maniphest Tasks: T1644

Differential Revision: https://secure.phabricator.com/D3516
This commit is contained in:
epriestley 2012-09-30 20:12:18 -07:00
parent ec3a11a3a1
commit e48fa0398b
3 changed files with 32 additions and 10 deletions

View file

@ -36,6 +36,14 @@ abstract class PonderController extends PhabricatorController {
$side_nav = new AphrontSideNavFilterView(); $side_nav = new AphrontSideNavFilterView();
$side_nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $side_nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($question && $question->getID()) {
$side_nav->addFilter(
null,
'Q'.$question->getID(),
'Q'.$question->getID());
$side_nav->addSpacer();
}
$side_nav->addLabel('Create'); $side_nav->addLabel('Create');
$side_nav->addFilter('question/ask', 'Ask a Question'); $side_nav->addFilter('question/ask', 'Ask a Question');

View file

@ -72,13 +72,20 @@ final class PonderQuestionViewController extends PonderController {
->setUser($user) ->setUser($user)
->setActionURI("/ponder/answer/add/"); ->setActionURI("/ponder/answer/add/");
return $this->buildStandardPageResponse( $nav = $this->buildSideNavView($question);
$nav->appendChild(
array( array(
$detail_panel, $detail_panel,
$responses_panel, $responses_panel,
$answer_add_panel $answer_add_panel
), ));
$nav->selectFilter(null);
return $this->buildApplicationPage(
$nav,
array( array(
'device' => true,
'title' => 'Q'.$question->getID().' '.$question->getTitle() 'title' => 'Q'.$question->getID().' '.$question->getTitle()
)); ));
} }

View file

@ -45,12 +45,12 @@ final class PonderAddAnswerView extends AphrontView {
$question = $this->question; $question = $this->question;
$panel = id(new AphrontPanelView()) $header = id(new PhabricatorHeaderView())
->addClass("ponder-panel") ->setHeader('Add Answer');
->setHeader("Your Answer:");
$form = new AphrontFormView(); $form = new AphrontFormView();
$form $form
->setFlexible(true)
->setUser($this->user) ->setUser($this->user)
->setAction($this->actionURI) ->setAction($this->actionURI)
->setWorkflow(true) ->setWorkflow(true)
@ -58,22 +58,22 @@ final class PonderAddAnswerView extends AphrontView {
->appendChild( ->appendChild(
id(new PhabricatorRemarkupControl()) id(new PhabricatorRemarkupControl())
->setName('answer') ->setName('answer')
->setLabel('Answer')
->setError(true)
->setID('answer-content') ->setID('answer-content')
->setEnableDragAndDropFileUploads(true)) ->setEnableDragAndDropFileUploads(true))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue($is_serious ? 'Submit' : 'Make it so.')); ->setValue($is_serious ? 'Submit' : 'Make it so.'));
$panel->appendChild($form); $preview =
$panel->appendChild(
'<div class="aphront-panel-flush">'. '<div class="aphront-panel-flush">'.
'<div id="answer-preview">'. '<div id="answer-preview">'.
'<span class="aphront-panel-preview-loading-text">'. '<span class="aphront-panel-preview-loading-text">'.
'Loading answer preview...'. 'Loading answer preview...'.
'</span>'. '</span>'.
'</div>'. '</div>'.
'</div>' '</div>';
);
Javelin::initBehavior( Javelin::initBehavior(
'ponder-feedback-preview', 'ponder-feedback-preview',
@ -84,6 +84,13 @@ final class PonderAddAnswerView extends AphrontView {
'question_id' => $question->getID() 'question_id' => $question->getID()
)); ));
return $panel->render(); return id(new AphrontNullView())
->appendChild(
array(
$header,
$form,
$preview,
))
->render();
} }
} }