@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 Picture Menu Item for Profiles

Summary: Just making profiles a little nicer, adds a big picture, easier mechanism for updating photos. Also larger profile pictures... need to re-thumb?

Test Plan:
View my profile, edit my picture, view a stranger, see profile. Check mobile, tablet, desktop. Check action menu on mobile.

{F2559394}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+119 -10
+4 -2
resources/celerity/map.php
··· 81 81 'rsrc/css/application/objectselector/object-selector.css' => '85ee8ce6', 82 82 'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b', 83 83 'rsrc/css/application/paste/paste.css' => '1898e534', 84 + 'rsrc/css/application/people/people-picture-menu-item.css' => '1ac65ef7', 84 85 'rsrc/css/application/people/people-profile.css' => '2473d929', 85 86 'rsrc/css/application/phame/phame.css' => '53fa6236', 86 87 'rsrc/css/application/pholio/pholio-edit.css' => '07676f51', ··· 96 97 'rsrc/css/application/policy/policy.css' => '957ea14c', 97 98 'rsrc/css/application/ponder/ponder-view.css' => 'fbd45f96', 98 99 'rsrc/css/application/project/project-card-view.css' => 'f25746f5', 99 - 'rsrc/css/application/project/project-view.css' => '6936dc6e', 100 + 'rsrc/css/application/project/project-view.css' => 'ceabdbaa', 100 101 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 101 102 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 102 103 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', ··· 777 778 'owners-path-editor-css' => '2f00933b', 778 779 'paste-css' => '1898e534', 779 780 'path-typeahead' => 'f7fc67ec', 781 + 'people-picture-menu-item-css' => '1ac65ef7', 780 782 'people-profile-css' => '2473d929', 781 783 'phabricator-action-list-view-css' => '5679229f', 782 784 'phabricator-busy' => '59a7976a', ··· 904 906 'policy-transaction-detail-css' => '82100a43', 905 907 'ponder-view-css' => 'fbd45f96', 906 908 'project-card-view-css' => 'f25746f5', 907 - 'project-view-css' => '6936dc6e', 909 + 'project-view-css' => 'ceabdbaa', 908 910 'releeph-core' => '9b3c5733', 909 911 'releeph-preview-branch' => 'b7a6f4a5', 910 912 'releeph-request-differential-create-dialog' => '8d8b92cd',
+2
src/__phutil_library_map__.php
··· 3323 3323 'PhabricatorPeopleNewController' => 'applications/people/controller/PhabricatorPeopleNewController.php', 3324 3324 'PhabricatorPeopleNoOwnerDatasource' => 'applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php', 3325 3325 'PhabricatorPeopleOwnerDatasource' => 'applications/people/typeahead/PhabricatorPeopleOwnerDatasource.php', 3326 + 'PhabricatorPeoplePictureProfileMenuItem' => 'applications/people/menuitem/PhabricatorPeoplePictureProfileMenuItem.php', 3326 3327 'PhabricatorPeopleProfileController' => 'applications/people/controller/PhabricatorPeopleProfileController.php', 3327 3328 'PhabricatorPeopleProfileEditController' => 'applications/people/controller/PhabricatorPeopleProfileEditController.php', 3328 3329 'PhabricatorPeopleProfileManageController' => 'applications/people/controller/PhabricatorPeopleProfileManageController.php', ··· 8455 8456 'PhabricatorPeopleNewController' => 'PhabricatorPeopleController', 8456 8457 'PhabricatorPeopleNoOwnerDatasource' => 'PhabricatorTypeaheadDatasource', 8457 8458 'PhabricatorPeopleOwnerDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 8459 + 'PhabricatorPeoplePictureProfileMenuItem' => 'PhabricatorProfileMenuItem', 8458 8460 'PhabricatorPeopleProfileController' => 'PhabricatorPeopleController', 8459 8461 'PhabricatorPeopleProfileEditController' => 'PhabricatorPeopleProfileController', 8460 8462 'PhabricatorPeopleProfileManageController' => 'PhabricatorPeopleProfileController',
+2 -2
src/applications/files/transform/PhabricatorFileThumbnailTransform.php
··· 58 58 public function generateTransforms() { 59 59 return array( 60 60 id(new PhabricatorFileThumbnailTransform()) 61 - ->setName(pht("Profile (200px \xC3\x97 200px)")) 61 + ->setName(pht("Profile (400px \xC3\x97 400px)")) 62 62 ->setKey(self::TRANSFORM_PROFILE) 63 - ->setDimensions(200, 200) 63 + ->setDimensions(400, 400) 64 64 ->setScaleUp(true), 65 65 id(new PhabricatorFileThumbnailTransform()) 66 66 ->setName(pht("Pinboard (280px \xC3\x97 210px)"))
+2 -1
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 98 98 $header = id(new PHUIHeaderView()) 99 99 ->setHeader(array($user->getFullName(), $tag)) 100 100 ->setImage($picture) 101 - ->setProfileHeader(true); 101 + ->setProfileHeader(true) 102 + ->addClass('people-profile-header'); 102 103 103 104 if ($user->getIsDisabled()) { 104 105 $header->setStatus('fa-ban', 'red', pht('Disabled'));
+5
src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php
··· 5 5 6 6 const ITEM_PROFILE = 'people.profile'; 7 7 const ITEM_MANAGE = 'people.manage'; 8 + const ITEM_PICTURE = 'people.picture'; 8 9 9 10 protected function isMenuEngineConfigurable() { 10 11 return false; ··· 21 22 $viewer = $this->getViewer(); 22 23 23 24 $items = array(); 25 + 26 + $items[] = $this->newItem() 27 + ->setBuiltinKey(self::ITEM_PICTURE) 28 + ->setMenuItemKey(PhabricatorPeoplePictureProfileMenuItem::MENUITEMKEY); 24 29 25 30 $items[] = $this->newItem() 26 31 ->setBuiltinKey(self::ITEM_PROFILE)
+2 -5
src/applications/people/menuitem/PhabricatorPeopleDetailsProfileMenuItem.php
··· 39 39 PhabricatorProfileMenuItemConfiguration $config) { 40 40 41 41 $user = $config->getProfileObject(); 42 - 43 - $picture = $user->getProfileImageURI(); 44 - $name = $user->getUsername(); 45 42 $href = urisprintf( 46 43 '/p/%s/', 47 44 $user->getUsername()); 48 45 49 46 $item = $this->newItem() 50 47 ->setHref($href) 51 - ->setName($name) 52 - ->setProfileImage($picture); 48 + ->setName(pht('Profile')) 49 + ->setIcon('fa-user'); 53 50 54 51 return array( 55 52 $item,
+76
src/applications/people/menuitem/PhabricatorPeoplePictureProfileMenuItem.php
··· 1 + <?php 2 + 3 + final class PhabricatorPeoplePictureProfileMenuItem 4 + extends PhabricatorProfileMenuItem { 5 + 6 + const MENUITEMKEY = 'people.picture'; 7 + 8 + public function getMenuItemTypeName() { 9 + return pht('User Picture'); 10 + } 11 + 12 + private function getDefaultName() { 13 + return pht('User Picture'); 14 + } 15 + 16 + public function canHideMenuItem( 17 + PhabricatorProfileMenuItemConfiguration $config) { 18 + return false; 19 + } 20 + 21 + public function getDisplayName( 22 + PhabricatorProfileMenuItemConfiguration $config) { 23 + return $this->getDefaultName(); 24 + } 25 + 26 + public function buildEditEngineFields( 27 + PhabricatorProfileMenuItemConfiguration $config) { 28 + return array(); 29 + } 30 + 31 + protected function newNavigationMenuItems( 32 + PhabricatorProfileMenuItemConfiguration $config) { 33 + 34 + $user = $config->getProfileObject(); 35 + require_celerity_resource('people-picture-menu-item-css'); 36 + 37 + $picture = $user->getProfileImageURI(); 38 + $name = $user->getUsername(); 39 + $href = urisprintf( 40 + '/p/%s/', 41 + $user->getUsername()); 42 + 43 + $photo = phutil_tag( 44 + 'img', 45 + array( 46 + 'src' => $picture, 47 + 'class' => 'people-menu-image', 48 + )); 49 + 50 + $can_edit = PhabricatorPolicyFilter::hasCapability( 51 + $this->getViewer(), 52 + $user, 53 + PhabricatorPolicyCapability::CAN_EDIT); 54 + 55 + if ($can_edit) { 56 + $id = $user->getID(); 57 + $href = "/people/picture/{$id}/"; 58 + } 59 + 60 + $view = phutil_tag_div('people-menu-image-container', $photo); 61 + $view = phutil_tag( 62 + 'a', 63 + array( 64 + 'href' => $href, 65 + ), 66 + $view); 67 + 68 + $item = $this->newItem() 69 + ->appendChild($view); 70 + 71 + return array( 72 + $item, 73 + ); 74 + } 75 + 76 + }
+18
webroot/rsrc/css/application/people/people-picture-menu-item.css
··· 1 + /** 2 + * @provides people-picture-menu-item-css 3 + */ 4 + 5 + .people-menu-image { 6 + width: 160px; 7 + height: 160px; 8 + border: 1px solid {$thinblueborder}; 9 + } 10 + 11 + .people-menu-image-container { 12 + background: #fff; 13 + padding: 4px; 14 + border-radius: 3px; 15 + border: 1px solid {$lightblueborder}; 16 + margin: 4px 0px 16px 20px; 17 + display: inline-block; 18 + }
+8
webroot/rsrc/css/application/project/project-view.css
··· 87 87 .profile-no-badges { 88 88 padding: 24px 0; 89 89 } 90 + 91 + .people-profile-header.phui-profile-header .phui-header-col1 { 92 + display: none; 93 + } 94 + 95 + .device .people-profile-header.phui-profile-header .phui-header-col1 { 96 + display: table-cell; 97 + }