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->addTextCrumb("Q{$qid}", $answer_uri);
$crumbs->addTextCrumb(pht('Edit Answer'));
$crumbs->setBorder(true);
$form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Edit Answer'))
$header = id(new PHUIHeaderView())
->setHeader(pht('Edit Answer'))
->setHeaderIcon('fa-pencil');
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Answer'))
->setFormErrors($errors)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
$preview = id(new PHUIRemarkupPreviewPanel())
@ -102,15 +108,17 @@ final class PonderAnswerEditController extends PonderController {
->setControlID($answer_content_id)
->setPreviewURI($this->getApplicationURI('preview/'));
return $this->buildApplicationPage(
array(
$crumbs,
$form_box,
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
$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();
}
$timeline = $this->buildTransactionTimeline(
$answer,
new PonderAnswerTransactionQuery());
@ -32,15 +31,20 @@ final class PonderAnswerHistoryController extends PonderController {
$crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
$crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}");
$crumbs->addTextCrumb(pht('History'));
$crumbs->setBorder(true);
return $this->buildApplicationPage(
array(
$crumbs,
$timeline,
),
array(
'title' => pht('Answer History'),
));
$header = id(new PHUIHeaderView())
->setHeader(pht('Answer History'))
->setHeaderIcon('fa-history');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->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();
// $draft = PhabricatorDraft::buildFromRequest($request);
$qid = $question->getID();
$view_uri = "/Q{$qid}";
@ -45,10 +44,6 @@ final class PonderQuestionCommentController extends PonderController {
->setException($ex);
}
// if ($draft) {
// $draft->replaceOrDelete();
// }
if ($request->isAjax() && $is_preview) {
return id(new PhabricatorApplicationTransactionResponse())
->setViewer($viewer)

View file

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