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

Adds status colors to navbar tabs

Summary: Adds the abilit to set a status color of warning or fail to navbar tab lists (for objectheaders)

Test Plan: uiexamples, photoshop

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+156 -46
+46 -46
src/__celerity_resource_map__.php
··· 3796 3796 ), 3797 3797 'phui-list-view-css' => 3798 3798 array( 3799 - 'uri' => '/res/3235e888/rsrc/css/phui/phui-list.css', 3799 + 'uri' => '/res/c748be1f/rsrc/css/phui/phui-list.css', 3800 3800 'type' => 'css', 3801 3801 'requires' => 3802 3802 array( ··· 4184 4184 ), array( 4185 4185 'packages' => 4186 4186 array( 4187 - 'c98eaabf' => 4187 + 93500898 => 4188 4188 array( 4189 4189 'name' => 'core.pkg.css', 4190 4190 'symbols' => ··· 4233 4233 41 => 'phabricator-tag-view-css', 4234 4234 42 => 'phui-list-view-css', 4235 4235 ), 4236 - 'uri' => '/res/pkg/c98eaabf/core.pkg.css', 4236 + 'uri' => '/res/pkg/93500898/core.pkg.css', 4237 4237 'type' => 'css', 4238 4238 ), 4239 4239 '64eeda79' => ··· 4425 4425 ), 4426 4426 'reverse' => 4427 4427 array( 4428 - 'aphront-dialog-view-css' => 'c98eaabf', 4429 - 'aphront-error-view-css' => 'c98eaabf', 4430 - 'aphront-list-filter-view-css' => 'c98eaabf', 4431 - 'aphront-pager-view-css' => 'c98eaabf', 4432 - 'aphront-panel-view-css' => 'c98eaabf', 4433 - 'aphront-table-view-css' => 'c98eaabf', 4434 - 'aphront-tokenizer-control-css' => 'c98eaabf', 4435 - 'aphront-tooltip-css' => 'c98eaabf', 4436 - 'aphront-typeahead-control-css' => 'c98eaabf', 4428 + 'aphront-dialog-view-css' => '93500898', 4429 + 'aphront-error-view-css' => '93500898', 4430 + 'aphront-list-filter-view-css' => '93500898', 4431 + 'aphront-pager-view-css' => '93500898', 4432 + 'aphront-panel-view-css' => '93500898', 4433 + 'aphront-table-view-css' => '93500898', 4434 + 'aphront-tokenizer-control-css' => '93500898', 4435 + 'aphront-tooltip-css' => '93500898', 4436 + 'aphront-typeahead-control-css' => '93500898', 4437 4437 'differential-changeset-view-css' => '4dc2311c', 4438 4438 'differential-core-view-css' => '4dc2311c', 4439 4439 'differential-inline-comment-editor' => '5e9e5c4e', ··· 4447 4447 'differential-table-of-contents-css' => '4dc2311c', 4448 4448 'diffusion-commit-view-css' => 'c8ce2d88', 4449 4449 'diffusion-icons-css' => 'c8ce2d88', 4450 - 'global-drag-and-drop-css' => 'c98eaabf', 4450 + 'global-drag-and-drop-css' => '93500898', 4451 4451 'inline-comment-summary-css' => '4dc2311c', 4452 4452 'javelin-aphlict' => '64eeda79', 4453 4453 'javelin-behavior' => '9564fa17', ··· 4522 4522 'javelin-util' => '9564fa17', 4523 4523 'javelin-vector' => '9564fa17', 4524 4524 'javelin-workflow' => '9564fa17', 4525 - 'lightbox-attachment-css' => 'c98eaabf', 4525 + 'lightbox-attachment-css' => '93500898', 4526 4526 'maniphest-task-summary-css' => '49898640', 4527 - 'phabricator-action-list-view-css' => 'c98eaabf', 4528 - 'phabricator-application-launch-view-css' => 'c98eaabf', 4527 + 'phabricator-action-list-view-css' => '93500898', 4528 + 'phabricator-application-launch-view-css' => '93500898', 4529 4529 'phabricator-busy' => '64eeda79', 4530 4530 'phabricator-content-source-view-css' => '4dc2311c', 4531 - 'phabricator-core-css' => 'c98eaabf', 4532 - 'phabricator-crumbs-view-css' => 'c98eaabf', 4531 + 'phabricator-core-css' => '93500898', 4532 + 'phabricator-crumbs-view-css' => '93500898', 4533 4533 'phabricator-drag-and-drop-file-upload' => '5e9e5c4e', 4534 4534 'phabricator-dropdown-menu' => '64eeda79', 4535 4535 'phabricator-file-upload' => '64eeda79', 4536 - 'phabricator-filetree-view-css' => 'c98eaabf', 4537 - 'phabricator-flag-css' => 'c98eaabf', 4536 + 'phabricator-filetree-view-css' => '93500898', 4537 + 'phabricator-flag-css' => '93500898', 4538 4538 'phabricator-hovercard' => '64eeda79', 4539 - 'phabricator-jump-nav' => 'c98eaabf', 4539 + 'phabricator-jump-nav' => '93500898', 4540 4540 'phabricator-keyboard-shortcut' => '64eeda79', 4541 4541 'phabricator-keyboard-shortcut-manager' => '64eeda79', 4542 - 'phabricator-main-menu-view' => 'c98eaabf', 4542 + 'phabricator-main-menu-view' => '93500898', 4543 4543 'phabricator-menu-item' => '64eeda79', 4544 - 'phabricator-nav-view-css' => 'c98eaabf', 4544 + 'phabricator-nav-view-css' => '93500898', 4545 4545 'phabricator-notification' => '64eeda79', 4546 - 'phabricator-notification-css' => 'c98eaabf', 4547 - 'phabricator-notification-menu-css' => 'c98eaabf', 4546 + 'phabricator-notification-css' => '93500898', 4547 + 'phabricator-notification-menu-css' => '93500898', 4548 4548 'phabricator-object-selector-css' => '4dc2311c', 4549 4549 'phabricator-phtize' => '64eeda79', 4550 4550 'phabricator-prefab' => '64eeda79', 4551 4551 'phabricator-project-tag-css' => '49898640', 4552 - 'phabricator-property-list-view-css' => 'c98eaabf', 4553 - 'phabricator-remarkup-css' => 'c98eaabf', 4552 + 'phabricator-property-list-view-css' => '93500898', 4553 + 'phabricator-remarkup-css' => '93500898', 4554 4554 'phabricator-shaped-request' => '5e9e5c4e', 4555 - 'phabricator-side-menu-view-css' => 'c98eaabf', 4556 - 'phabricator-standard-page-view' => 'c98eaabf', 4557 - 'phabricator-tag-view-css' => 'c98eaabf', 4555 + 'phabricator-side-menu-view-css' => '93500898', 4556 + 'phabricator-standard-page-view' => '93500898', 4557 + 'phabricator-tag-view-css' => '93500898', 4558 4558 'phabricator-textareautils' => '64eeda79', 4559 4559 'phabricator-tooltip' => '64eeda79', 4560 - 'phabricator-transaction-view-css' => 'c98eaabf', 4561 - 'phabricator-zindex-css' => 'c98eaabf', 4562 - 'phui-button-css' => 'c98eaabf', 4563 - 'phui-form-css' => 'c98eaabf', 4564 - 'phui-form-view-css' => 'c98eaabf', 4565 - 'phui-header-view-css' => 'c98eaabf', 4566 - 'phui-icon-view-css' => 'c98eaabf', 4567 - 'phui-list-view-css' => 'c98eaabf', 4568 - 'phui-object-item-list-view-css' => 'c98eaabf', 4569 - 'phui-spacing-css' => 'c98eaabf', 4570 - 'sprite-apps-large-css' => 'c98eaabf', 4571 - 'sprite-gradient-css' => 'c98eaabf', 4572 - 'sprite-icons-css' => 'c98eaabf', 4573 - 'sprite-menu-css' => 'c98eaabf', 4574 - 'sprite-status-css' => 'c98eaabf', 4575 - 'syntax-highlighting-css' => 'c98eaabf', 4560 + 'phabricator-transaction-view-css' => '93500898', 4561 + 'phabricator-zindex-css' => '93500898', 4562 + 'phui-button-css' => '93500898', 4563 + 'phui-form-css' => '93500898', 4564 + 'phui-form-view-css' => '93500898', 4565 + 'phui-header-view-css' => '93500898', 4566 + 'phui-icon-view-css' => '93500898', 4567 + 'phui-list-view-css' => '93500898', 4568 + 'phui-object-item-list-view-css' => '93500898', 4569 + 'phui-spacing-css' => '93500898', 4570 + 'sprite-apps-large-css' => '93500898', 4571 + 'sprite-gradient-css' => '93500898', 4572 + 'sprite-icons-css' => '93500898', 4573 + 'sprite-menu-css' => '93500898', 4574 + 'sprite-status-css' => '93500898', 4575 + 'syntax-highlighting-css' => '93500898', 4576 4576 ), 4577 4577 ));
+63
src/applications/uiexample/examples/PHUIListExample.php
··· 150 150 ->setHref('#') 151 151 ->setType(PHUIListItemView::TYPE_LINK); 152 152 153 + $item1 = id(new PHUIListItemView()) 154 + ->setName('Installation') 155 + ->setHref('#') 156 + ->setSelected(true) 157 + ->setType(PHUIListItemView::TYPE_LINK); 158 + 159 + $item2 = id(new PHUIListItemView()) 160 + ->setName('Webserver Config') 161 + ->setHref('#') 162 + ->setType(PHUIListItemView::TYPE_LINK); 163 + 164 + $details1 = id(new PHUIListItemView()) 165 + ->setName('Details') 166 + ->setHref('#') 167 + ->setSelected(true) 168 + ->setType(PHUIListItemView::TYPE_LINK); 169 + 170 + $details2 = id(new PHUIListItemView()) 171 + ->setName('Lint (OK)') 172 + ->setHref('#') 173 + ->setType(PHUIListItemView::TYPE_LINK); 174 + 175 + $details3 = id(new PHUIListItemView()) 176 + ->setName('Unit (5/5)') 177 + ->setHref('#') 178 + ->setType(PHUIListItemView::TYPE_LINK); 179 + 180 + $details4 = id(new PHUIListItemView()) 181 + ->setName('Lint (Warn)') 182 + ->setHref('#') 183 + ->setStatusColor(PHUIListItemView::STATUS_WARN) 184 + ->setType(PHUIListItemView::TYPE_LINK); 185 + 186 + $details5 = id(new PHUIListItemView()) 187 + ->setName('Unit (3/5)') 188 + ->setHref('#') 189 + ->setStatusColor(PHUIListItemView::STATUS_FAIL) 190 + ->setType(PHUIListItemView::TYPE_LINK); 191 + 153 192 $topnav = id(new PHUIListView()) 154 193 ->setType(PHUIListView::NAVBAR_LIST) 155 194 ->addMenuItem($home) ··· 157 196 ->addMenuItem($item2) 158 197 ->addMenuItem($item3) 159 198 ->addMenuItem($item4); 199 + 200 + $statustabs = id(new PHUIListView()) 201 + ->setType(PHUIListView::NAVBAR_LIST) 202 + ->addMenuItem($details1) 203 + ->addMenuItem($details2) 204 + ->addMenuItem($details3) 205 + ->addMenuItem($details4) 206 + ->addMenuItem($details5); 160 207 161 208 $layout1 = 162 209 array( ··· 187 234 ->addMargin(PHUI::MARGIN_MEDIUM) 188 235 ->setShadow(true)); 189 236 237 + $layout5 = 238 + array( 239 + id(new PHUIBoxView()) 240 + ->appendChild($statustabs) 241 + ->addMargin(PHUI::MARGIN_MEDIUM) 242 + ->setShadow(true)); 243 + 190 244 $head1 = id(new PHUIHeaderView()) 191 245 ->setHeader(pht('Unstyled')); 192 246 ··· 199 253 $head4 = id(new PHUIHeaderView()) 200 254 ->setHeader(pht('Action Menu')); 201 255 256 + $head5 = id(new PHUIHeaderView()) 257 + ->setHeader(pht('Status Tabs')); 258 + 202 259 $wrap1 = id(new PHUIBoxView()) 203 260 ->appendChild($layout1) 204 261 ->addMargin(PHUI::MARGIN_LARGE); ··· 215 272 ->appendChild($layout4) 216 273 ->addMargin(PHUI::MARGIN_LARGE); 217 274 275 + $wrap5 = id(new PHUIBoxView()) 276 + ->appendChild($layout5) 277 + ->addMargin(PHUI::MARGIN_LARGE); 278 + 218 279 return phutil_tag( 219 280 'div', 220 281 array( ··· 227 288 $wrap2, 228 289 $head3, 229 290 $wrap3, 291 + $head5, 292 + $wrap5, 230 293 $head4, 231 294 $wrap4 232 295 ));
+13
src/view/phui/PHUIListItemView.php
··· 10 10 const TYPE_DIVIDER = 'type-divider'; 11 11 const TYPE_ICON = 'type-icon'; 12 12 13 + const STATUS_WARN = 'phui-list-item-warn'; 14 + const STATUS_FAIL = 'phui-list-item-fail'; 15 + 13 16 private $name; 14 17 private $href; 15 18 private $type = self::TYPE_LINK; ··· 19 22 private $selected; 20 23 private $disabled; 21 24 private $renderNameAsTooltip; 25 + private $statusColor; 22 26 23 27 public function setRenderNameAsTooltip($render_name_as_tooltip) { 24 28 $this->renderNameAsTooltip = $render_name_as_tooltip; ··· 92 96 return $this->isExternal; 93 97 } 94 98 99 + public function setStatusColor($color) { 100 + $this->statusColor = $color; 101 + return $this; 102 + } 103 + 95 104 protected function getTagName() { 96 105 return 'li'; 97 106 } ··· 107 116 108 117 if ($this->selected) { 109 118 $classes[] = 'phui-list-item-selected'; 119 + } 120 + 121 + if ($this->statusColor) { 122 + $classes[] = $this->statusColor; 110 123 } 111 124 112 125 return array(
+34
webroot/rsrc/css/phui/phui-list.css
··· 127 127 float: none; 128 128 border: none; 129 129 } 130 + 131 + /* - Status Colors ------------------------------------------------------------- 132 + 133 + Colors for navbars 134 + 135 + */ 136 + 137 + .phui-list-item-warn .phui-list-item-href { 138 + color: #bc7837; 139 + } 140 + 141 + .phui-list-item-fail .phui-list-item-href { 142 + color: {$red}; 143 + } 144 + 145 + .phui-list-item-warn.phui-list-item-selected .phui-list-item-href, 146 + .phui-list-item-warn .phui-list-item-href:hover { 147 + background: {$lightyellow}; 148 + color: #bc7837; 149 + } 150 + 151 + .phui-list-item-fail.phui-list-item-selected .phui-list-item-href, 152 + .phui-list-item-fail .phui-list-item-href:hover { 153 + background: {$lightred}; 154 + color: {$red}; 155 + } 156 + 157 + .phui-list-item-warn.phui-list-item-selected .phui-list-item-href:hover { 158 + background: #fcf0bd; 159 + } 160 + 161 + .phui-list-item-fail.phui-list-item-selected .phui-list-item-href:hover { 162 + background: #f5d3d0; 163 + }