1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +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));
$box = id(new PHUIObjectBoxView())
->setHeaderText($header_text)
->setHeaderText(pht('Space'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setValidationException($validation_exception)
->appendChild($form);
@ -173,14 +174,21 @@ final class PhabricatorSpacesEditController
$cancel_uri);
}
$crumbs->addTextCrumb($title);
$crumbs->setBorder(true);
return $this->buildApplicationPage(
array(
$crumbs,
$box,
),
array(
'title' => $title,
));
$header = id(new PHUIHeaderView())
->setHeader($header_text)
->setHeaderIcon('fa-pencil');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter(array(
$box,
));
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
}
}

View file

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