Give PHUITwoColumnView an addPropertySection method
Summary: Simplifies building pages a little more, adds a helper method to just add a property section to the main column automatically above other content. Test Plan: Review Ponder, Herald, Passphrase, Countdown. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15377
This commit is contained in:
@@ -44,7 +44,7 @@ final class PonderQuestionViewController extends PonderController {
|
||||
|
||||
$properties = $this->buildPropertyListView($question);
|
||||
$actions = $this->buildActionListView($question);
|
||||
$details = $this->buildDetailsPropertyView($question);
|
||||
$details = $this->buildPropertySectionView($question);
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
@@ -107,7 +107,6 @@ final class PonderQuestionViewController extends PonderController {
|
||||
'class' => 'ponder-question-content',
|
||||
),
|
||||
array(
|
||||
$details,
|
||||
$footer,
|
||||
$comment_view,
|
||||
$answer_wiki,
|
||||
@@ -120,6 +119,7 @@ final class PonderQuestionViewController extends PonderController {
|
||||
->setSubheader($subheader)
|
||||
->setMainColumn($ponder_content)
|
||||
->setPropertyList($properties)
|
||||
->addPropertySection(pht('DETAILS'), $details)
|
||||
->setActionList($actions)
|
||||
->addClass('ponder-question-view');
|
||||
|
||||
@@ -222,7 +222,7 @@ final class PonderQuestionViewController extends PonderController {
|
||||
->setContent($content);
|
||||
}
|
||||
|
||||
private function buildDetailsPropertyView(
|
||||
private function buildPropertySectionView(
|
||||
PonderQuestion $question) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
@@ -241,11 +241,7 @@ final class PonderQuestionViewController extends PonderController {
|
||||
$question_details = phutil_tag_div(
|
||||
'phabricator-remarkup ml', $question_details);
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('DETAILS'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setFlush(true)
|
||||
->appendChild($question_details);
|
||||
return $question_details;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,7 +270,6 @@ final class PonderQuestionViewController extends PonderController {
|
||||
->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT)));
|
||||
$xactions = $timeline->getTransactions();
|
||||
|
||||
|
||||
$view[] = id(new PonderAnswerView())
|
||||
->setUser($viewer)
|
||||
->setAnswer($answer)
|
||||
|
||||
Reference in New Issue
Block a user