From 6fa91caf32aa80339e7ea5fef769f23f0220924a Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 14 May 2017 18:58:33 -0700 Subject: [PATCH] Clean up Project Board Manage / Column Manage pages Summary: Slightly nicer, more consistent UI. Also removed "Column History" from dropdowns as this is available on the general board manage page. Test Plan: Review Board and Column management pages. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17881 --- ...habricatorProjectBoardManageController.php | 5 +- .../PhabricatorProjectBoardViewController.php | 6 -- ...abricatorProjectColumnDetailController.php | 70 +++++++------------ .../PhabricatorProjectProfileController.php | 5 +- 4 files changed, 30 insertions(+), 56 deletions(-) diff --git a/src/applications/project/controller/PhabricatorProjectBoardManageController.php b/src/applications/project/controller/PhabricatorProjectBoardManageController.php index aecb5aa42a..4607b50c2a 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardManageController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardManageController.php @@ -40,8 +40,12 @@ final class PhabricatorProjectBoardManageController $nav = $this->getProfileMenu(); $columns_list = $this->buildColumnsList($board, $columns); + require_celerity_resource('project-view-css'); + $view = id(new PHUITwoColumnView()) ->setHeader($header) + ->addClass('project-view-home') + ->addClass('project-view-people-home') ->setFooter($columns_list); $title = array( @@ -78,7 +82,6 @@ final class PhabricatorProjectBoardManageController $header = id(new PHUIHeaderView()) ->setHeader(pht('Workboard: %s', $board->getDisplayName())) ->setUser($viewer) - ->setPolicyObject($board) ->setProfileHeader(true) ->addActionLink($button); diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 6a7083b10d..da1f0ccb95 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -879,12 +879,6 @@ final class PhabricatorProjectBoardViewController ->setWorkflow(true); } - $details_uri = 'board/'.$this->id.'/column/'.$column->getID().'/'; - $column_items[] = id(new PhabricatorActionView()) - ->setName(pht('Column History')) - ->setIcon('fa-columns') - ->setHref($this->getApplicationURI($details_uri)); - $column_menu = id(new PhabricatorActionListView()) ->setUser($viewer); foreach ($column_items as $item) { diff --git a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php index d922d24714..56eb16613f 100644 --- a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php +++ b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php @@ -44,36 +44,39 @@ final class PhabricatorProjectColumnDetailController $title = $column->getDisplayName(); $header = $this->buildHeaderView($column); - $actions = $this->buildActionView($column); - $properties = $this->buildPropertyView($column, $actions); + $properties = $this->buildPropertyView($column); $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$project_id}/"); $crumbs->addTextCrumb(pht('Column: %s', $title)); - - $box = id(new PHUIObjectBoxView()) - ->setHeader($header) - ->addPropertyList($properties); + $crumbs->setBorder(true); $nav = $this->getProfileMenu(); + require_celerity_resource('project-view-css'); + + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->addClass('project-view-home') + ->addClass('project-view-people-home') + ->setMainColumn(array( + $properties, + $timeline, + )); return $this->newPage() ->setTitle($title) ->setNavigation($nav) ->setCrumbs($crumbs) - ->appendChild( - array( - $box, - $timeline, - )); + ->appendChild($view); } private function buildHeaderView(PhabricatorProjectColumn $column) { - $viewer = $this->getRequest()->getUser(); + $viewer = $this->getViewer(); $header = id(new PHUIHeaderView()) + ->setHeader(pht('Column: %s', $column->getDisplayName())) ->setUser($viewer) - ->setHeader($column->getDisplayName()); + ->setProfileHeader(true); if ($column->isHidden()) { $header->setStatus('fa-ban', 'dark', pht('Hidden')); @@ -82,41 +85,13 @@ final class PhabricatorProjectColumnDetailController return $header; } - private function buildActionView(PhabricatorProjectColumn $column) { - $viewer = $this->getRequest()->getUser(); - - $id = $column->getID(); - $project_id = $this->getProject()->getID(); - $base_uri = '/board/'.$project_id.'/'; - - $actions = id(new PhabricatorActionListView()) - ->setUser($viewer); - - $can_edit = PhabricatorPolicyFilter::hasCapability( - $viewer, - $column, - PhabricatorPolicyCapability::CAN_EDIT); - - $actions->addAction( - id(new PhabricatorActionView()) - ->setName(pht('Edit Column')) - ->setIcon('fa-pencil') - ->setHref($this->getApplicationURI($base_uri.'edit/'.$id.'/')) - ->setDisabled(!$can_edit) - ->setWorkflow(true)); - - return $actions; - } - private function buildPropertyView( - PhabricatorProjectColumn $column, - PhabricatorActionListView $actions) { - $viewer = $this->getRequest()->getUser(); + PhabricatorProjectColumn $column) { + $viewer = $this->getViewer(); $properties = id(new PHUIPropertyListView()) ->setUser($viewer) - ->setObject($column) - ->setActionList($actions); + ->setObject($column); $limit = $column->getPointLimit(); if ($limit === null) { @@ -126,7 +101,12 @@ final class PhabricatorProjectColumnDetailController } $properties->addProperty(pht('Point Limit'), $limit_text); - return $properties; + $box = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Details')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) + ->appendChild($properties); + + return $box; } } diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index 60254ddcca..e5ae78fd20 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -113,10 +113,7 @@ final class PhabricatorProjectProfileController ->setCrumbs($crumbs) ->setTitle($project->getDisplayName()) ->setPageObjectPHIDs(array($project->getPHID())) - ->appendChild( - array( - $home, - )); + ->appendChild($home); } private function buildPropertyListView(