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

Convert Spaces to two column

Summary: Updates Spaces to new two column layout

Test Plan: Create a space, edit a space

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15503
This commit is contained in:
Chad Little 2016-03-21 12:56:53 -07:00
parent 66946c0996
commit 7736868996
2 changed files with 43 additions and 29 deletions

View file

@ -162,7 +162,8 @@ final class PhabricatorSpacesEditController
->addCancelButton($cancel_uri)); ->addCancelButton($cancel_uri));
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText($header_text) ->setHeaderText(pht('Space'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setValidationException($validation_exception) ->setValidationException($validation_exception)
->appendChild($form); ->appendChild($form);
@ -173,14 +174,21 @@ final class PhabricatorSpacesEditController
$cancel_uri); $cancel_uri);
} }
$crumbs->addTextCrumb($title); $crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
return $this->buildApplicationPage( $header = id(new PHUIHeaderView())
array( ->setHeader($header_text)
$crumbs, ->setHeaderIcon('fa-pencil');
$box,
), $view = id(new PHUITwoColumnView())
array( ->setHeader($header)
'title' => $title, ->setFooter(array(
)); $box,
));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
} }
} }

View file

@ -18,9 +18,9 @@ final class PhabricatorSpacesViewController
return new Aphront404Response(); return new Aphront404Response();
} }
$action_list = $this->buildActionListView($space); $curtain = $this->buildCurtain($space);
$property_list = $this->buildPropertyListView($space); $property_list = $this->buildPropertyListView($space);
$property_list->setActionList($action_list); $title = array($space->getMonogram(), $space->getNamespaceName());
$xactions = id(new PhabricatorSpacesNamespaceTransactionQuery()) $xactions = id(new PhabricatorSpacesNamespaceTransactionQuery())
->setViewer($viewer) ->setViewer($viewer)
@ -35,7 +35,8 @@ final class PhabricatorSpacesViewController
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setUser($viewer) ->setUser($viewer)
->setHeader($space->getNamespaceName()) ->setHeader($space->getNamespaceName())
->setPolicyObject($space); ->setPolicyObject($space)
->setHeaderIcon('fa-th-large');
if ($space->getIsArchived()) { if ($space->getIsArchived()) {
$header->setStatus('fa-ban', 'red', pht('Archived')); $header->setStatus('fa-ban', 'red', pht('Archived'));
@ -44,21 +45,27 @@ final class PhabricatorSpacesViewController
} }
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeader($header) ->setHeaderText(pht('DETAILS'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->addPropertyList($property_list); ->addPropertyList($property_list);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($space->getMonogram()); $crumbs->addTextCrumb($space->getMonogram());
$crumbs->setBorder(true);
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setMainColumn(array(
$box,
$timeline,
))
->setCurtain($curtain);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
return $this->buildApplicationPage(
array(
$crumbs,
$box,
$timeline,
),
array(
'title' => array($space->getMonogram(), $space->getNamespaceName()),
));
} }
private function buildPropertyListView(PhabricatorSpacesNamespace $space) { private function buildPropertyListView(PhabricatorSpacesNamespace $space) {
@ -93,18 +100,17 @@ final class PhabricatorSpacesViewController
return $list; return $list;
} }
private function buildActionListView(PhabricatorSpacesNamespace $space) { private function buildCurtain(PhabricatorSpacesNamespace $space) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$list = id(new PhabricatorActionListView()) $curtain = $this->newCurtainView($space);
->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,
$space, $space,
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
$list->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Edit Space')) ->setName(pht('Edit Space'))
->setIcon('fa-pencil') ->setIcon('fa-pencil')
@ -115,7 +121,7 @@ final class PhabricatorSpacesViewController
$id = $space->getID(); $id = $space->getID();
if ($space->getIsArchived()) { if ($space->getIsArchived()) {
$list->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Activate Space')) ->setName(pht('Activate Space'))
->setIcon('fa-check') ->setIcon('fa-check')
@ -123,7 +129,7 @@ final class PhabricatorSpacesViewController
->setDisabled(!$can_edit) ->setDisabled(!$can_edit)
->setWorkflow(true)); ->setWorkflow(true));
} else { } else {
$list->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Archive Space')) ->setName(pht('Archive Space'))
->setIcon('fa-ban') ->setIcon('fa-ban')
@ -132,7 +138,7 @@ final class PhabricatorSpacesViewController
->setWorkflow(true)); ->setWorkflow(true));
} }
return $list; return $curtain;
} }
} }