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

Icons for TagView

Summary: Adds the ability to set icons into Tags.

Test Plan: tested on UIExamples page.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+92 -19
+3 -3
resources/celerity/map.php
··· 7 7 return array( 8 8 'names' => 9 9 array( 10 - 'core.pkg.css' => '5c4061d8', 10 + 'core.pkg.css' => 'a35f9047', 11 11 'core.pkg.js' => 'c907bd96', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => '827749c1', ··· 124 124 'rsrc/css/layout/phabricator-hovercard-view.css' => '67c12b16', 125 125 'rsrc/css/layout/phabricator-side-menu-view.css' => '503699d0', 126 126 'rsrc/css/layout/phabricator-source-code-view.css' => '62a99814', 127 - 'rsrc/css/layout/phabricator-tag-view.css' => 'c0363c26', 127 + 'rsrc/css/layout/phabricator-tag-view.css' => '4c983c74', 128 128 'rsrc/css/layout/phabricator-timeline-view.css' => 'f4f846c4', 129 129 'rsrc/css/phui/phui-box.css' => '21da4d8c', 130 130 'rsrc/css/phui/phui-button.css' => '8106a67a', ··· 707 707 'phabricator-slowvote-css' => '266df6a1', 708 708 'phabricator-source-code-view-css' => '62a99814', 709 709 'phabricator-standard-page-view' => '517cdfb1', 710 - 'phabricator-tag-view-css' => 'c0363c26', 710 + 'phabricator-tag-view-css' => '4c983c74', 711 711 'phabricator-textareautils' => 'b3ec3cfc', 712 712 'phabricator-timeline-view-css' => 'f4f846c4', 713 713 'phabricator-tooltip' => '0a81ea29',
+55 -14
src/applications/uiexample/examples/PhabricatorTagExample.php
··· 80 80 81 81 $intro = id(new PHUIBoxView()) 82 82 ->appendChild($intro) 83 - ->setShadow(true) 84 - ->addPadding(PHUI::PADDING_LARGE) 85 - ->addMargin(PHUI::MARGIN_LARGE); 83 + ->addPadding(PHUI::PADDING_LARGE); 86 84 87 85 $header1 = id(new PHUIHeaderView()) 88 86 ->setHeader('Colors'); ··· 99 97 100 98 $content1 = id(new PHUIBoxView()) 101 99 ->appendChild($tags) 102 - ->setShadow(true) 103 - ->addPadding(PHUI::PADDING_LARGE) 104 - ->addMargin(PHUI::MARGIN_LARGE); 105 - 106 - $header2 = id(new PHUIHeaderView()) 107 - ->setHeader('Holidays?'); 108 - 100 + ->addPadding(PHUI::PADDING_LARGE); 109 101 110 102 $tags = array(); 111 103 $tags[] = id(new PhabricatorTagView()) ··· 131 123 132 124 $content2 = id(new PHUIBoxView()) 133 125 ->appendChild($tags) 134 - ->setShadow(true) 135 - ->addPadding(PHUI::PADDING_LARGE) 136 - ->addMargin(PHUI::MARGIN_LARGE); 126 + ->addPadding(PHUI::PADDING_LARGE); 127 + 128 + $icons = array(); 129 + $icons[] = id(new PhabricatorTagView()) 130 + ->setType(PhabricatorTagView::TYPE_STATE) 131 + ->setBackgroundColor(PhabricatorTagView::COLOR_GREEN) 132 + ->setIcon('check-white') 133 + ->setName('Passed'); 134 + $icons[] = hsprintf('<br /><br />'); 135 + $icons[] = id(new PhabricatorTagView()) 136 + ->setType(PhabricatorTagView::TYPE_STATE) 137 + ->setBackgroundColor(PhabricatorTagView::COLOR_RED) 138 + ->setIcon('delete-white') 139 + ->setName('Failed'); 140 + $icons[] = hsprintf('<br /><br />'); 141 + $icons[] = id(new PhabricatorTagView()) 142 + ->setType(PhabricatorTagView::TYPE_STATE) 143 + ->setBackgroundColor(PhabricatorTagView::COLOR_BLUE) 144 + ->setIcon('refresh-white') 145 + ->setName('Running'); 146 + $icons[] = hsprintf('<br /><br />'); 147 + $icons[] = id(new PhabricatorTagView()) 148 + ->setType(PhabricatorTagView::TYPE_STATE) 149 + ->setBackgroundColor(PhabricatorTagView::COLOR_GREY) 150 + ->setIcon('pause-white') 151 + ->setName('Paused'); 152 + $icons[] = hsprintf('<br /><br />'); 153 + $icons[] = id(new PhabricatorTagView()) 154 + ->setType(PhabricatorTagView::TYPE_STATE) 155 + ->setBackgroundColor(PhabricatorTagView::COLOR_BLACK) 156 + ->setIcon('stop-white') 157 + ->setName('Stopped'); 137 158 138 - return array($intro, $header1, $content1, $header2, $content2); 159 + $content3 = id(new PHUIBoxView()) 160 + ->appendChild($icons) 161 + ->addPadding(PHUI::PADDING_LARGE); 162 + 163 + $box = id(new PHUIObjectBoxView()) 164 + ->setHeaderText('Inline') 165 + ->appendChild($intro); 166 + 167 + $box1 = id(new PHUIObjectBoxView()) 168 + ->setHeaderText('Colors') 169 + ->appendChild($content1); 170 + 171 + $box2 = id(new PHUIObjectBoxView()) 172 + ->setHeaderText('Holidays') 173 + ->appendChild($content2); 174 + 175 + $box3 = id(new PHUIObjectBoxView()) 176 + ->setHeaderText('Icons') 177 + ->appendChild($content3); 178 + 179 + return array($box, $box1, $box2, $box3); 139 180 } 140 181 }
+18 -2
src/view/layout/PhabricatorTagView.php
··· 30 30 private $closed; 31 31 private $external; 32 32 private $id; 33 + private $icon; 33 34 34 35 public function setID($id) { 35 36 $this->id = $id; ··· 88 89 return $this; 89 90 } 90 91 92 + public function setIcon($icon) { 93 + $icon_view = id(new PHUIIconView()) 94 + ->setSpriteSheet(PHUIIconView::SPRITE_ICONS) 95 + ->setSpriteIcon($icon); 96 + $this->icon = $icon_view; 97 + return $this; 98 + } 99 + 91 100 public function render() { 92 101 if (!$this->type) { 93 102 throw new Exception(pht("You must call setType() before render()!")); ··· 120 129 $dot = null; 121 130 } 122 131 132 + if ($this->icon) { 133 + $icon = $this->icon; 134 + $classes[] = 'phabricator-tag-icon-view'; 135 + } else { 136 + $icon = null; 137 + } 138 + 123 139 $content = phutil_tag( 124 140 'span', 125 141 array( ··· 155 171 ), 156 172 'target' => $this->external ? '_blank' : null, 157 173 ), 158 - array($bar, $content)); 174 + array($bar, $icon, $content)); 159 175 } else { 160 176 return phutil_tag( 161 177 $this->href ? 'a' : 'span', ··· 165 181 'class' => implode(' ', $classes), 166 182 'target' => $this->external ? '_blank' : null, 167 183 ), 168 - array($bar, $content)); 184 + array($bar, $icon, $content)); 169 185 } 170 186 } 171 187
+16
webroot/rsrc/css/layout/phabricator-tag-view.css
··· 6 6 font-weight: bold; 7 7 text-decoration: none; 8 8 display: inline-block; 9 + position: relative; 9 10 } 10 11 11 12 a.phabricator-tag-view:hover { ··· 21 22 border: 1px solid transparent; 22 23 border-radius: 3px; 23 24 padding: 0 4px; 25 + } 26 + 27 + .phabricator-tag-type-state .phabricator-tag-core { 28 + padding: 0 6px; 29 + } 30 + 31 + .phabricator-tag-view .phui-icon-view { 32 + position: absolute; 33 + display: inline-block; 34 + top: 1px; 35 + left: 5px; 36 + } 37 + 38 + .phabricator-tag-icon-view .phabricator-tag-core { 39 + padding-left: 22px; 24 40 } 25 41 26 42 .phabricator-tag-view-has-bar .phabricator-tag-core {