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

Simplify PHUIObjectItemList a bit

Summary: I don't think we use footicons, removing that CSS. States were added but only used in Auth, convert them to statusIcon instead.

Test Plan: Visit Auth, UIExamples, grep for `setState`

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+8 -219
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '3cea8606', 10 + 'core.pkg.css' => 'ba6d7e7a', 11 11 'core.pkg.js' => 'b562c3db', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '3fb7f532', ··· 147 147 'rsrc/css/phui/phui-info-view.css' => '28efab79', 148 148 'rsrc/css/phui/phui-list.css' => '9da2aa00', 149 149 'rsrc/css/phui/phui-object-box.css' => '6b487c57', 150 - 'rsrc/css/phui/phui-object-item-list-view.css' => '8d99e42b', 150 + 'rsrc/css/phui/phui-object-item-list-view.css' => 'aefe157c', 151 151 'rsrc/css/phui/phui-pager.css' => 'bea33d23', 152 152 'rsrc/css/phui/phui-pinboard-view.css' => '2495140e', 153 153 'rsrc/css/phui/phui-profile-menu.css' => '8a3fc181', ··· 856 856 'phui-inline-comment-view-css' => '5953c28e', 857 857 'phui-list-view-css' => '9da2aa00', 858 858 'phui-object-box-css' => '6b487c57', 859 - 'phui-object-item-list-view-css' => '8d99e42b', 859 + 'phui-object-item-list-view-css' => 'aefe157c', 860 860 'phui-pager-css' => 'bea33d23', 861 861 'phui-pinboard-view-css' => '2495140e', 862 862 'phui-profile-menu-css' => '8a3fc181',
+3 -3
src/applications/auth/controller/config/PhabricatorAuthListController.php
··· 53 53 } 54 54 55 55 if ($config->getIsEnabled()) { 56 - $item->setState(PHUIObjectItemView::STATE_SUCCESS); 56 + $item->setStatusIcon('fa-check-circle green'); 57 57 $item->addAction( 58 58 id(new PHUIListItemView()) 59 59 ->setIcon('fa-times') ··· 61 61 ->setDisabled(!$can_manage) 62 62 ->addSigil('workflow')); 63 63 } else { 64 - $item->setState(PHUIObjectItemView::STATE_FAIL); 65 - $item->addIcon('fa-times grey', pht('Disabled')); 64 + $item->setStatusIcon('fa-ban red'); 65 + $item->addIcon('fa-ban grey', pht('Disabled')); 66 66 $item->addAction( 67 67 id(new PHUIListItemView()) 68 68 ->setIcon('fa-plus')
-49
src/applications/uiexample/examples/PHUIObjectItemListExample.php
··· 340 340 341 341 $out[] = $box; 342 342 343 - $list = id(new PHUIObjectItemListView()) 344 - ->setStates(true); 345 - 346 - $list->addItem( 347 - id(new PHUIObjectItemView()) 348 - ->setObjectName('X1200') 349 - ->setHeader(pht('Action Passed')) 350 - ->addAttribute(pht('That went swimmingly, go you')) 351 - ->setHref('#') 352 - ->setState(PHUIObjectItemView::STATE_SUCCESS)); 353 - 354 - $list->addItem( 355 - id(new PHUIObjectItemView()) 356 - ->setObjectName('X1201') 357 - ->setHeader(pht('Action Failed')) 358 - ->addAttribute(pht('Whoopsies, might want to fix that')) 359 - ->setHref('#') 360 - ->setState(PHUIObjectItemView::STATE_FAIL)); 361 - 362 - $list->addItem( 363 - id(new PHUIObjectItemView()) 364 - ->setObjectName('X1202') 365 - ->setHeader(pht('Action Warning')) 366 - ->addAttribute(pht('We need to talk about things')) 367 - ->setHref('#') 368 - ->setState(PHUIObjectItemView::STATE_WARN)); 369 - 370 - $list->addItem( 371 - id(new PHUIObjectItemView()) 372 - ->setObjectName('X1203') 373 - ->setHeader(pht('Action Noted')) 374 - ->addAttribute(pht('The weather seems nice today')) 375 - ->setHref('#') 376 - ->setState(PHUIObjectItemView::STATE_NOTE)); 377 - 378 - $list->addItem( 379 - id(new PHUIObjectItemView()) 380 - ->setObjectName('X1203') 381 - ->setHeader(pht('Action In Progress')) 382 - ->addAttribute(pht('Outlook fuzzy, try again later')) 383 - ->setHref('#') 384 - ->setState(PHUIObjectItemView::STATE_BUILD)); 385 - 386 - $box = id(new PHUIObjectBoxView()) 387 - ->setHeaderText(pht('State Icons')) 388 - ->setObjectList($list); 389 - 390 - $out[] = array($box); 391 - 392 343 return $out; 393 344 } 394 345 }
-9
src/view/phui/PHUIObjectItemListView.php
··· 9 9 private $flush; 10 10 private $simple; 11 11 private $allowEmptyList; 12 - private $states; 13 12 private $itemClass = 'phui-object-item-standard'; 14 13 15 14 public function setAllowEmptyList($allow_empty_list) { ··· 51 50 return $this; 52 51 } 53 52 54 - public function setStates($states) { 55 - $this->states = $states; 56 - return $this; 57 - } 58 - 59 53 public function setItemClass($item_class) { 60 54 $this->itemClass = $item_class; 61 55 return $this; ··· 69 63 $classes = array(); 70 64 71 65 $classes[] = 'phui-object-item-list-view'; 72 - if ($this->states) { 73 - $classes[] = 'phui-object-list-states'; 74 - } 75 66 if ($this->flush) { 76 67 $classes[] = 'phui-object-list-flush'; 77 68 }
+2 -86
src/view/phui/PHUIObjectItemView.php
··· 19 19 private $headIcons = array(); 20 20 private $disabled; 21 21 private $imageURI; 22 - private $state; 23 - private $fontIcon; 24 22 private $imageIcon; 25 23 private $titleText; 26 24 private $badge; ··· 28 26 private $countdownNoun; 29 27 private $launchButton; 30 28 private $coverImage; 31 - 32 - const AGE_FRESH = 'fresh'; 33 - const AGE_STALE = 'stale'; 34 - const AGE_OLD = 'old'; 35 - 36 - const STATE_SUCCESS = 'green'; 37 - const STATE_FAIL = 'red'; 38 - const STATE_WARN = 'yellow'; 39 - const STATE_NOTE = 'blue'; 40 - const STATE_BUILD = 'sky'; 41 29 42 30 public function setDisabled($disabled) { 43 31 $this->disabled = $disabled; ··· 156 144 return $this; 157 145 } 158 146 159 - public function setState($state) { 160 - $this->state = $state; 161 - switch ($state) { 162 - case self::STATE_SUCCESS: 163 - $fi = 'fa-check-circle green'; 164 - break; 165 - case self::STATE_FAIL: 166 - $fi = 'fa-times-circle red'; 167 - break; 168 - case self::STATE_WARN: 169 - $fi = 'fa-exclamation-circle yellow'; 170 - break; 171 - case self::STATE_NOTE: 172 - $fi = 'fa-info-circle blue'; 173 - break; 174 - case self::STATE_BUILD: 175 - $fi = 'fa-refresh ph-spin sky'; 176 - break; 177 - } 178 - $this->setIcon($fi); 179 - return $this; 180 - } 181 - 182 - public function setIcon($icon) { 183 - $this->fontIcon = id(new PHUIIconView()) 184 - ->setIcon($icon); 185 - return $this; 186 - } 187 - 188 - public function setEpoch($epoch, $age = self::AGE_FRESH) { 147 + public function setEpoch($epoch) { 189 148 $date = phabricator_datetime($epoch, $this->getUser()); 190 - 191 - $days = floor((time() - $epoch) / 60 / 60 / 24); 192 - 193 - switch ($age) { 194 - case self::AGE_FRESH: 195 - $this->addIcon('none', $date); 196 - break; 197 - case self::AGE_STALE: 198 - $attr = array( 199 - 'tip' => pht('Stale (%s day(s))', new PhutilNumber($days)), 200 - 'class' => 'icon-age-stale', 201 - ); 202 - 203 - $this->addIcon('fa-clock-o yellow', $date, $attr); 204 - break; 205 - case self::AGE_OLD: 206 - $attr = array( 207 - 'tip' => pht('Old (%s day(s))', new PhutilNumber($days)), 208 - 'class' => 'icon-age-old', 209 - ); 210 - $this->addIcon('fa-clock-o red', $date, $attr); 211 - break; 212 - default: 213 - throw new Exception(pht("Unknown age '%s'!", $age)); 214 - } 215 - 149 + $this->addIcon('none', $date); 216 150 return $this; 217 151 } 218 152 ··· 309 243 $item_classes[] = 'phui-object-item-disabled'; 310 244 } 311 245 312 - if ($this->state) { 313 - $item_classes[] = 'phui-object-item-state-'.$this->state; 314 - } 315 - 316 246 switch ($this->effect) { 317 247 case 'highlighted': 318 248 $item_classes[] = 'phui-object-item-highlighted'; ··· 336 266 337 267 if ($this->getImageIcon()) { 338 268 $item_classes[] = 'phui-object-item-with-image-icon'; 339 - } 340 - 341 - if ($this->fontIcon) { 342 - $item_classes[] = 'phui-object-item-with-ficon'; 343 269 } 344 270 345 271 return array( ··· 594 520 'class' => 'phui-object-item-image-icon', 595 521 ), 596 522 $this->getImageIcon()); 597 - } 598 - 599 - $ficon = null; 600 - if ($this->fontIcon) { 601 - $image = phutil_tag( 602 - 'div', 603 - array( 604 - 'class' => 'phui-object-item-ficon', 605 - ), 606 - $this->fontIcon); 607 523 } 608 524 609 525 if ($image && $this->href) {
-69
webroot/rsrc/css/phui/phui-object-item-list-view.css
··· 487 487 } 488 488 489 489 490 - /* - Foot Icons ---------------------------------------------------------------- 491 - 492 - Object counts shown in the footer. 493 - 494 - */ 495 - 496 - .phui-object-item-foot-icons { 497 - margin-left: 10px; 498 - bottom: 0; 499 - position: absolute; 500 - } 501 - 502 - .phui-object-item-with-foot-icons .phui-object-item-content, 503 - .device-phone .phui-object-item-with-foot-icons .phui-object-item-col2 { 504 - padding-bottom: 24px; 505 - } 506 - 507 - .device-phone .phui-object-item-with-foot-icons .phui-object-item-content { 508 - padding-bottom: 0; 509 - } 510 - 511 - .phui-object-item-foot-icon { 512 - display: inline-block; 513 - background: {$lightgreyborder}; 514 - color: #ffffff; 515 - font-weight: bold; 516 - margin-right: 3px; 517 - padding: 3px 6px 0; 518 - height: 17px; 519 - vertical-align: middle; 520 - position: relative; 521 - font-size: 12px; 522 - -webkit-font-smoothing: antialiased; 523 - } 524 - 525 - .phui-object-item-foot-icon .phui-icon-view { 526 - margin-right: 4px; 527 - } 528 - 529 - 530 490 /* - Handle Icons -------------------------------------------------------------- 531 491 532 492 Shows owners, reviewers, etc., using profile picture icons. ··· 619 579 .drag-clone { 620 580 position: absolute; 621 581 list-style: none; 622 - } 623 - 624 - 625 - /* - State --------------------------------------------------------------------- 626 - 627 - Provides a list of object status or states, success or fail, etc 628 - 629 - */ 630 - 631 - .phui-object-item-ficon { 632 - width: 48px; 633 - height: 26px; 634 - margin-top: 12px; 635 - position: absolute; 636 - text-align: center; 637 - font-size: 24px; 638 - } 639 - 640 - .phui-object-item-with-ficon .phui-object-item-content-box { 641 - margin-left: 38px; 642 - } 643 - 644 - .phui-object-box .phui-object-list-states { 645 - padding: 0; 646 - } 647 - 648 - .phui-object-list-states .phui-info-view { 649 - margin: 0; 650 - border: none; 651 582 } 652 583 653 584 /* - Badges ---------------------------------------------------------------- */