@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move Board Manage actions up a level

Summary: Moves "reorder columns" and "change background" up a level, redesigns "manage" page to be a little cleaner.

Test Plan: Change colors, reorder columns, manage page, disable board, re-enable board.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17879

authored by

Chad Little and committed by
epriestley
89e567ff a5ad11d2

+51 -88
+2 -1
src/applications/project/controller/PhabricatorProjectBoardBackgroundController.php
··· 28 28 $this->setProject($board); 29 29 $id = $board->getID(); 30 30 31 + $view_uri = $this->getApplicationURI("board/{$id}/"); 31 32 $manage_uri = $this->getApplicationURI("board/{$id}/manage/"); 32 33 33 34 if ($request->isFormPost()) { ··· 47 48 ->applyTransactions($board, $xactions); 48 49 49 50 return id(new AphrontRedirectResponse()) 50 - ->setURI($manage_uri); 51 + ->setURI($view_uri); 51 52 } 52 53 53 54 $nav = $this->getProfileMenu();
+27 -76
src/applications/project/controller/PhabricatorProjectBoardManageController.php
··· 31 31 $board_id = $board->getID(); 32 32 33 33 $header = $this->buildHeaderView($board); 34 - $actions = $this->buildActionView($board); 35 - $properties = $this->buildPropertyView($board); 36 - 37 - $properties->setActionList($actions); 38 34 39 35 $crumbs = $this->buildApplicationCrumbs(); 40 36 $crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$board_id}/"); 41 37 $crumbs->addTextCrumb(pht('Manage')); 42 - 43 - $box = id(new PHUIObjectBoxView()) 44 - ->setHeader($header) 45 - ->addPropertyList($properties); 38 + $crumbs->setBorder(true); 46 39 47 40 $nav = $this->getProfileMenu(); 41 + $columns_list = $this->buildColumnsList($board, $columns); 42 + 43 + $view = id(new PHUITwoColumnView()) 44 + ->setHeader($header) 45 + ->setFooter($columns_list); 48 46 49 47 $title = array( 50 48 pht('Manage Workboard'), 51 49 $board->getDisplayName(), 52 50 ); 53 51 54 - $columns_list = $this->buildColumnsList($board, $columns); 55 - 56 52 return $this->newPage() 57 53 ->setTitle($title) 58 54 ->setNavigation($nav) 59 55 ->setCrumbs($crumbs) 60 - ->appendChild( 61 - array( 62 - $box, 63 - $columns_list, 64 - )); 56 + ->appendChild($view); 65 57 } 66 58 67 59 private function buildHeaderView(PhabricatorProject $board) { 68 - $viewer = $this->getRequest()->getUser(); 69 - 70 - $header = id(new PHUIHeaderView()) 71 - ->setUser($viewer) 72 - ->setHeader(pht('Workboard: %s', $board->getDisplayName())); 73 - 74 - return $header; 75 - } 76 - 77 - private function buildActionView(PhabricatorProject $board) { 78 - $viewer = $this->getRequest()->getUser(); 79 - $id = $board->getID(); 80 - 81 - $actions = id(new PhabricatorActionListView()) 82 - ->setUser($viewer); 60 + $viewer = $this->getViewer(); 83 61 84 62 $can_edit = PhabricatorPolicyFilter::hasCapability( 85 63 $viewer, 86 64 $board, 87 65 PhabricatorPolicyCapability::CAN_EDIT); 88 66 89 - $reorder_uri = $this->getApplicationURI("board/{$id}/reorder/"); 90 - 91 - $actions->addAction( 92 - id(new PhabricatorActionView()) 93 - ->setIcon('fa-exchange') 94 - ->setName(pht('Reorder Columns')) 95 - ->setHref($reorder_uri) 96 - ->setDisabled(!$can_edit) 97 - ->setWorkflow(true)); 98 - 99 - $background_uri = $this->getApplicationURI("board/{$id}/background/"); 100 - 101 - $actions->addAction( 102 - id(new PhabricatorActionView()) 103 - ->setIcon('fa-paint-brush') 104 - ->setName(pht('Change Background Color')) 105 - ->setHref($background_uri) 106 - ->setDisabled(!$can_edit) 107 - ->setWorkflow(!$can_edit)); 108 - 67 + $id = $board->getID(); 109 68 $disable_uri = $this->getApplicationURI("board/{$id}/disable/"); 110 69 111 - $actions->addAction( 112 - id(new PhabricatorActionView()) 113 - ->setIcon('fa-ban') 114 - ->setName(pht('Disable Board')) 115 - ->setHref($disable_uri) 116 - ->setDisabled(!$can_edit) 117 - ->setWorkflow(true)); 70 + $button = id(new PHUIButtonView()) 71 + ->setTag('a') 72 + ->setIcon('fa-ban') 73 + ->setText(pht('Disable Board')) 74 + ->setHref($disable_uri) 75 + ->setDisabled(!$can_edit) 76 + ->setWorkflow(true); 118 77 119 - return $actions; 120 - } 121 - 122 - private function buildPropertyView( 123 - PhabricatorProject $board) { 124 - $viewer = $this->getRequest()->getUser(); 125 - 126 - $properties = id(new PHUIPropertyListView()) 78 + $header = id(new PHUIHeaderView()) 79 + ->setHeader(pht('Workboard: %s', $board->getDisplayName())) 127 80 ->setUser($viewer) 128 - ->setObject($board); 129 - 130 - $background = $board->getDisplayWorkboardBackgroundColor(); 131 - if ($background !== null) { 132 - $map = PhabricatorProjectWorkboardBackgroundColor::getOptions(); 133 - $map = ipull($map, 'name'); 134 - 135 - $name = idx($map, $background, $background); 136 - $properties->addProperty(pht('Background Color'), $name); 137 - } 81 + ->setPolicyObject($board) 82 + ->setProfileHeader(true) 83 + ->addActionLink($button); 138 84 139 - return $properties; 85 + return $header; 140 86 } 141 87 142 88 private function buildColumnsList( ··· 165 111 166 112 if ($column->isHidden()) { 167 113 $item->setDisabled(true); 114 + $item->addAttribute(pht('Hidden')); 115 + $item->setImageIcon('fa-columns grey'); 116 + } else { 117 + $item->addAttribute(pht('Visible')); 118 + $item->setImageIcon('fa-columns'); 168 119 } 169 120 170 121 $view->addItem($item);
+2 -2
src/applications/project/controller/PhabricatorProjectBoardReorderController.php
··· 23 23 $this->setProject($project); 24 24 $project_id = $project->getID(); 25 25 26 - $manage_uri = $this->getApplicationURI("board/{$project_id}/manage/"); 26 + $view_uri = $this->getApplicationURI("board/{$project_id}/"); 27 27 $reorder_uri = $this->getApplicationURI("board/{$project_id}/reorder/"); 28 28 29 29 if ($request->isFormPost()) { 30 30 // User clicked "Done", make sure the page reloads to show the new 31 31 // column order. 32 - return id(new AphrontRedirectResponse())->setURI($manage_uri); 32 + return id(new AphrontRedirectResponse())->setURI($view_uri); 33 33 } 34 34 35 35 $columns = id(new PhabricatorProjectColumnQuery())
+20 -9
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 705 705 ->setDisabled(!$can_edit) 706 706 ->setWorkflow(true); 707 707 708 + $reorder_uri = $this->getApplicationURI("board/{$id}/reorder/"); 708 709 $manage_items[] = id(new PhabricatorActionView()) 709 - ->setIcon('fa-pencil') 710 - ->setName(pht('Manage Board')) 711 - ->setHref($manage_uri); 710 + ->setIcon('fa-exchange') 711 + ->setName(pht('Reorder Columns')) 712 + ->setHref($reorder_uri) 713 + ->setDisabled(!$can_edit) 714 + ->setWorkflow(true); 715 + 716 + $background_uri = $this->getApplicationURI("board/{$id}/background/"); 717 + $manage_items[] = id(new PhabricatorActionView()) 718 + ->setIcon('fa-paint-brush') 719 + ->setName(pht('Change Background Color')) 720 + ->setHref($background_uri) 721 + ->setDisabled(!$can_edit) 722 + ->setWorkflow(false); 712 723 713 724 if ($show_hidden) { 714 725 $hidden_uri = $this->getURIWithState() ··· 727 738 ->setName($hidden_text) 728 739 ->setHref($hidden_uri); 729 740 741 + $manage_uri = $this->getApplicationURI("board/{$id}/manage/"); 742 + $manage_items[] = id(new PhabricatorActionView()) 743 + ->setIcon('fa-gear') 744 + ->setName(pht('Manage Workboard')) 745 + ->setHref($manage_uri); 746 + 730 747 $batch_edit_uri = $request->getRequestURI(); 731 748 $batch_edit_uri->setQueryParam('batch', self::BATCH_EDIT_ALL); 732 749 $can_batch_edit = PhabricatorPolicyFilter::hasCapability( 733 750 $viewer, 734 751 PhabricatorApplication::getByClass('PhabricatorManiphestApplication'), 735 752 ManiphestBulkEditCapability::CAPABILITY); 736 - 737 - $manage_items[] = id(new PhabricatorActionView()) 738 - ->setIcon('fa-list-ul') 739 - ->setName(pht('Batch Edit Visible Tasks...')) 740 - ->setHref($batch_edit_uri) 741 - ->setDisabled(!$can_batch_edit); 742 753 743 754 $manage_menu = id(new PhabricatorActionListView()) 744 755 ->setUser($viewer);