@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 an edit link on hover for Project profile images

Summary: Minor point of polish, but feels really nice. Hover over photo and edit a link to change the picture.

Test Plan:
hover hover, clicky clicky

{F1069179}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+77 -8
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '92f16374', 10 + 'core.pkg.css' => '956d6a9f', 11 11 'core.pkg.js' => '573e6664', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', ··· 133 133 'rsrc/css/phui/phui-fontkit.css' => '9cda225e', 134 134 'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e', 135 135 'rsrc/css/phui/phui-form.css' => '0b98e572', 136 - 'rsrc/css/phui/phui-header-view.css' => '235f0d7d', 136 + 'rsrc/css/phui/phui-header-view.css' => 'd53cc835', 137 137 'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad', 138 138 'rsrc/css/phui/phui-icon.css' => '3f33ab57', 139 139 'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8', ··· 808 808 'phui-fontkit-css' => '9cda225e', 809 809 'phui-form-css' => '0b98e572', 810 810 'phui-form-view-css' => '4a1a0f5e', 811 - 'phui-header-view-css' => '235f0d7d', 811 + 'phui-header-view-css' => 'd53cc835', 812 812 'phui-icon-set-selector-css' => '1ab67aad', 813 813 'phui-icon-view-css' => '3f33ab57', 814 814 'phui-image-mask-css' => '5a8b09c8',
+9
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 31 31 $header->setStatus('fa-ban', 'red', pht('Archived')); 32 32 } 33 33 34 + $can_edit = PhabricatorPolicyFilter::hasCapability( 35 + $viewer, 36 + $project, 37 + PhabricatorPolicyCapability::CAN_EDIT); 38 + 39 + if ($can_edit) { 40 + $header->setImageEditURL($this->getApplicationURI("picture/{$id}/")); 41 + } 42 + 34 43 $properties = $this->buildPropertyListView($project); 35 44 36 45 $watch_action = $this->renderWatchAction($project);
+39 -4
src/view/phui/PHUIHeaderView.php
··· 8 8 private $tags = array(); 9 9 private $image; 10 10 private $imageURL = null; 11 + private $imageEditURL = null; 11 12 private $subheader; 12 13 private $headerIcon; 13 14 private $noBackground; ··· 54 55 55 56 public function setImageURL($url) { 56 57 $this->imageURL = $url; 58 + return $this; 59 + } 60 + 61 + public function setImageEditURL($url) { 62 + $this->imageEditURL = $url; 57 63 return $this; 58 64 } 59 65 ··· 174 180 } 175 181 176 182 protected function getTagContent() { 183 + 177 184 $image = null; 178 185 if ($this->image) { 186 + $image_href = null; 187 + if ($this->imageURL) { 188 + $image_href = $this->imageURL; 189 + } else if ($this->imageEditURL) { 190 + $image_href = $this->imageEditURL; 191 + } 192 + 179 193 $image = phutil_tag( 180 - ($this->imageURL ? 'a' : 'span'), 194 + 'span', 181 195 array( 182 - 'href' => $this->imageURL, 183 196 'class' => 'phui-header-image', 184 197 'style' => 'background-image: url('.$this->image.')', 185 - ), 186 - ' '); 198 + )); 199 + 200 + if ($image_href) { 201 + $edit_view = null; 202 + if ($this->imageEditURL) { 203 + $edit_view = phutil_tag( 204 + 'span', 205 + array( 206 + 'class' => 'phui-header-image-edit', 207 + ), 208 + pht('Edit')); 209 + } 210 + 211 + $image = phutil_tag( 212 + 'a', 213 + array( 214 + 'href' => $image_href, 215 + 'class' => 'phui-header-image-href', 216 + ), 217 + array( 218 + $image, 219 + $edit_view, 220 + )); 221 + } 187 222 } 188 223 189 224 $viewer = $this->getUser();
+26 -1
webroot/rsrc/css/phui/phui-header-view.css
··· 128 128 display: inline-block; 129 129 background-repeat: no-repeat; 130 130 background-size: 100%; 131 - box-shadow: {$borderinset}; 132 131 width: 50px; 133 132 height: 50px; 133 + border-radius: 3px; 134 + } 135 + 136 + .phui-header-image-href { 137 + position: relative; 138 + display: block; 139 + } 140 + 141 + .phui-header-image-edit { 142 + display: none; 143 + } 144 + 145 + .device-desktop .phui-header-image-href:hover .phui-header-image-edit { 146 + display: block; 147 + position: absolute; 148 + left: 0; 149 + background: rgba(0,0,0,0.4); 150 + color: #fff; 151 + font-weight: normal; 152 + bottom: 4px; 153 + padding: 4px 8px; 154 + font-size: 12px; 155 + } 156 + 157 + .device-desktop .phui-header-image-edit:hover { 158 + text-decoration: underline; 134 159 } 135 160 136 161 .phui-header-subheader {