@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

Footer actions for work panels.

Summary: Adds action items in the footer of workpanels.

Test Plan: UIExamples on Chrome.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

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

+50 -15
+1 -1
src/__celerity_resource_map__.php
··· 3396 3396 ), 3397 3397 'phabricator-workpanel-view-css' => 3398 3398 array( 3399 - 'uri' => '/res/96a4b5cd/rsrc/css/layout/phabricator-workpanel-view.css', 3399 + 'uri' => '/res/db76713b/rsrc/css/layout/phabricator-workpanel-view.css', 3400 3400 'type' => 'css', 3401 3401 'requires' => 3402 3402 array(
+9 -4
src/applications/uiexample/examples/PhabricatorWorkboardExample.php
··· 101 101 102 102 $panel = id(new PhabricatorWorkpanelView) 103 103 ->setCards($list) 104 - ->setHeader('Business Stuff'); 104 + ->setHeader('Business Stuff') 105 + ->setFooterAction( 106 + id(new PhabricatorMenuItemView()) 107 + ->setName(pht('Add Task')) 108 + ->setIcon('new') 109 + ->setHref('/maniphest/task/create/')); 105 110 106 111 $panel2 = id(new PhabricatorWorkpanelView) 107 112 ->setCards($list2) 108 113 ->setHeader('Under Duress'); 109 114 110 115 $panel3 = id(new PhabricatorWorkpanelView) 111 - ->setCards($list3) 112 - ->setHeader('Spicy Thai Chicken'); 116 + ->setCards($list3) 117 + ->setHeader('Spicy Thai Chicken'); 113 118 114 119 $board = id(new PhabricatorWorkboardView) 115 120 ->addPanel($panel) ··· 122 127 ->addPanel($panel) 123 128 ->addPanel($panel2) 124 129 ->addPanel($panel2) 125 - ->addPanel($panel2) 130 + ->addPanel($panel) 126 131 ->addPanel($panel2) 127 132 ->addPanel($panel3); 128 133
+16
src/view/layout/PhabricatorMenuItemView.php
··· 104 104 105 105 protected function getTagContent() { 106 106 $name = null; 107 + $icon = null; 108 + 107 109 if ($this->name) { 110 + 108 111 $external = null; 109 112 if ($this->isExternal) { 110 113 $external = " \xE2\x86\x97"; 111 114 } 115 + 116 + if ($this->icon) { 117 + require_celerity_resource('sprite-icon-css'); 118 + $icon = phutil_tag( 119 + 'span', 120 + array( 121 + 'class' => 'phabricator-menu-item-icon sprite-icon '. 122 + 'action-'.$this->icon, 123 + ), 124 + ''); 125 + } 126 + 112 127 $name = phutil_tag( 113 128 'span', 114 129 array( ··· 121 136 } 122 137 123 138 return array( 139 + $icon, 124 140 $this->renderChildren(), 125 141 $name, 126 142 );
+6 -8
src/view/layout/PhabricatorWorkpanelView.php
··· 22 22 return $this; 23 23 } 24 24 25 - public function setFooterAction($footer_action) { 25 + public function setFooterAction(PhabricatorMenuItemView $footer_action) { 26 26 $this->footerAction = $footer_action; 27 27 return $this; 28 28 } ··· 32 32 33 33 $footer = ''; 34 34 if ($this->footerAction) { 35 - $action = $this->footerAction; 36 - $footer = javelin_tag( 37 - 'a', 35 + $footer_tag = $this->footerAction; 36 + $footer = phutil_tag( 37 + 'div', 38 38 array( 39 - 'href' => $action->getHref(), 40 - 'class' => 'phabricator-workpanel-footer-action', 41 - 'sigil' => $action->getWorkflow() ? 'workflow' : null, 39 + 'class' => 'phabricator-workpanel-footer-action mst ps' 42 40 ), 43 - $action->getName()); 41 + $footer_tag); 44 42 } 45 43 46 44 $header = phutil_tag(
+18 -2
webroot/rsrc/css/layout/phabricator-workpanel-view.css
··· 63 63 box-shadow: inset 0 0px 5px rgba(0,0,0,.4); 64 64 } 65 65 66 - .phabricator-workpanel-view .phabricator-workpanel-footer { 67 - padding: 8px 5px; 66 + .phabricator-workpanel-view .phabricator-workpanel-footer-action a { 67 + color: #333; 68 + font-weight: bold; 69 + } 70 + 71 + .device-desktop .phabricator-workpanel-view .phabricator-workpanel-footer-action:hover { 72 + background-color: rgba(100,100,100,.1); 73 + } 74 + 75 + .phabricator-workpanel-view .phabricator-menu-item-icon { 76 + height: 12px; 77 + width: 12px; 78 + display: inline-block; 79 + } 80 + 81 + .phabricator-workpanel-view .phabricator-menu-item-name { 82 + padding-left: 5px; 83 + display: inline-block; 68 84 } 69 85 70 86 /* fluid/flex styles */