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

Allow ObjectItemListView to show profile images

Summary: Ref T4400. Adds `setImageURI()` for object card/items.

Test Plan:
{F132229}

Also tested mobile.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley, chad

Maniphest Tasks: T4400

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

+73 -3
+3 -3
resources/celerity/map.php
··· 7 7 return array( 8 8 'names' => 9 9 array( 10 - 'core.pkg.css' => '4b8e980c', 10 + 'core.pkg.css' => 'b548faff', 11 11 'core.pkg.js' => '264721e1', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => 'cb97e095', ··· 141 141 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 142 142 'rsrc/css/phui/phui-list.css' => '2edb76cf', 143 143 'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec', 144 - 'rsrc/css/phui/phui-object-item-list-view.css' => '4e4e3d4c', 144 + 'rsrc/css/phui/phui-object-item-list-view.css' => 'a8131782', 145 145 'rsrc/css/phui/phui-pinboard-view.css' => '4b346c2a', 146 146 'rsrc/css/phui/phui-property-list-view.css' => 'dbf53b12', 147 147 'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', ··· 758 758 'phui-info-panel-css' => '27ea50a1', 759 759 'phui-list-view-css' => '2edb76cf', 760 760 'phui-object-box-css' => 'ce92d8ec', 761 - 'phui-object-item-list-view-css' => '4e4e3d4c', 761 + 'phui-object-item-list-view-css' => 'a8131782', 762 762 'phui-pinboard-view-css' => '4b346c2a', 763 763 'phui-property-list-view-css' => 'dbf53b12', 764 764 'phui-remarkup-preview-css' => '19ad512b',
+28
src/applications/uiexample/examples/PHUIObjectItemListExample.php
··· 332 332 333 333 $out[] = array($head, $list); 334 334 335 + 336 + $head = id(new PHUIHeaderView()) 337 + ->setHeader(pht('Images')); 338 + 339 + $list = new PHUIObjectItemListView(); 340 + 341 + $default_profile = PhabricatorFile::loadBuiltin($user, 'profile.png'); 342 + $default_project = PhabricatorFile::loadBuiltin($user, 'project.png'); 343 + 344 + $list->addItem( 345 + id(new PHUIObjectItemView()) 346 + ->setImageURI($default_profile->getViewURI()) 347 + ->setHeader(pht('Default User Profile Image')) 348 + ->setBarColor('violet') 349 + ->addAction( 350 + id(new PHUIListItemView()) 351 + ->setHref('#') 352 + ->setIcon('create'))); 353 + 354 + $list->addItem( 355 + id(new PHUIObjectItemView()) 356 + ->setImageURI($default_project->getViewURI()) 357 + ->setHeader(pht('Default Project Profile Image')) 358 + ->setGrippable(true) 359 + ->addAttribute(pht('This is the default project profile image.'))); 360 + 361 + $out[] = array($head, $list); 362 + 335 363 return $out; 336 364 } 337 365 }
+26
src/view/phui/PHUIObjectItemView.php
··· 18 18 private $actions = array(); 19 19 private $headIcons = array(); 20 20 private $disabled; 21 + private $imageURI; 21 22 22 23 const AGE_FRESH = 'fresh'; 23 24 const AGE_STALE = 'stale'; ··· 95 96 public function addByline($byline) { 96 97 $this->bylines[] = $byline; 97 98 return $this; 99 + } 100 + 101 + public function setImageURI($image_uri) { 102 + $this->imageURI = $image_uri; 103 + return $this; 104 + } 105 + 106 + public function getImageURI() { 107 + return $this->imageURI; 98 108 } 99 109 100 110 public function setEpoch($epoch, $age = self::AGE_FRESH) { ··· 241 251 $item_classes[] = 'phui-object-item-grippable'; 242 252 } 243 253 254 + if ($this->getImageuRI()) { 255 + $item_classes[] = 'phui-object-item-with-image'; 256 + } 257 + 244 258 return array( 245 259 'class' => $item_classes, 246 260 ); ··· 469 483 $foot, 470 484 )); 471 485 486 + $image = null; 487 + if ($this->getImageURI()) { 488 + $image = phutil_tag( 489 + 'div', 490 + array( 491 + 'class' => 'phui-object-item-image', 492 + 'style' => 'background-image: url('.$this->getImageURI().')', 493 + ), 494 + ''); 495 + } 496 + 472 497 $box = phutil_tag( 473 498 'div', 474 499 array( ··· 505 530 ), 506 531 array( 507 532 $actions, 533 + $image, 508 534 $box, 509 535 )); 510 536 }
+16
webroot/rsrc/css/phui/phui-object-item-list-view.css
··· 568 568 padding-left: 0; 569 569 padding-top: 0; 570 570 } 571 + 572 + .phui-object-item-image { 573 + width: 50px; 574 + height: 50px; 575 + margin: 4px 4px 4px 8px; 576 + position: absolute; 577 + background-color: {$lightbluebackground}; 578 + } 579 + 580 + .phui-object-item-with-image .phui-object-item-frame { 581 + min-height: 58px; 582 + } 583 + 584 + .phui-object-item-with-image .phui-object-item-content-box { 585 + margin-left: 58px; 586 + }