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:
Chad Little
2016-03-01 12:14:28 -08:00
parent 2c43cccddf
commit caadd1025a
4 changed files with 46 additions and 33 deletions

View File

@@ -34,12 +34,13 @@ final class PassphraseCredentialViewController extends PassphraseController {
$actions = $this->buildActionView($credential, $type);
$properties = $this->buildPropertyView($credential, $type);
$subheader = $this->buildSubheaderView($credential);
$content = $this->buildDetailsView($credential, $type);
$content = $this->buildPropertySectionView($credential, $type);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setSubheader($subheader)
->setMainColumn(array($content, $timeline))
->setMainColumn($timeline)
->addPropertySection(pht('PROPERTIES'), $content)
->setPropertyList($properties)
->setActionList($actions);
@@ -186,7 +187,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
return $actions;
}
private function buildDetailsView(
private function buildPropertySectionView(
PassphraseCredential $credential,
PassphraseCredentialType $type) {
$viewer = $this->getRequest()->getUser();
@@ -231,10 +232,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
new PHUIRemarkupView($viewer, $description));
}
return id(new PHUIObjectBoxView())
->setHeaderText(pht('PROPERTIES'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($properties);
return $properties;
}
private function buildPropertyView(