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->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->addFilter('question/ask', 'Ask a Question');

View file

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

View file

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