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

Actions for Workboards.

Summary: Adds an action panel on the left side of the workboard.

Test Plan: Tested Fluid and mobile layouts

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

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

+206 -9
+44 -2
src/__celerity_resource_map__.php
··· 448 448 'disk' => '/rsrc/image/menu_texture.png', 449 449 'type' => 'png', 450 450 ), 451 + '/rsrc/image/people/harding.png' => 452 + array( 453 + 'hash' => '818b035ace2c480aa8df7b7f11cef58b', 454 + 'uri' => '/res/818b035a/rsrc/image/people/harding.png', 455 + 'disk' => '/rsrc/image/people/harding.png', 456 + 'type' => 'png', 457 + ), 458 + '/rsrc/image/people/jefferson.png' => 459 + array( 460 + 'hash' => '55fe807ff02f9320e595fb59442e2038', 461 + 'uri' => '/res/55fe807f/rsrc/image/people/jefferson.png', 462 + 'disk' => '/rsrc/image/people/jefferson.png', 463 + 'type' => 'png', 464 + ), 465 + '/rsrc/image/people/lincoln.png' => 466 + array( 467 + 'hash' => '2363337947ab52fd5fda79e4a004e930', 468 + 'uri' => '/res/23633379/rsrc/image/people/lincoln.png', 469 + 'disk' => '/rsrc/image/people/lincoln.png', 470 + 'type' => 'png', 471 + ), 472 + '/rsrc/image/people/mckinley.png' => 473 + array( 474 + 'hash' => '0b7b05dd47c49a0874670e5e8200bba8', 475 + 'uri' => '/res/0b7b05dd/rsrc/image/people/mckinley.png', 476 + 'disk' => '/rsrc/image/people/mckinley.png', 477 + 'type' => 'png', 478 + ), 479 + '/rsrc/image/people/taft.png' => 480 + array( 481 + 'hash' => 'f3e47d45b59b0b009fd536dabae9a151', 482 + 'uri' => '/res/f3e47d45/rsrc/image/people/taft.png', 483 + 'disk' => '/rsrc/image/people/taft.png', 484 + 'type' => 'png', 485 + ), 486 + '/rsrc/image/people/washington.png' => 487 + array( 488 + 'hash' => '01412761cab769f7993d69eba986d949', 489 + 'uri' => '/res/01412761/rsrc/image/people/washington.png', 490 + 'disk' => '/rsrc/image/people/washington.png', 491 + 'type' => 'png', 492 + ), 451 493 '/rsrc/image/phrequent_active.png' => 452 494 array( 453 495 'hash' => '716cddc08630eaa33934b2008723cac0', ··· 3401 3443 ), 3402 3444 'phabricator-workboard-view-css' => 3403 3445 array( 3404 - 'uri' => '/res/98971c26/rsrc/css/layout/phabricator-workboard-view.css', 3446 + 'uri' => '/res/b70667c6/rsrc/css/layout/phabricator-workboard-view.css', 3405 3447 'type' => 'css', 3406 3448 'requires' => 3407 3449 array( ··· 3410 3452 ), 3411 3453 'phabricator-workpanel-view-css' => 3412 3454 array( 3413 - 'uri' => '/res/db76713b/rsrc/css/layout/phabricator-workpanel-view.css', 3455 + 'uri' => '/res/d2eea288/rsrc/css/layout/phabricator-workpanel-view.css', 3414 3456 'type' => 'css', 3415 3457 'requires' => 3416 3458 array(
+2
src/__phutil_library_map__.php
··· 1435 1435 'PhabricatorUserStatusInvalidEpochException' => 'applications/people/exception/PhabricatorUserStatusInvalidEpochException.php', 1436 1436 'PhabricatorUserStatusOverlapException' => 'applications/people/exception/PhabricatorUserStatusOverlapException.php', 1437 1437 'PhabricatorUserTestCase' => 'applications/people/storage/__tests__/PhabricatorUserTestCase.php', 1438 + 'PhabricatorWorkboardActionView' => 'view/layout/PhabricatorWorkboardActionView.php', 1438 1439 'PhabricatorWorkboardExample' => 'applications/uiexample/examples/PhabricatorWorkboardExample.php', 1439 1440 'PhabricatorWorkboardView' => 'view/layout/PhabricatorWorkboardView.php', 1440 1441 'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php', ··· 3084 3085 'PhabricatorUserStatusInvalidEpochException' => 'Exception', 3085 3086 'PhabricatorUserStatusOverlapException' => 'Exception', 3086 3087 'PhabricatorUserTestCase' => 'PhabricatorTestCase', 3088 + 'PhabricatorWorkboardActionView' => 'AphrontView', 3087 3089 'PhabricatorWorkboardExample' => 'PhabricatorUIExample', 3088 3090 'PhabricatorWorkboardView' => 'AphrontView', 3089 3091 'PhabricatorWorkerActiveTask' => 'PhabricatorWorkerTask',
+47 -6
src/applications/uiexample/examples/PhabricatorWorkboardExample.php
··· 99 99 ->setHeader(pht('Playing Card')) 100 100 ->setBarColor('orange')); 101 101 102 - $panel = id(new PhabricatorWorkpanelView) 102 + $panel = id(new PhabricatorWorkpanelView()) 103 103 ->setCards($list) 104 104 ->setHeader('Business Stuff') 105 105 ->setFooterAction( ··· 108 108 ->setIcon('new') 109 109 ->setHref('/maniphest/task/create/')); 110 110 111 - $panel2 = id(new PhabricatorWorkpanelView) 111 + $panel2 = id(new PhabricatorWorkpanelView()) 112 112 ->setCards($list2) 113 113 ->setHeader('Under Duress'); 114 114 115 - $panel3 = id(new PhabricatorWorkpanelView) 115 + $panel3 = id(new PhabricatorWorkpanelView()) 116 116 ->setCards($list3) 117 117 ->setHeader('Spicy Thai Chicken'); 118 118 119 - $board = id(new PhabricatorWorkboardView) 119 + $board = id(new PhabricatorWorkboardView()) 120 120 ->addPanel($panel) 121 121 ->addPanel($panel2) 122 122 ->addPanel($panel2) 123 123 ->addPanel($panel3); 124 124 125 - $board2 = id(new PhabricatorWorkboardView) 125 + $board2 = id(new PhabricatorWorkboardView()) 126 126 ->setFlexLayout(true) 127 127 ->addPanel($panel) 128 128 ->addPanel($panel2) ··· 131 131 ->addPanel($panel2) 132 132 ->addPanel($panel3); 133 133 134 + $action = new PhabricatorWorkboardActionView(); 135 + $action->setHref('/maniphest/task/create'); 136 + $action->setImage('/rsrc/image/actions/edit.png'); 137 + 138 + $person1 = new PhabricatorWorkboardActionView(); 139 + $person1->setHref('http://en.wikipedia.org/wiki/George_Washington'); 140 + $person1->setImage( 141 + celerity_get_resource_uri('/rsrc/image/people/washington.png')); 142 + 143 + $person2 = new PhabricatorWorkboardActionView(); 144 + $person2->setHref('http://en.wikipedia.org/wiki/Warren_G._Harding'); 145 + $person2->setImage( 146 + celerity_get_resource_uri('/rsrc/image/people/harding.png')); 147 + 148 + $person3 = new PhabricatorWorkboardActionView(); 149 + $person3->setHref('http://en.wikipedia.org/wiki/William_Howard_Taft'); 150 + $person3->setImage( 151 + celerity_get_resource_uri('/rsrc/image/people/taft.png')); 152 + 153 + $board3 = id(new PhabricatorWorkboardView()) 154 + ->setFlexLayout(true) 155 + ->addPanel($panel) 156 + ->addPanel($panel) 157 + ->addPanel($panel2) 158 + ->addPanel($panel3) 159 + ->addAction($action) 160 + ->addAction($person1) 161 + ->addAction($person2) 162 + ->addAction($person3); 163 + 134 164 $head1 = id(new PhabricatorHeaderView()) 135 165 ->setHeader(pht('Fixed Panel')); 136 166 137 167 $head2 = id(new PhabricatorHeaderView()) 138 168 ->setHeader(pht('Fluid Panel')); 139 169 170 + $head3 = id(new PhabricatorHeaderView()) 171 + ->setHeader(pht('Action Panel')); 140 172 141 173 $wrap1 = phutil_tag( 142 174 'div', ··· 152 184 ), 153 185 $board2); 154 186 187 + $wrap3 = phutil_tag( 188 + 'div', 189 + array( 190 + 'class' => 'ml' 191 + ), 192 + $board3); 193 + 155 194 return phutil_tag( 156 195 'div', 157 196 array(), ··· 159 198 $head1, 160 199 $wrap1, 161 200 $head2, 162 - $wrap2 201 + $wrap2, 202 + $head3, 203 + $wrap3 163 204 )); 164 205 } 165 206 }
+35
src/view/layout/PhabricatorWorkboardActionView.php
··· 1 + <?php 2 + 3 + final class PhabricatorWorkboardActionView extends AphrontView { 4 + 5 + private $href; 6 + private $workflow; 7 + private $image; 8 + 9 + public function setHref($href) { 10 + $this->href = $href; 11 + return $this; 12 + } 13 + 14 + public function setWorkflow($workflow) { 15 + $this->workflow = $workflow; 16 + return $this; 17 + } 18 + 19 + public function setImage($image) { 20 + $this->image = $image; 21 + } 22 + 23 + public function render() { 24 + 25 + return phutil_tag( 26 + 'a', 27 + array( 28 + 'href' => $this->href, 29 + 'class' => 'phabricator-workboard-action-item-link', 30 + 'sigil' => $this->workflow ? 'workflow' : null, 31 + 'style' => 'background-image: url('.$this->image.');' 32 + ), 33 + ''); 34 + } 35 + }
+36 -1
src/view/layout/PhabricatorWorkboardView.php
··· 4 4 5 5 private $panels = array(); 6 6 private $flexLayout = false; 7 + private $actions = array(); 7 8 8 9 public function addPanel(PhabricatorWorkpanelView $panel) { 9 10 $this->panels[] = $panel; ··· 15 16 return $this; 16 17 } 17 18 19 + public function addAction(PhabricatorWorkboardActionView $action) { 20 + $this->actions[] = $action; 21 + return $this; 22 + } 23 + 18 24 public function render() { 19 25 require_celerity_resource('phabricator-workboard-view-css'); 20 26 ··· 25 31 throw new Exception("No more than 6 panels per workboard."); 26 32 } 27 33 34 + $action_list = null; 35 + if (!empty($this->actions)) { 36 + $items = array(); 37 + foreach ($this->actions as $action) { 38 + $items[] = phutil_tag( 39 + 'li', 40 + array( 41 + 'class' => 'phabricator-workboard-action-item' 42 + ), 43 + $action); 44 + } 45 + $action_list = phutil_tag( 46 + 'ul', 47 + array( 48 + 'class' => 'phabricator-workboard-action-list' 49 + ), 50 + $items); 51 + } 52 + 28 53 $classes[] = 'workboard-'.count($this->panels).'-up'; 29 54 30 55 $view = phutil_tag( ··· 44 69 $classes[] = 'phabricator-workboard-fixed'; 45 70 } 46 71 47 - return phutil_tag( 72 + $board = phutil_tag( 48 73 'div', 49 74 array( 50 75 'class' => implode(' ', $classes) 51 76 ), 52 77 $view); 78 + 79 + return phutil_tag( 80 + 'div', 81 + array( 82 + 'class' => 'phabricator-workboard-view' 83 + ), 84 + array( 85 + $action_list, 86 + $board 87 + )); 53 88 } 54 89 }
+41
webroot/rsrc/css/layout/phabricator-workboard-view.css
··· 2 2 * @provides phabricator-workboard-view-css 3 3 */ 4 4 5 + .phabricator-workboard-view { 6 + width: 100%; 7 + } 8 + 5 9 .phabricator-workboard-view-outer { 6 10 padding: 8px; 11 + min-height: 120px; 7 12 overflow-x: scroll; 8 13 border-radius: 5px; 9 14 background: rgba(150,150,150,.1); 10 15 box-shadow: inset 0 0 5px rgba(0,0,0,.5); 11 16 } 12 17 18 + .phabricator-workboard-action-list { 19 + width: 60px; 20 + float: left; 21 + min-height: 60px; 22 + border-top-left-radius: 5px; 23 + border-bottom-left-radius: 5px; 24 + margin-top: 40px; 25 + background: rgba(150,150,150,.2); 26 + } 27 + 13 28 .device-phone .phabricator-workboard-view-outer { 14 29 background: none; 15 30 box-shadow: none; ··· 18 33 width: 100%; 19 34 } 20 35 36 + .device-phone .phabricator-workboard-action-list { 37 + width: 100%; 38 + float: none; 39 + display: block; 40 + border-radius: 3px; 41 + margin: 0 0 5px; 42 + overflow: hidden; 43 + } 44 + 45 + .device-phone .phabricator-workboard-action-list li { 46 + display: inline; 47 + float: left; 48 + margin: 0px; 49 + } 50 + 51 + .device-phone .phabricator-workboard-action-item-link { 52 + margin-right: 0; 53 + } 54 + 21 55 /* math here is based on panel width and margins */ 22 56 .phabricator-workboard-fixed 23 57 .phabricator-workboard-view-inner.workboard-1-up { ··· 52 86 .device-phone .phabricator-workboard-fixed .phabricator-workboard-view-inner { 53 87 width: 100%; 54 88 } 89 + 90 + .phabricator-workboard-action-item-link { 91 + display: block; 92 + width: 50px; 93 + height: 50px; 94 + margin: 5px 4px 5px 5px; 95 + }
+1
webroot/rsrc/css/layout/phabricator-workpanel-view.css
··· 70 70 71 71 .device-desktop .phabricator-workpanel-view .phabricator-workpanel-footer-action:hover { 72 72 background-color: rgba(100,100,100,.1); 73 + border-radius: 3px; 73 74 } 74 75 75 76 .phabricator-workpanel-view .phabricator-menu-item-icon {
webroot/rsrc/image/people/harding.png

This is a binary file and will not be displayed.

webroot/rsrc/image/people/jefferson.png

This is a binary file and will not be displayed.

webroot/rsrc/image/people/lincoln.png

This is a binary file and will not be displayed.

webroot/rsrc/image/people/mckinley.png

This is a binary file and will not be displayed.

webroot/rsrc/image/people/taft.png

This is a binary file and will not be displayed.

webroot/rsrc/image/people/washington.png

This is a binary file and will not be displayed.