1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-30 16:38:21 +01:00

Convert Applications to two column view

Summary: Converts the meta applications application view layout to two column

Test Plan: click through "Configure" on each application, set up some emails. uninstall Phrequent

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15405
This commit is contained in:
Chad Little 2016-03-05 20:34:56 +00:00 committed by chad
parent f6127f5835
commit 010b7811b4

View file

@ -24,11 +24,13 @@ final class PhabricatorApplicationDetailViewController
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($selected->getName()); $crumbs->addTextCrumb($selected->getName());
$crumbs->setBorder(true);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($title) ->setHeader($title)
->setUser($viewer) ->setUser($viewer)
->setPolicyObject($selected); ->setPolicyObject($selected)
->setHeaderIcon($selected->getIcon());
if ($selected->isInstalled()) { if ($selected->isInstalled()) {
$header->setStatus('fa-check', 'bluegrey', pht('Installed')); $header->setStatus('fa-check', 'bluegrey', pht('Installed'));
@ -37,11 +39,8 @@ final class PhabricatorApplicationDetailViewController
} }
$actions = $this->buildActionView($viewer, $selected); $actions = $this->buildActionView($viewer, $selected);
$properties = $this->buildPropertyView($selected, $actions); $details = $this->buildPropertySectionView($selected);
$policies = $this->buildPolicyView($selected);
$object_box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
$configs = $configs =
PhabricatorApplicationConfigurationPanel::loadAllPanelsForApplication( PhabricatorApplicationConfigurationPanel::loadAllPanelsForApplication(
@ -51,29 +50,35 @@ final class PhabricatorApplicationDetailViewController
foreach ($configs as $config) { foreach ($configs as $config) {
$config->setViewer($viewer); $config->setViewer($viewer);
$config->setApplication($selected); $config->setApplication($selected);
$panel = $config->buildConfigurationPagePanel();
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
$panels[] = $panel;
$panels[] = $config->buildConfigurationPagePanel();
} }
return $this->buildApplicationPage( $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
$crumbs, ->setMainColumn(array(
$object_box, $policies,
$panels, $panels,
), ))
->addPropertySection(pht('DETAILS'), $details)
->setActionList($actions);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild(
array( array(
'title' => $title, $view,
)); ));
} }
private function buildPropertyView( private function buildPropertySectionView(
PhabricatorApplication $application, PhabricatorApplication $application) {
PhabricatorActionListView $actions) {
$viewer = $this->getRequest()->getUser();
$viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView()); $properties = id(new PHUIPropertyListView());
$properties->setActionList($actions);
$properties->addProperty( $properties->addProperty(
pht('Description'), pht('Description'),
@ -111,20 +116,35 @@ final class PhabricatorApplicationDetailViewController
$properties->addTextContent($overview); $properties->addTextContent($overview);
} }
return $properties;
}
private function buildPolicyView(
PhabricatorApplication $application) {
$viewer = $this->getViewer();
$properties = id(new PHUIPropertyListView())
->setStacked(true);
$header = id(new PHUIHeaderView())
->setHeader(pht('POLICIES'))
->setHeaderIcon('fa-lock');
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
$viewer, $viewer,
$application); $application);
$properties->addSectionHeader(
pht('Policies'), 'fa-lock');
foreach ($application->getCapabilities() as $capability) { foreach ($application->getCapabilities() as $capability) {
$properties->addProperty( $properties->addProperty(
$application->getCapabilityLabel($capability), $application->getCapabilityLabel($capability),
idx($descriptions, $capability)); idx($descriptions, $capability));
} }
return $properties; return id(new PHUIObjectBoxView())
->setHeader($header)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($properties);
} }
private function buildActionView( private function buildActionView(