1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 22:31:03 +01:00

Normalize headers and actions in Project sub pages

Summary: Run through all the pages in projects and make sure they all feel similar. Adds back curtain on board manage page, even though it is sad for only having a single action.

Test Plan: Test all pages on a project for consistency in UI.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17909
This commit is contained in:
Chad Little 2017-05-16 09:53:38 -07:00
parent 8052ab84bf
commit fdf001739c
2 changed files with 26 additions and 18 deletions

View file

@ -31,6 +31,7 @@ final class PhabricatorProjectBoardManageController
$board_id = $board->getID(); $board_id = $board->getID();
$header = $this->buildHeaderView($board); $header = $this->buildHeaderView($board);
$curtain = $this->buildCurtainView($board);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$board_id}/"); $crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$board_id}/");
@ -46,7 +47,8 @@ final class PhabricatorProjectBoardManageController
->setHeader($header) ->setHeader($header)
->addClass('project-view-home') ->addClass('project-view-home')
->addClass('project-view-people-home') ->addClass('project-view-people-home')
->setFooter($columns_list); ->setCurtain($curtain)
->setMainColumn($columns_list);
$title = array( $title = array(
pht('Manage Workboard'), pht('Manage Workboard'),
@ -63,29 +65,35 @@ final class PhabricatorProjectBoardManageController
private function buildHeaderView(PhabricatorProject $board) { private function buildHeaderView(PhabricatorProject $board) {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$header = id(new PHUIHeaderView())
->setHeader(pht('Workboard: %s', $board->getDisplayName()))
->setUser($viewer);
return $header;
}
private function buildCurtainView(PhabricatorProject $board) {
$viewer = $this->getViewer();
$id = $board->getID();
$curtain = $this->newCurtainView();
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,
$board, $board,
PhabricatorPolicyCapability::CAN_EDIT); PhabricatorPolicyCapability::CAN_EDIT);
$id = $board->getID();
$disable_uri = $this->getApplicationURI("board/{$id}/disable/"); $disable_uri = $this->getApplicationURI("board/{$id}/disable/");
$button = id(new PHUIButtonView()) $curtain->addAction(
->setTag('a') id(new PhabricatorActionView())
->setIcon('fa-ban') ->setIcon('fa-ban')
->setText(pht('Disable Board')) ->setName(pht('Disable Workboard'))
->setHref($disable_uri) ->setHref($disable_uri)
->setDisabled(!$can_edit) ->setDisabled(!$can_edit)
->setWorkflow(true); ->setWorkflow(true));
$header = id(new PHUIHeaderView()) return $curtain;
->setHeader(pht('Workboard: %s', $board->getDisplayName()))
->setUser($viewer)
->setProfileHeader(true)
->addActionLink($button);
return $header;
} }
private function buildColumnsList( private function buildColumnsList(
@ -126,6 +134,7 @@ final class PhabricatorProjectBoardManageController
return id(new PHUIObjectBoxView()) return id(new PHUIObjectBoxView())
->setHeaderText(pht('Columns')) ->setHeaderText(pht('Columns'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setObjectList($view); ->setObjectList($view);
} }

View file

@ -75,8 +75,7 @@ final class PhabricatorProjectColumnDetailController
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Column: %s', $column->getDisplayName())) ->setHeader(pht('Column: %s', $column->getDisplayName()))
->setUser($viewer) ->setUser($viewer);
->setProfileHeader(true);
if ($column->isHidden()) { if ($column->isHidden()) {
$header->setStatus('fa-ban', 'dark', pht('Hidden')); $header->setStatus('fa-ban', 'dark', pht('Hidden'));