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

Add a description/toggle to PHUIObjectItemView

Summary: Gives the ability to hide a big long block of text in an ObjectListItem without cluttering the UI.

Test Plan:
Added a test case to UIExamples. Click on icon, see content. Click again, content go away.

{F4974153}

{F4974311}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+82 -6
+5 -5
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => 'ff161f2d', 11 11 'conpherence.pkg.js' => 'b5b51108', 12 - 'core.pkg.css' => '5387f8b6', 12 + 'core.pkg.css' => '71865bdf', 13 13 'core.pkg.js' => '599698a7', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '7d4cfa59', ··· 71 71 'rsrc/css/application/differential/revision-history.css' => '0e8eb855', 72 72 'rsrc/css/application/differential/revision-list.css' => 'f3c47d33', 73 73 'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55', 74 - 'rsrc/css/application/diffusion/diffusion-history.css' => 'b4ac65b3', 74 + 'rsrc/css/application/diffusion/diffusion-history.css' => '0c596546', 75 75 'rsrc/css/application/diffusion/diffusion-icons.css' => 'a6a1e2ba', 76 76 'rsrc/css/application/diffusion/diffusion-readme.css' => '18bd3910', 77 77 'rsrc/css/application/diffusion/diffusion-source.css' => '750add59', ··· 132 132 'rsrc/css/phui/object-item/phui-oi-color.css' => 'cd2b9b77', 133 133 'rsrc/css/phui/object-item/phui-oi-drag-ui.css' => '08f4ccc3', 134 134 'rsrc/css/phui/object-item/phui-oi-flush-ui.css' => '9d9685d6', 135 - 'rsrc/css/phui/object-item/phui-oi-list-view.css' => '412bef1a', 135 + 'rsrc/css/phui/object-item/phui-oi-list-view.css' => '78fdc98e', 136 136 'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => 'a8beebea', 137 137 'rsrc/css/phui/phui-action-list.css' => 'c01858f4', 138 138 'rsrc/css/phui/phui-action-panel.css' => '91c7b835', ··· 575 575 'differential-revision-history-css' => '0e8eb855', 576 576 'differential-revision-list-css' => 'f3c47d33', 577 577 'differential-table-of-contents-css' => 'ae4b7a55', 578 - 'diffusion-history-css' => 'b4ac65b3', 578 + 'diffusion-history-css' => '0c596546', 579 579 'diffusion-icons-css' => 'a6a1e2ba', 580 580 'diffusion-readme-css' => '18bd3910', 581 581 'diffusion-source-css' => '750add59', ··· 875 875 'phui-oi-color-css' => 'cd2b9b77', 876 876 'phui-oi-drag-ui-css' => '08f4ccc3', 877 877 'phui-oi-flush-ui-css' => '9d9685d6', 878 - 'phui-oi-list-view-css' => '412bef1a', 878 + 'phui-oi-list-view-css' => '78fdc98e', 879 879 'phui-oi-simple-ui-css' => 'a8beebea', 880 880 'phui-pager-css' => '77d8a794', 881 881 'phui-pinboard-view-css' => '2495140e',
+9
src/applications/diffusion/view/DiffusionHistoryListView.php
··· 102 102 $commit_desc = $this->getCommitDescription($commit_phid); 103 103 $committed = phabricator_datetime($commit->getEpoch(), $viewer); 104 104 105 + $engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine(); 106 + $engine->setConfig('viewer', $viewer); 107 + $commit_data = $commit->getCommitData(); 108 + $message = $commit_data->getCommitMessage(); 109 + $message = $engine->markupText($message); 110 + $message = phutil_tag_div( 111 + 'diffusion-history-message phabricator-remarkup', $message); 112 + 105 113 $author_phid = $commit->getAuthorPHID(); 106 114 if ($author_phid) { 107 115 $author_name = $handles[$author_phid]->renderLink(); ··· 122 130 ->setHeader($commit_desc) 123 131 ->setHref($commit_link) 124 132 ->setDisabled($commit->isUnreachable()) 133 + ->setDescription($message) 125 134 ->setImageURI($author_image_uri) 126 135 ->addByline(pht('Author: %s', $author_name)) 127 136 ->addIcon('none', $committed)
+1 -1
src/applications/uiexample/examples/PHUIObjectItemListExample.php
··· 202 202 $list->addItem( 203 203 id(new PHUIObjectItemView()) 204 204 ->setHeader(pht('Ace of Hearts')) 205 - ->setSubHead( 205 + ->setDescription( 206 206 pht('This is a powerful card in the game "Hearts".')) 207 207 ->setHref('#') 208 208 ->addAttribute(pht('Suit: Hearts'))
+34
src/view/phui/PHUIObjectItemView.php
··· 26 26 private $countdownNoun; 27 27 private $launchButton; 28 28 private $coverImage; 29 + private $description; 29 30 30 31 public function setDisabled($disabled) { 31 32 $this->disabled = $disabled; ··· 145 146 146 147 public function setCoverImage($image) { 147 148 $this->coverImage = $image; 149 + return $this; 150 + } 151 + 152 + public function setDescription($description) { 153 + $this->description = $description; 148 154 return $this; 149 155 } 150 156 ··· 334 340 ), 335 341 $this->header); 336 342 343 + $description_tag = null; 344 + if ($this->description) { 345 + $decription_id = celerity_generate_unique_node_id(); 346 + $description_tag = id(new PHUITagView()) 347 + ->setIcon('fa-ellipsis-h') 348 + ->addClass('phui-oi-description-tag') 349 + ->setType(PHUITagView::TYPE_SHADE) 350 + ->setColor(PHUITagView::COLOR_GREY) 351 + ->addSigil('jx-toggle-class') 352 + ->setSlimShady(true) 353 + ->setMetaData(array( 354 + 'map' => array( 355 + $decription_id => 'phui-oi-description-reveal', 356 + ), 357 + )); 358 + } 359 + 337 360 // Wrap the header content in a <span> with the "slippery" sigil. This 338 361 // prevents us from beginning a drag if you click the text (like "T123"), 339 362 // but not if you click the white space after the header. ··· 351 374 $this->headIcons, 352 375 $header_name, 353 376 $header_link, 377 + $description_tag, 354 378 ))); 355 379 356 380 $icons = array(); ··· 451 475 'class' => 'phui-oi-subhead', 452 476 ), 453 477 $this->subhead); 478 + } 479 + 480 + if ($this->description) { 481 + $subhead = phutil_tag( 482 + 'div', 483 + array( 484 + 'class' => 'phui-oi-subhead phui-oi-description', 485 + 'id' => $decription_id, 486 + ), 487 + $this->description); 454 488 } 455 489 456 490 if ($icons) {
+8
webroot/rsrc/css/application/diffusion/diffusion-history.css
··· 10 10 .diffusion-history-list .phui-oi-attribute .phui-tag-core { 11 11 border-color: transparent; 12 12 } 13 + 14 + .diffusion-history-message { 15 + background-color: {$bluebackground}; 16 + padding: 16px; 17 + margin: 4px 0; 18 + border-radius: 5px; 19 + color: {$darkbluetext}; 20 + }
+25
webroot/rsrc/css/phui/object-item/phui-oi-list-view.css
··· 285 285 padding: 0 8px 6px; 286 286 } 287 287 288 + .phui-oi-description { 289 + display: none; 290 + } 291 + 292 + .phui-oi-description.phui-oi-description-reveal { 293 + display: block; 294 + } 295 + 296 + .phui-oi-description-tag { 297 + margin-left: 4px; 298 + } 299 + 300 + .phui-oi-description-tag:hover .phui-tag-core { 301 + cursor: pointer; 302 + background: {$darkgreybackground}; 303 + } 304 + 305 + .phui-oi-description-tag .phui-tag-core { 306 + border: none; 307 + } 308 + 309 + .phui-oi-description-tag.phui-tag-view .phui-icon-view { 310 + margin: 2px; 311 + } 312 + 288 313 289 314 /* - Attribute List ------------------------------------------------------------ 290 315