1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

Update misc bits of Ponder to TwoColumnView

Summary: Brings in the new headers, layout into Ponder History, editing.

Test Plan: Edit Question, Edit Answer, Question History, Answer History

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15530
This commit is contained in:
Chad Little 2016-03-27 13:07:53 -07:00
parent 6ad70d2236
commit dccce14621
5 changed files with 63 additions and 40 deletions

View file

@ -91,10 +91,16 @@ final class PonderAnswerEditController extends PonderController {
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb("Q{$qid}", $answer_uri); $crumbs->addTextCrumb("Q{$qid}", $answer_uri);
$crumbs->addTextCrumb(pht('Edit Answer')); $crumbs->addTextCrumb(pht('Edit Answer'));
$crumbs->setBorder(true);
$form_box = id(new PHUIObjectBoxView()) $header = id(new PHUIHeaderView())
->setHeaderText(pht('Edit Answer')) ->setHeader(pht('Edit Answer'))
->setHeaderIcon('fa-pencil');
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Answer'))
->setFormErrors($errors) ->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$preview = id(new PHUIRemarkupPreviewPanel()) $preview = id(new PHUIRemarkupPreviewPanel())
@ -102,15 +108,17 @@ final class PonderAnswerEditController extends PonderController {
->setControlID($answer_content_id) ->setControlID($answer_content_id)
->setPreviewURI($this->getApplicationURI('preview/')); ->setPreviewURI($this->getApplicationURI('preview/'));
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter(array(
$form_box, $box,
$preview, $preview,
),
array(
'title' => pht('Edit Answer'),
)); ));
return $this->newPage()
->setTitle(pht('Edit Answer'))
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -18,7 +18,6 @@ final class PonderAnswerHistoryController extends PonderController {
return new Aphront404Response(); return new Aphront404Response();
} }
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(
$answer, $answer,
new PonderAnswerTransactionQuery()); new PonderAnswerTransactionQuery());
@ -32,15 +31,20 @@ final class PonderAnswerHistoryController extends PonderController {
$crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
$crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}"); $crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}");
$crumbs->addTextCrumb(pht('History')); $crumbs->addTextCrumb(pht('History'));
$crumbs->setBorder(true);
return $this->buildApplicationPage( $header = id(new PHUIHeaderView())
array( ->setHeader(pht('Answer History'))
$crumbs, ->setHeaderIcon('fa-history');
$timeline,
), $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
'title' => pht('Answer History'), ->setFooter($timeline);
));
return $this->newPage()
->setTitle(pht('Answer History'))
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -19,7 +19,6 @@ final class PonderQuestionCommentController extends PonderController {
} }
$is_preview = $request->isPreviewRequest(); $is_preview = $request->isPreviewRequest();
// $draft = PhabricatorDraft::buildFromRequest($request);
$qid = $question->getID(); $qid = $question->getID();
$view_uri = "/Q{$qid}"; $view_uri = "/Q{$qid}";
@ -45,10 +44,6 @@ final class PonderQuestionCommentController extends PonderController {
->setException($ex); ->setException($ex);
} }
// if ($draft) {
// $draft->replaceOrDelete();
// }
if ($request->isAjax() && $is_preview) { if ($request->isAjax() && $is_preview) {
return id(new PhabricatorApplicationTransactionResponse()) return id(new PhabricatorApplicationTransactionResponse())
->setViewer($viewer) ->setViewer($viewer)

View file

@ -183,26 +183,37 @@ final class PonderQuestionEditController extends PonderController {
$crumbs->addTextCrumb("Q{$id}", "/Q{$id}"); $crumbs->addTextCrumb("Q{$id}", "/Q{$id}");
$crumbs->addTextCrumb(pht('Edit')); $crumbs->addTextCrumb(pht('Edit'));
$title = pht('Edit Question'); $title = pht('Edit Question');
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-pencil');
} else { } else {
$crumbs->addTextCrumb(pht('Ask Question')); $crumbs->addTextCrumb(pht('Ask Question'));
$title = pht('Ask New Question'); $title = pht('Ask New Question');
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-plus-square');
} }
$crumbs->setBorder(true);
$form_box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($title) ->setHeaderText(pht('Question'))
->setFormErrors($errors) ->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setFooter(array(
$form_box, $box,
$preview, $preview,
$answer_preview, $answer_preview,
),
array(
'title' => $title,
)); ));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -29,15 +29,20 @@ final class PonderQuestionHistoryController extends PonderController {
$crumbs->setBorder(true); $crumbs->setBorder(true);
$crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
$crumbs->addTextCrumb(pht('History')); $crumbs->addTextCrumb(pht('History'));
$crumbs->setBorder(true);
return $this->buildApplicationPage( $header = id(new PHUIHeaderView())
array( ->setHeader($question->getTitle())
$crumbs, ->setHeaderIcon('fa-history');
$timeline,
), $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
'title' => pht('Question History'), ->setFooter($timeline);
));
return $this->newPage()
->setTitle(pht('Question History'))
->setCrumbs($crumbs)
->appendChild($view);
} }
} }