@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.

Modernize Dashboard UI and code

Summary: Pulls everything over to two column UI and new edit pages. Removed history view and consolidated some pages.

Test Plan: New Panel, Edit Panel. New Dashboard, Edit Dashboard, View Standalone pages.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+179 -205
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '2d0339fc', 10 + 'core.pkg.css' => '5de0f7af', 11 11 'core.pkg.js' => 'e5484f37', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '7ba78475', ··· 54 54 'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4', 55 55 'rsrc/css/application/countdown/timer.css' => '96696f21', 56 56 'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a', 57 - 'rsrc/css/application/dashboard/dashboard.css' => 'eb458607', 57 + 'rsrc/css/application/dashboard/dashboard.css' => 'bc6f2127', 58 58 'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a', 59 59 'rsrc/css/application/differential/add-comment.css' => 'c47f8c40', 60 60 'rsrc/css/application/differential/changeset-view.css' => '3e3b0b76', ··· 753 753 'phabricator-content-source-view-css' => '4b8b05d4', 754 754 'phabricator-core-css' => 'd0801452', 755 755 'phabricator-countdown-css' => '96696f21', 756 - 'phabricator-dashboard-css' => 'eb458607', 756 + 'phabricator-dashboard-css' => 'bc6f2127', 757 757 'phabricator-drag-and-drop-file-upload' => '81f182b5', 758 758 'phabricator-draggable-list' => '5a13c79f', 759 759 'phabricator-fatal-config-template-css' => '8e6c6fcd',
-2
src/__phutil_library_map__.php
··· 2183 2183 'PhabricatorDashboardDashboardHasPanelEdgeType' => 'applications/dashboard/edge/PhabricatorDashboardDashboardHasPanelEdgeType.php', 2184 2184 'PhabricatorDashboardDashboardPHIDType' => 'applications/dashboard/phid/PhabricatorDashboardDashboardPHIDType.php', 2185 2185 'PhabricatorDashboardEditController' => 'applications/dashboard/controller/PhabricatorDashboardEditController.php', 2186 - 'PhabricatorDashboardHistoryController' => 'applications/dashboard/controller/PhabricatorDashboardHistoryController.php', 2187 2186 'PhabricatorDashboardInstall' => 'applications/dashboard/storage/PhabricatorDashboardInstall.php', 2188 2187 'PhabricatorDashboardInstallController' => 'applications/dashboard/controller/PhabricatorDashboardInstallController.php', 2189 2188 'PhabricatorDashboardLayoutConfig' => 'applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php', ··· 6604 6603 'PhabricatorDashboardDashboardHasPanelEdgeType' => 'PhabricatorEdgeType', 6605 6604 'PhabricatorDashboardDashboardPHIDType' => 'PhabricatorPHIDType', 6606 6605 'PhabricatorDashboardEditController' => 'PhabricatorDashboardController', 6607 - 'PhabricatorDashboardHistoryController' => 'PhabricatorDashboardController', 6608 6606 'PhabricatorDashboardInstall' => 'PhabricatorDashboardDAO', 6609 6607 'PhabricatorDashboardInstallController' => 'PhabricatorDashboardController', 6610 6608 'PhabricatorDashboardLayoutConfig' => 'Phobject',
-1
src/applications/dashboard/application/PhabricatorDashboardApplication.php
··· 27 27 'view/(?P<id>\d+)/' => 'PhabricatorDashboardViewController', 28 28 'archive/(?P<id>\d+)/' => 'PhabricatorDashboardArchiveController', 29 29 'manage/(?P<id>\d+)/' => 'PhabricatorDashboardManageController', 30 - 'history/(?P<id>\d+)/' => 'PhabricatorDashboardHistoryController', 31 30 'create/' => 'PhabricatorDashboardEditController', 32 31 'copy/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardCopyController', 33 32 'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardEditController',
+27 -20
src/applications/dashboard/controller/PhabricatorDashboardEditController.php
··· 49 49 50 50 if ($is_new) { 51 51 $title = pht('Create Dashboard'); 52 - $header = pht('Create Dashboard'); 52 + $header_icon = 'fa-plus-square'; 53 53 $button = pht('Create Dashboard'); 54 54 $cancel_uri = $this->getApplicationURI(); 55 55 ··· 58 58 $id = $dashboard->getID(); 59 59 $cancel_uri = $this->getApplicationURI('manage/'.$id.'/'); 60 60 61 - $title = pht('Edit Dashboard %d', $dashboard->getID()); 62 - $header = pht('Edit Dashboard "%s"', $dashboard->getName()); 61 + $title = pht('Edit Dashboard: %s', $dashboard->getName()); 62 + $header_icon = 'fa-pencil'; 63 63 $button = pht('Save Changes'); 64 64 65 - $crumbs->addTextCrumb(pht('Dashboard %d', $id), $cancel_uri); 65 + $crumbs->addTextCrumb($dashboard->getName(), $cancel_uri); 66 66 $crumbs->addTextCrumb(pht('Edit')); 67 67 } 68 68 ··· 141 141 ->setValue($v_name) 142 142 ->setError($e_name)) 143 143 ->appendChild( 144 + id(new AphrontFormSelectControl()) 145 + ->setLabel(pht('Layout Mode')) 146 + ->setName('layout_mode') 147 + ->setValue($v_layout_mode) 148 + ->setOptions($layout_mode_options)) 149 + ->appendChild( 144 150 id(new AphrontFormPolicyControl()) 145 151 ->setName('viewPolicy') 146 152 ->setPolicyObject($dashboard) ··· 151 157 ->setName('editPolicy') 152 158 ->setPolicyObject($dashboard) 153 159 ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) 154 - ->setPolicies($policies)) 155 - ->appendChild( 156 - id(new AphrontFormSelectControl()) 157 - ->setLabel(pht('Layout Mode')) 158 - ->setName('layout_mode') 159 - ->setValue($v_layout_mode) 160 - ->setOptions($layout_mode_options)); 160 + ->setPolicies($policies)); 161 161 162 162 $form->appendControl( 163 163 id(new AphrontFormTokenizerControl()) ··· 172 172 ->addCancelButton($cancel_uri)); 173 173 174 174 $box = id(new PHUIObjectBoxView()) 175 - ->setHeaderText($header) 175 + ->setHeaderText(pht('Dashboard')) 176 176 ->setForm($form) 177 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 177 178 ->setValidationException($validation_exception); 178 179 179 - return $this->buildApplicationPage( 180 - array( 181 - $crumbs, 182 - $box, 183 - ), 184 - array( 185 - 'title' => $title, 186 - )); 180 + $crumbs->setBorder(true); 181 + 182 + $header = id(new PHUIHeaderView()) 183 + ->setHeader($title) 184 + ->setHeaderIcon($header_icon); 185 + 186 + $view = id(new PHUITwoColumnView()) 187 + ->setHeader($header) 188 + ->setFooter($box); 189 + 190 + return $this->newPage() 191 + ->setTitle($title) 192 + ->setCrumbs($crumbs) 193 + ->appendChild($view); 187 194 } 188 195 189 196 private function processTemplateRequest(AphrontRequest $request) {
-48
src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
··· 1 - <?php 2 - 3 - final class PhabricatorDashboardHistoryController 4 - extends PhabricatorDashboardController { 5 - 6 - public function handleRequest(AphrontRequest $request) { 7 - $viewer = $request->getViewer(); 8 - $id = $request->getURIData('id'); 9 - 10 - $dashboard_view_uri = $this->getApplicationURI('view/'.$id.'/'); 11 - $dashboard_manage_uri = $this->getApplicationURI('manage/'.$id.'/'); 12 - 13 - $dashboard = id(new PhabricatorDashboardQuery()) 14 - ->setViewer($viewer) 15 - ->withIDs(array($id)) 16 - ->executeOne(); 17 - if (!$dashboard) { 18 - return new Aphront404Response(); 19 - } 20 - 21 - $title = $dashboard->getName(); 22 - 23 - $crumbs = $this->buildApplicationCrumbs(); 24 - $crumbs->setBorder(true); 25 - $crumbs->addTextCrumb( 26 - pht('Dashboard %d', $dashboard->getID()), 27 - $dashboard_view_uri); 28 - $crumbs->addTextCrumb( 29 - pht('Manage'), 30 - $dashboard_manage_uri); 31 - $crumbs->addTextCrumb(pht('History')); 32 - 33 - $timeline = $this->buildTransactionTimeline( 34 - $dashboard, 35 - new PhabricatorDashboardTransactionQuery()); 36 - $timeline->setShouldTerminate(true); 37 - 38 - return $this->buildApplicationPage( 39 - array( 40 - $crumbs, 41 - $timeline, 42 - ), 43 - array( 44 - 'title' => $title, 45 - )); 46 - } 47 - 48 - }
+54 -49
src/applications/dashboard/controller/PhabricatorDashboardManageController.php
··· 34 34 pht('Dashboard %d', $dashboard->getID()), 35 35 $dashboard_uri); 36 36 $crumbs->addTextCrumb(pht('Manage')); 37 + $crumbs->setBorder(true); 37 38 38 39 $header = $this->buildHeaderView($dashboard); 39 - $actions = $this->buildActionView($dashboard); 40 + $curtain = $this->buildCurtainview($dashboard); 40 41 $properties = $this->buildPropertyView($dashboard); 41 42 42 - $properties->setActionList($actions); 43 - $box = id(new PHUIObjectBoxView()) 44 - ->setHeader($header) 45 - ->addPropertyList($properties); 43 + $timeline = $this->buildTransactionTimeline( 44 + $dashboard, 45 + new PhabricatorDashboardTransactionQuery()); 46 46 47 + $info_view = null; 47 48 if (!$can_edit) { 48 49 $no_edit = pht( 49 50 'You do not have permission to edit this dashboard. If you want to '. 50 51 'make changes, make a copy first.'); 51 52 52 - $box->setInfoView( 53 - id(new PHUIInfoView()) 54 - ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) 55 - ->setErrors(array($no_edit))); 53 + $info_view = id(new PHUIInfoView()) 54 + ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) 55 + ->setErrors(array($no_edit)); 56 56 } 57 57 58 58 $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine()) ··· 61 61 ->setArrangeMode($can_edit) 62 62 ->renderDashboard(); 63 63 64 - return $this->buildApplicationPage( 65 - array( 66 - $crumbs, 67 - $box, 68 - $rendered_dashboard, 69 - ), 70 - array( 71 - 'title' => $title, 72 - )); 64 + $dashboard_box = id(new PHUIBoxView()) 65 + ->addClass('dashboard-preview-box') 66 + ->appendChild($rendered_dashboard); 67 + 68 + $view = id(new PHUITwoColumnView()) 69 + ->setHeader($header) 70 + ->setCurtain($curtain) 71 + ->setMainColumn(array( 72 + $info_view, 73 + $properties, 74 + $timeline, 75 + )) 76 + ->setFooter($dashboard_box); 77 + 78 + return $this->newPage() 79 + ->setTitle($title) 80 + ->setCrumbs($crumbs) 81 + ->appendChild($view); 82 + 73 83 } 74 84 75 85 private function buildHeaderView(PhabricatorDashboard $dashboard) { 76 - $viewer = $this->getRequest()->getUser(); 86 + $viewer = $this->getViewer(); 87 + $id = $dashboard->getID(); 77 88 78 89 if ($dashboard->isArchived()) { 79 90 $status_icon = 'fa-ban'; ··· 87 98 PhabricatorDashboard::getStatusNameMap(), 88 99 $dashboard->getStatus()); 89 100 101 + $button = id(new PHUIButtonView()) 102 + ->setTag('a') 103 + ->setText(pht('View Dashboard')) 104 + ->setIcon('fa-columns') 105 + ->setHref($this->getApplicationURI("view/{$id}/")); 106 + 90 107 return id(new PHUIHeaderView()) 91 108 ->setUser($viewer) 92 109 ->setHeader($dashboard->getName()) 93 110 ->setPolicyObject($dashboard) 94 - ->setStatus($status_icon, $status_color, $status_name); 111 + ->setStatus($status_icon, $status_color, $status_name) 112 + ->setHeaderIcon('fa-dashboard') 113 + ->addActionLink($button); 95 114 } 96 115 97 - private function buildActionView(PhabricatorDashboard $dashboard) { 98 - $viewer = $this->getRequest()->getUser(); 116 + private function buildCurtainView(PhabricatorDashboard $dashboard) { 117 + $viewer = $this->getViewer(); 99 118 $id = $dashboard->getID(); 100 119 101 - $actions = id(new PhabricatorActionListView()) 102 - ->setObject($dashboard) 103 - ->setUser($viewer); 120 + $curtain = $this->newCurtainView($dashboard); 104 121 105 122 $can_edit = PhabricatorPolicyFilter::hasCapability( 106 123 $viewer, 107 124 $dashboard, 108 125 PhabricatorPolicyCapability::CAN_EDIT); 109 126 110 - $actions->addAction( 111 - id(new PhabricatorActionView()) 112 - ->setName(pht('View Dashboard')) 113 - ->setIcon('fa-columns') 114 - ->setHref($this->getApplicationURI("view/{$id}/"))); 115 - 116 - $actions->addAction( 127 + $curtain->addAction( 117 128 id(new PhabricatorActionView()) 118 129 ->setName(pht('Edit Dashboard')) 119 130 ->setIcon('fa-pencil') ··· 121 132 ->setDisabled(!$can_edit)); 122 133 123 134 if ($dashboard->isArchived()) { 124 - $actions->addAction( 135 + $curtain->addAction( 125 136 id(new PhabricatorActionView()) 126 137 ->setName(pht('Activate Dashboard')) 127 138 ->setIcon('fa-check') ··· 129 140 ->setDisabled(!$can_edit) 130 141 ->setWorkflow($can_edit)); 131 142 } else { 132 - $actions->addAction( 143 + $curtain->addAction( 133 144 id(new PhabricatorActionView()) 134 145 ->setName(pht('Archive Dashboard')) 135 146 ->setIcon('fa-ban') ··· 138 149 ->setWorkflow($can_edit)); 139 150 } 140 151 141 - $actions->addAction( 152 + $curtain->addAction( 142 153 id(new PhabricatorActionView()) 143 154 ->setName(pht('Copy Dashboard')) 144 155 ->setIcon('fa-files-o') ··· 158 169 $title_install = pht('Install Dashboard'); 159 170 $href_install = "install/{$id}/"; 160 171 } 161 - $actions->addAction( 172 + $curtain->addAction( 162 173 id(new PhabricatorActionView()) 163 174 ->setName($title_install) 164 175 ->setIcon('fa-wrench') 165 176 ->setHref($this->getApplicationURI($href_install)) 166 177 ->setWorkflow(true)); 167 178 168 - $actions->addAction( 169 - id(new PhabricatorActionView()) 170 - ->setName(pht('View History')) 171 - ->setIcon('fa-history') 172 - ->setHref($this->getApplicationURI("history/{$id}/"))); 173 - 174 - return $actions; 179 + return $curtain; 175 180 } 176 181 177 182 private function buildPropertyView(PhabricatorDashboard $dashboard) { 178 - $viewer = $this->getRequest()->getUser(); 183 + $viewer = $this->getViewer(); 179 184 180 185 $properties = id(new PHUIPropertyListView()) 181 - ->setUser($viewer) 182 - ->setObject($dashboard); 186 + ->setUser($viewer); 183 187 184 188 $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( 185 189 $viewer, ··· 193 197 pht('Panels'), 194 198 $viewer->renderHandleList($dashboard->getPanelPHIDs())); 195 199 196 - $properties->invokeWillRenderEvent(); 197 - 198 - return $properties; 200 + return id(new PHUIObjectBoxView()) 201 + ->setHeaderText(pht('DETAILS')) 202 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 203 + ->addPropertyList($properties); 199 204 } 200 205 201 206 }
+36 -23
src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
··· 90 90 } 91 91 92 92 if ($is_create) { 93 - $title = pht('New Panel'); 94 - $header = pht('Create New Panel'); 93 + $title = pht('Create New Panel'); 95 94 $button = pht('Create Panel'); 95 + $header_icon = 'fa-plus-square'; 96 96 if ($dashboard) { 97 97 $cancel_uri = $manage_uri; 98 98 } else { 99 99 $cancel_uri = $this->getApplicationURI('panel/'); 100 100 } 101 101 } else { 102 - $title = pht('Edit %s', $panel->getMonogram()); 103 - $header = pht('Edit %s %s', $panel->getMonogram(), $panel->getName()); 102 + $title = pht('Edit Panel: %s', $panel->getName()); 104 103 $button = pht('Save Panel'); 104 + $header_icon = 'fa-pencil'; 105 105 if ($dashboard) { 106 106 $cancel_uri = $manage_uri; 107 107 } else { ··· 260 260 '/'.$panel->getMonogram()); 261 261 $crumbs->addTextCrumb(pht('Edit')); 262 262 } 263 + $crumbs->setBorder(true); 263 264 264 265 if ($request->isAjax()) { 265 266 return $this->newDialog() 266 - ->setTitle($header) 267 + ->setTitle($title) 267 268 ->setSubmitURI($submit_uri) 268 269 ->setWidth(AphrontDialogView::WIDTH_FORM) 269 270 ->setValidationException($validation_exception) ··· 279 280 } 280 281 281 282 $box = id(new PHUIObjectBoxView()) 282 - ->setHeaderText($header) 283 + ->setHeaderText(pht('Panel')) 283 284 ->setValidationException($validation_exception) 285 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 284 286 ->setForm($form); 285 287 286 - return $this->buildApplicationPage( 287 - array( 288 - $crumbs, 289 - $box, 290 - ), 291 - array( 292 - 'title' => $title, 293 - )); 288 + $header = id(new PHUIHeaderView()) 289 + ->setHeader($title) 290 + ->setHeaderIcon($header_icon); 291 + 292 + $view = id(new PHUITwoColumnView()) 293 + ->setHeader($header) 294 + ->setFooter($box); 295 + 296 + return $this->newPage() 297 + ->setTitle($title) 298 + ->setCrumbs($crumbs) 299 + ->appendChild($view); 294 300 } 295 301 296 302 private function processPanelTypeRequest(AphrontRequest $request) { ··· 349 355 } 350 356 351 357 $title = pht('Create Dashboard Panel'); 358 + $header_icon = 'fa-plus-square'; 352 359 353 360 $crumbs = $this->buildApplicationCrumbs(); 354 361 $crumbs->addTextCrumb( 355 362 pht('Panels'), 356 363 $this->getApplicationURI('panel/')); 357 364 $crumbs->addTextCrumb(pht('New Panel')); 365 + $crumbs->setBorder(true); 358 366 359 367 $box = id(new PHUIObjectBoxView()) 360 - ->setHeaderText($title) 368 + ->setHeaderText(pht('Panel')) 361 369 ->setFormErrors($errors) 370 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 362 371 ->setForm($form); 363 372 364 - return $this->buildApplicationPage( 365 - array( 366 - $crumbs, 367 - $box, 368 - ), 369 - array( 370 - 'title' => $title, 371 - )); 373 + $header = id(new PHUIHeaderView()) 374 + ->setHeader($title) 375 + ->setHeaderIcon($header_icon); 376 + 377 + $view = id(new PHUITwoColumnView()) 378 + ->setHeader($header) 379 + ->setFooter($box); 380 + 381 + return $this->newPage() 382 + ->setTitle($title) 383 + ->setCrumbs($crumbs) 384 + ->appendChild($view); 372 385 } 373 386 374 387 private function processPanelCloneRequest(
+7 -9
src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php
··· 50 50 $crumbs = $this->buildApplicationCrumbs() 51 51 ->addTextCrumb(pht('Panels'), $this->getApplicationURI('panel/')) 52 52 ->addTextCrumb($panel->getMonogram(), '/'.$panel->getMonogram()) 53 - ->addTextCrumb(pht('Standalone View')); 53 + ->addTextCrumb(pht('Standalone View')) 54 + ->setBorder(true); 54 55 55 56 $view = id(new PHUIBoxView()) 56 57 ->addClass('dashboard-view') 57 58 ->appendChild($rendered_panel); 58 59 59 - return $this->buildApplicationPage( 60 - array( 61 - $crumbs, 62 - $view, 63 - ), 64 - array( 65 - 'title' => array(pht('Panel'), $panel->getName()), 66 - )); 60 + return $this->newPage() 61 + ->setTitle(array(pht('Panel'), $panel->getName())) 62 + ->setCrumbs($crumbs) 63 + ->appendChild($view); 64 + 67 65 } 68 66 69 67 }
+40 -40
src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
··· 25 25 pht('Panels'), 26 26 $this->getApplicationURI('panel/')); 27 27 $crumbs->addTextCrumb($panel->getMonogram()); 28 + $crumbs->setBorder(true); 28 29 29 30 $header = $this->buildHeaderView($panel); 30 - $actions = $this->buildActionView($panel); 31 + $curtain = $this->buildCurtainView($panel); 31 32 $properties = $this->buildPropertyView($panel); 33 + 32 34 $timeline = $this->buildTransactionTimeline( 33 35 $panel, 34 36 new PhabricatorDashboardPanelTransactionQuery()); 35 - $timeline->setShouldTerminate(true); 36 - 37 - $properties->setActionList($actions); 38 - $box = id(new PHUIObjectBoxView()) 39 - ->setHeader($header) 40 - ->addPropertyList($properties); 41 37 42 38 $rendered_panel = id(new PhabricatorDashboardPanelRenderingEngine()) 43 39 ->setViewer($viewer) ··· 45 41 ->setParentPanelPHIDs(array()) 46 42 ->renderPanel(); 47 43 48 - $view = id(new PHUIBoxView()) 49 - ->addMargin(PHUI::MARGIN_LARGE_LEFT) 50 - ->addMargin(PHUI::MARGIN_LARGE_RIGHT) 51 - ->addMargin(PHUI::MARGIN_LARGE_TOP) 44 + $preview = id(new PHUIBoxView()) 45 + ->addClass('dashboard-preview-box') 52 46 ->appendChild($rendered_panel); 53 47 54 - return $this->buildApplicationPage( 55 - array( 56 - $crumbs, 57 - $box, 58 - $view, 48 + $view = id(new PHUITwoColumnView()) 49 + ->setHeader($header) 50 + ->setCurtain($curtain) 51 + ->setMainColumn(array( 52 + $properties, 59 53 $timeline, 60 - ), 61 - array( 62 - 'title' => $title, 63 - )); 54 + )) 55 + ->setFooter($rendered_panel); 56 + 57 + return $this->newPage() 58 + ->setTitle($title) 59 + ->setCrumbs($crumbs) 60 + ->appendChild($view); 64 61 } 65 62 66 63 private function buildHeaderView(PhabricatorDashboardPanel $panel) { 67 - $viewer = $this->getRequest()->getUser(); 64 + $viewer = $this->getViewer(); 65 + $id = $panel->getID(); 66 + 67 + $button = id(new PHUIButtonView()) 68 + ->setTag('a') 69 + ->setText(pht('View Panel')) 70 + ->setIcon('fa-columns') 71 + ->setHref($this->getApplicationURI("panel/render/{$id}/")); 68 72 69 73 $header = id(new PHUIHeaderView()) 70 74 ->setUser($viewer) 71 75 ->setHeader($panel->getName()) 72 - ->setPolicyObject($panel); 76 + ->setPolicyObject($panel) 77 + ->setHeaderIcon('fa-columns') 78 + ->addActionLink($button); 73 79 74 80 if (!$panel->getIsArchived()) { 75 81 $header->setStatus('fa-check', 'bluegrey', pht('Active')); ··· 79 85 return $header; 80 86 } 81 87 82 - private function buildActionView(PhabricatorDashboardPanel $panel) { 83 - $viewer = $this->getRequest()->getUser(); 88 + private function buildCurtainView(PhabricatorDashboardPanel $panel) { 89 + $viewer = $this->getViewer(); 84 90 $id = $panel->getID(); 85 91 86 - $actions = id(new PhabricatorActionListView()) 87 - ->setObject($panel) 88 - ->setUser($viewer); 92 + $curtain = $this->newCurtainView($panel); 89 93 90 94 $can_edit = PhabricatorPolicyFilter::hasCapability( 91 95 $viewer, 92 96 $panel, 93 97 PhabricatorPolicyCapability::CAN_EDIT); 94 98 95 - $actions->addAction( 99 + $curtain->addAction( 96 100 id(new PhabricatorActionView()) 97 101 ->setName(pht('Edit Panel')) 98 102 ->setIcon('fa-pencil') ··· 108 112 $archive_icon = 'fa-check'; 109 113 } 110 114 111 - $actions->addAction( 115 + $curtain->addAction( 112 116 id(new PhabricatorActionView()) 113 117 ->setName($archive_text) 114 118 ->setIcon($archive_icon) ··· 116 120 ->setDisabled(!$can_edit) 117 121 ->setWorkflow(true)); 118 122 119 - $actions->addAction( 120 - id(new PhabricatorActionView()) 121 - ->setName(pht('View Standalone')) 122 - ->setIcon('fa-eye') 123 - ->setHref($this->getApplicationURI("panel/render/{$id}/"))); 124 - 125 - return $actions; 123 + return $curtain; 126 124 } 127 125 128 126 private function buildPropertyView(PhabricatorDashboardPanel $panel) { 129 - $viewer = $this->getRequest()->getUser(); 127 + $viewer = $this->getViewer(); 130 128 131 129 $properties = id(new PHUIPropertyListView()) 132 - ->setUser($viewer) 133 - ->setObject($panel); 130 + ->setUser($viewer); 134 131 135 132 $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( 136 133 $viewer, ··· 167 164 ? $viewer->renderHandleList($dashboard_phids) 168 165 : phutil_tag('em', array(), $does_not_appear)); 169 166 170 - return $properties; 167 + return id(new PHUIObjectBoxView()) 168 + ->setHeaderText(pht('DETAILS')) 169 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 170 + ->addPropertyList($properties); 171 171 } 172 172 173 173 }
+4 -8
src/applications/dashboard/controller/PhabricatorDashboardViewController.php
··· 36 36 $rendered_dashboard = $this->buildEmptyView(); 37 37 } 38 38 39 - return $this->buildApplicationPage( 40 - array( 41 - $crumbs, 42 - $rendered_dashboard, 43 - ), 44 - array( 45 - 'title' => $title, 46 - )); 39 + return $this->newPage() 40 + ->setTitle($title) 41 + ->setCrumbs($crumbs) 42 + ->appendChild($rendered_dashboard); 47 43 } 48 44 49 45 protected function buildApplicationCrumbs() {
+8 -2
webroot/rsrc/css/application/dashboard/dashboard.css
··· 55 55 .aphront-multi-column-column.dashboard-column-empty 56 56 .dashboard-panel-placeholder { 57 57 display: block; 58 - padding: 24px; 59 - margin: 16px 16px 0px 16px; 58 + padding: 20px; 59 + margin: 0 0 12px 0; 60 60 text-decoration: none; 61 61 border: 1px {$greyborder} dashed; 62 62 color: {$greytext}; ··· 73 73 .aphront-multi-column-column .phui-info-view { 74 74 margin: 0; 75 75 } 76 + 77 + .dashboard-preview-box { 78 + border: 1px solid {$lightblueborder}; 79 + border-radius: 3px; 80 + background-color: rgba(255,255,255,.33); 81 + }