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

Remove PhabricatorProfileHeaderView in favor of PhabricatorHeaderView

Summary:
We have this old view which is only used in two places and looks the same but has totally different markup. Get rid of it.

@chad, I'm generally going to move the user/project profiles a step toward looking like other object detail view with the custom field stuff. Not sure if you have any grand vision here; we can easily do something else later since this is like 80% "delete weird epriestley one-offs that don't look quite right in favor of standard elements".

Test Plan: {F49324} {F49325} {F49326}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

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

+137 -218
+45 -54
src/__celerity_resource_map__.php
··· 3197 3197 ), 3198 3198 'phabricator-header-view-css' => 3199 3199 array( 3200 - 'uri' => '/res/585b771c/rsrc/css/layout/phabricator-header-view.css', 3200 + 'uri' => '/res/76173bb6/rsrc/css/layout/phabricator-header-view.css', 3201 3201 'type' => 'css', 3202 3202 'requires' => 3203 3203 array( ··· 3397 3397 array( 3398 3398 ), 3399 3399 'disk' => '/rsrc/css/application/profile/profile-view.css', 3400 - ), 3401 - 'phabricator-profile-header-css' => 3402 - array( 3403 - 'uri' => '/res/a03c1e20/rsrc/css/application/profile/profile-header-view.css', 3404 - 'type' => 'css', 3405 - 'requires' => 3406 - array( 3407 - ), 3408 - 'disk' => '/rsrc/css/application/profile/profile-header-view.css', 3409 3400 ), 3410 3401 'phabricator-project-tag-css' => 3411 3402 array( ··· 4149 4140 ), array( 4150 4141 'packages' => 4151 4142 array( 4152 - '178f5351' => 4143 + 'd7254b92' => 4153 4144 array( 4154 4145 'name' => 'core.pkg.css', 4155 4146 'symbols' => ··· 4197 4188 40 => 'phabricator-property-list-view-css', 4198 4189 41 => 'phabricator-tag-view-css', 4199 4190 ), 4200 - 'uri' => '/res/pkg/178f5351/core.pkg.css', 4191 + 'uri' => '/res/pkg/d7254b92/core.pkg.css', 4201 4192 'type' => 'css', 4202 4193 ), 4203 4194 '75ccea43' => ··· 4391 4382 'reverse' => 4392 4383 array( 4393 4384 'aphront-attached-file-view-css' => 'adc3c36d', 4394 - 'aphront-dialog-view-css' => '178f5351', 4395 - 'aphront-error-view-css' => '178f5351', 4396 - 'aphront-form-view-css' => '178f5351', 4397 - 'aphront-list-filter-view-css' => '178f5351', 4398 - 'aphront-pager-view-css' => '178f5351', 4399 - 'aphront-panel-view-css' => '178f5351', 4400 - 'aphront-table-view-css' => '178f5351', 4401 - 'aphront-tokenizer-control-css' => '178f5351', 4402 - 'aphront-tooltip-css' => '178f5351', 4403 - 'aphront-typeahead-control-css' => '178f5351', 4385 + 'aphront-dialog-view-css' => 'd7254b92', 4386 + 'aphront-error-view-css' => 'd7254b92', 4387 + 'aphront-form-view-css' => 'd7254b92', 4388 + 'aphront-list-filter-view-css' => 'd7254b92', 4389 + 'aphront-pager-view-css' => 'd7254b92', 4390 + 'aphront-panel-view-css' => 'd7254b92', 4391 + 'aphront-table-view-css' => 'd7254b92', 4392 + 'aphront-tokenizer-control-css' => 'd7254b92', 4393 + 'aphront-tooltip-css' => 'd7254b92', 4394 + 'aphront-typeahead-control-css' => 'd7254b92', 4404 4395 'differential-changeset-view-css' => 'dd27a69b', 4405 4396 'differential-core-view-css' => 'dd27a69b', 4406 4397 'differential-inline-comment-editor' => '4ad86dee', ··· 4414 4405 'differential-table-of-contents-css' => 'dd27a69b', 4415 4406 'diffusion-commit-view-css' => 'c8ce2d88', 4416 4407 'diffusion-icons-css' => 'c8ce2d88', 4417 - 'global-drag-and-drop-css' => '178f5351', 4408 + 'global-drag-and-drop-css' => 'd7254b92', 4418 4409 'inline-comment-summary-css' => 'dd27a69b', 4419 4410 'javelin-aphlict' => '75ccea43', 4420 4411 'javelin-behavior' => 'a9f14d76', ··· 4488 4479 'javelin-util' => 'a9f14d76', 4489 4480 'javelin-vector' => 'a9f14d76', 4490 4481 'javelin-workflow' => 'a9f14d76', 4491 - 'lightbox-attachment-css' => '178f5351', 4482 + 'lightbox-attachment-css' => 'd7254b92', 4492 4483 'maniphest-task-summary-css' => 'adc3c36d', 4493 4484 'maniphest-transaction-detail-css' => 'adc3c36d', 4494 - 'phabricator-action-list-view-css' => '178f5351', 4495 - 'phabricator-application-launch-view-css' => '178f5351', 4485 + 'phabricator-action-list-view-css' => 'd7254b92', 4486 + 'phabricator-application-launch-view-css' => 'd7254b92', 4496 4487 'phabricator-busy' => '75ccea43', 4497 4488 'phabricator-content-source-view-css' => 'dd27a69b', 4498 - 'phabricator-core-css' => '178f5351', 4499 - 'phabricator-crumbs-view-css' => '178f5351', 4489 + 'phabricator-core-css' => 'd7254b92', 4490 + 'phabricator-crumbs-view-css' => 'd7254b92', 4500 4491 'phabricator-drag-and-drop-file-upload' => '4ad86dee', 4501 4492 'phabricator-dropdown-menu' => '75ccea43', 4502 4493 'phabricator-file-upload' => '75ccea43', 4503 - 'phabricator-filetree-view-css' => '178f5351', 4504 - 'phabricator-flag-css' => '178f5351', 4505 - 'phabricator-form-view-css' => '178f5351', 4506 - 'phabricator-header-view-css' => '178f5351', 4494 + 'phabricator-filetree-view-css' => 'd7254b92', 4495 + 'phabricator-flag-css' => 'd7254b92', 4496 + 'phabricator-form-view-css' => 'd7254b92', 4497 + 'phabricator-header-view-css' => 'd7254b92', 4507 4498 'phabricator-hovercard' => '75ccea43', 4508 - 'phabricator-jump-nav' => '178f5351', 4499 + 'phabricator-jump-nav' => 'd7254b92', 4509 4500 'phabricator-keyboard-shortcut' => '75ccea43', 4510 4501 'phabricator-keyboard-shortcut-manager' => '75ccea43', 4511 - 'phabricator-main-menu-view' => '178f5351', 4502 + 'phabricator-main-menu-view' => 'd7254b92', 4512 4503 'phabricator-menu-item' => '75ccea43', 4513 - 'phabricator-nav-view-css' => '178f5351', 4504 + 'phabricator-nav-view-css' => 'd7254b92', 4514 4505 'phabricator-notification' => '75ccea43', 4515 - 'phabricator-notification-css' => '178f5351', 4516 - 'phabricator-notification-menu-css' => '178f5351', 4517 - 'phabricator-object-item-list-view-css' => '178f5351', 4506 + 'phabricator-notification-css' => 'd7254b92', 4507 + 'phabricator-notification-menu-css' => 'd7254b92', 4508 + 'phabricator-object-item-list-view-css' => 'd7254b92', 4518 4509 'phabricator-object-selector-css' => 'dd27a69b', 4519 4510 'phabricator-phtize' => '75ccea43', 4520 4511 'phabricator-prefab' => '75ccea43', 4521 4512 'phabricator-project-tag-css' => 'adc3c36d', 4522 - 'phabricator-property-list-view-css' => '178f5351', 4523 - 'phabricator-remarkup-css' => '178f5351', 4513 + 'phabricator-property-list-view-css' => 'd7254b92', 4514 + 'phabricator-remarkup-css' => 'd7254b92', 4524 4515 'phabricator-shaped-request' => '4ad86dee', 4525 - 'phabricator-side-menu-view-css' => '178f5351', 4526 - 'phabricator-standard-page-view' => '178f5351', 4527 - 'phabricator-tag-view-css' => '178f5351', 4516 + 'phabricator-side-menu-view-css' => 'd7254b92', 4517 + 'phabricator-standard-page-view' => 'd7254b92', 4518 + 'phabricator-tag-view-css' => 'd7254b92', 4528 4519 'phabricator-textareautils' => '75ccea43', 4529 4520 'phabricator-tooltip' => '75ccea43', 4530 - 'phabricator-transaction-view-css' => '178f5351', 4531 - 'phabricator-zindex-css' => '178f5351', 4532 - 'phui-button-css' => '178f5351', 4533 - 'phui-form-css' => '178f5351', 4534 - 'phui-icon-view-css' => '178f5351', 4535 - 'phui-spacing-css' => '178f5351', 4536 - 'sprite-apps-large-css' => '178f5351', 4537 - 'sprite-gradient-css' => '178f5351', 4538 - 'sprite-icons-css' => '178f5351', 4539 - 'sprite-menu-css' => '178f5351', 4540 - 'syntax-highlighting-css' => '178f5351', 4521 + 'phabricator-transaction-view-css' => 'd7254b92', 4522 + 'phabricator-zindex-css' => 'd7254b92', 4523 + 'phui-button-css' => 'd7254b92', 4524 + 'phui-form-css' => 'd7254b92', 4525 + 'phui-icon-view-css' => 'd7254b92', 4526 + 'phui-spacing-css' => 'd7254b92', 4527 + 'sprite-apps-large-css' => 'd7254b92', 4528 + 'sprite-gradient-css' => 'd7254b92', 4529 + 'sprite-icons-css' => 'd7254b92', 4530 + 'sprite-menu-css' => 'd7254b92', 4531 + 'syntax-highlighting-css' => 'd7254b92', 4541 4532 ), 4542 4533 ));
-2
src/__phutil_library_map__.php
··· 1369 1369 'PhabricatorPolicyTestCase' => 'applications/policy/__tests__/PhabricatorPolicyTestCase.php', 1370 1370 'PhabricatorPolicyTestObject' => 'applications/policy/__tests__/PhabricatorPolicyTestObject.php', 1371 1371 'PhabricatorPolicyType' => 'applications/policy/constants/PhabricatorPolicyType.php', 1372 - 'PhabricatorProfileHeaderView' => 'view/layout/PhabricatorProfileHeaderView.php', 1373 1372 'PhabricatorProject' => 'applications/project/storage/PhabricatorProject.php', 1374 1373 'PhabricatorProjectConstants' => 'applications/project/constants/PhabricatorProjectConstants.php', 1375 1374 'PhabricatorProjectController' => 'applications/project/controller/PhabricatorProjectController.php', ··· 3325 3324 'PhabricatorPolicyTestCase' => 'PhabricatorTestCase', 3326 3325 'PhabricatorPolicyTestObject' => 'PhabricatorPolicyInterface', 3327 3326 'PhabricatorPolicyType' => 'PhabricatorPolicyConstants', 3328 - 'PhabricatorProfileHeaderView' => 'AphrontView', 3329 3327 'PhabricatorProject' => 3330 3328 array( 3331 3329 0 => 'PhabricatorProjectDAO',
+5 -6
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 89 89 90 90 $picture = $user->loadProfileImageURI(); 91 91 92 - $header = new PhabricatorProfileHeaderView(); 93 - $header 94 - ->setProfilePicture($picture) 95 - ->setName($user->getUserName().' ('.$user->getRealName().')') 96 - ->setDescription($profile->getTitle()); 92 + $header = id(new PhabricatorHeaderView()) 93 + ->setHeader($user->getUserName().' ('.$user->getRealName().')') 94 + ->setSubheader($profile->getTitle()) 95 + ->setImage($picture); 97 96 98 97 if ($user->getIsDisabled()) { 99 98 $header->setStatus(pht('Disabled')); ··· 106 105 } 107 106 108 107 $nav->appendChild($header); 109 - $header->appendChild($content); 108 + $nav->appendChild($content); 110 109 111 110 if ($user->getPHID() == $viewer->getPHID()) { 112 111 $nav->addFilter(
+26 -34
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 65 65 $tasks, 66 66 $content); 67 67 68 - $header = new PhabricatorProfileHeaderView(); 69 - $header->setName($project->getName()); 70 - $header->setDescription( 71 - phutil_utf8_shorten($profile->getBlurb(), 1024)); 72 - $header->setProfilePicture($picture); 68 + $header = id(new PhabricatorHeaderView()) 69 + ->setHeader($project->getName()) 70 + ->setSubheader(phutil_utf8_shorten($profile->getBlurb(), 1024)) 71 + ->setImage($picture); 73 72 74 73 $action = null; 75 74 if (!$project->isUserMember($user->getPHID())) { 76 - $can_join = PhabricatorPolicyCapability::CAN_JOIN; 77 - 78 - if (PhabricatorPolicyFilter::hasCapability($user, $project, $can_join)) { 79 - $class = 'green'; 80 - } else { 81 - $class = 'grey disabled'; 82 - } 83 - 84 - $action = phabricator_form( 75 + $can_join = PhabricatorPolicyFilter::hasCapability( 85 76 $user, 86 - array( 87 - 'action' => '/project/update/'.$project->getID().'/join/', 88 - 'method' => 'post', 89 - ), 90 - phutil_tag( 91 - 'button', 92 - array( 93 - 'class' => $class, 94 - ), 95 - pht('Join Project'))); 77 + $project, 78 + PhabricatorPolicyCapability::CAN_JOIN); 79 + 80 + $action = id(new PhabricatorActionView()) 81 + ->setUser($user) 82 + ->setRenderAsForm(true) 83 + ->setHref('/project/update/'.$project->getID().'/join/') 84 + ->setIcon('new') 85 + ->setDisabled(!$can_join) 86 + ->setName(pht('Join Project')); 96 87 } else { 97 - $action = javelin_tag( 98 - 'a', 99 - array( 100 - 'href' => '/project/update/'.$project->getID().'/leave/', 101 - 'sigil' => 'workflow', 102 - 'class' => 'grey button', 103 - ), 104 - pht('Leave Project...')); 88 + $action = id(new PhabricatorActionView()) 89 + ->setWorkflow(true) 90 + ->setHref('/project/update/'.$project->getID().'/leave/') 91 + ->setIcon('delete') 92 + ->setName(pht('Leave Project...')); 105 93 } 106 94 107 - $header->addAction($action); 95 + $action_list = id(new PhabricatorActionListView()) 96 + ->setUser($user) 97 + ->addAction($action); 98 + 108 99 $nav_view->appendChild($header); 109 - $header->appendChild($content); 100 + $nav_view->appendChild($action_list); 101 + $nav_view->appendChild($content); 110 102 111 103 return $this->buildApplicationPage( 112 104 $nav_view,
+43 -7
src/view/layout/PhabricatorHeaderView.php
··· 5 5 private $objectName; 6 6 private $header; 7 7 private $tags = array(); 8 + private $image; 9 + private $subheader; 8 10 9 11 public function setHeader($header) { 10 12 $this->header = $header; ··· 21 23 return $this; 22 24 } 23 25 26 + public function setImage($uri) { 27 + $this->image = $uri; 28 + return $this; 29 + } 30 + 31 + public function setSubheader($subheader) { 32 + $this->subheader = $subheader; 33 + return $this; 34 + } 35 + 24 36 public function render() { 25 37 require_celerity_resource('phabricator-header-view-css'); 26 38 27 - $header = array($this->header); 39 + $image = null; 40 + if ($this->image) { 41 + $image = phutil_tag( 42 + 'span', 43 + array( 44 + 'class' => 'phabricator-header-image', 45 + 'style' => 'background-image: url('.$this->image.')', 46 + ), 47 + ''); 48 + } 49 + 50 + $header = array(); 51 + $header[] = $this->header; 28 52 29 53 if ($this->objectName) { 30 54 array_unshift( ··· 48 72 array_interleave(' ', $this->tags)); 49 73 } 50 74 75 + if ($this->subheader) { 76 + $header[] = phutil_tag( 77 + 'div', 78 + array( 79 + 'class' => 'phabricator-header-subheader', 80 + ), 81 + $this->subheader); 82 + } 83 + 51 84 return phutil_tag( 52 85 'div', 53 86 array( 54 87 'class' => 'phabricator-header-shell', 55 88 ), 56 - phutil_tag( 57 - 'h1', 58 - array( 59 - 'class' => 'phabricator-header-view', 60 - ), 61 - $header)); 89 + array( 90 + $image, 91 + phutil_tag( 92 + 'h1', 93 + array( 94 + 'class' => 'phabricator-header-view', 95 + ), 96 + $header), 97 + )); 62 98 } 63 99 64 100
-76
src/view/layout/PhabricatorProfileHeaderView.php
··· 1 - <?php 2 - 3 - final class PhabricatorProfileHeaderView extends AphrontView { 4 - 5 - protected $profilePicture; 6 - protected $profileName; 7 - protected $profileDescription; 8 - protected $profileActions = array(); 9 - protected $profileStatus; 10 - 11 - public function setProfilePicture($picture) { 12 - $this->profilePicture = $picture; 13 - return $this; 14 - } 15 - 16 - public function setName($name) { 17 - $this->profileName = $name; 18 - return $this; 19 - } 20 - 21 - public function setDescription($description) { 22 - $this->profileDescription = $description; 23 - return $this; 24 - } 25 - 26 - public function addAction($action) { 27 - $this->profileActions[] = $action; 28 - return $this; 29 - } 30 - 31 - public function setStatus($status) { 32 - $this->profileStatus = $status; 33 - return $this; 34 - } 35 - 36 - public function render() { 37 - require_celerity_resource('phabricator-profile-header-css'); 38 - 39 - $image = null; 40 - if ($this->profilePicture) { 41 - $image = phutil_tag( 42 - 'div', 43 - array( 44 - 'class' => 'profile-header-picture-frame', 45 - 'style' => 'background-image: url('.$this->profilePicture.');', 46 - ), 47 - ''); 48 - } 49 - 50 - $description = $this->profileDescription; 51 - if ($this->profileStatus != '') { 52 - $description = hsprintf( 53 - '<strong>%s</strong>%s', 54 - $this->profileStatus, 55 - ($description != '' ? "\xE2\x80\x94".$description : '')); 56 - } 57 - 58 - return hsprintf( 59 - '<table class="phabricator-profile-header"> 60 - <tr> 61 - <td class="profile-header-name">%s</td> 62 - <td class="profile-header-actions" rowspan="2">%s</td> 63 - <td class="profile-header-picture" rowspan="2">%s</td> 64 - </tr> 65 - <tr> 66 - <td class="profile-header-description">%s</td> 67 - </tr> 68 - </table> 69 - %s', 70 - $this->profileName, 71 - $this->profileActions, 72 - $image, 73 - $description, 74 - $this->renderChildren()); 75 - } 76 - }
-39
webroot/rsrc/css/application/profile/profile-header-view.css
··· 1 - /** 2 - * @provides phabricator-profile-header-css 3 - */ 4 - 5 - .phabricator-profile-header { 6 - background: #e0e3ec; 7 - border-width: 1px 0; 8 - border-style: solid; 9 - border-color: #c0c5d1; 10 - width: 100%; 11 - } 12 - 13 - .phabricator-profile-header .profile-header-name { 14 - font-size: 24px; 15 - color: #333; 16 - font-weight: bold; 17 - padding: 12px 12px 6px; 18 - width: 100%; 19 - } 20 - 21 - .phabricator-profile-header .profile-header-actions { 22 - padding: 12px; 23 - } 24 - 25 - .phabricator-profile-header .profile-header-picture-frame { 26 - margin: 11px; 27 - width: 50px; 28 - height: 50px; 29 - position: relative; 30 - 31 - background: no-repeat; 32 - border: 1px solid #ffffff; 33 - } 34 - 35 - .phabricator-profile-header .profile-header-description { 36 - padding: 0 12px 12px; 37 - color: #555; 38 - font-size: 13px; 39 - }
+18
webroot/rsrc/css/layout/phabricator-header-view.css
··· 7 7 border-width: 1px 0; 8 8 border-style: solid; 9 9 border-color: #c0c5d1; 10 + overflow: hidden; 10 11 } 11 12 12 13 .phabricator-header-shell + .phabricator-form-view { ··· 31 32 .phabricator-header-tags .phabricator-tag-view { 32 33 margin-left: 4px; 33 34 } 35 + 36 + .phabricator-header-image { 37 + display: inline-block; 38 + background-repeat: no-repeat; 39 + border: 1px solid white; 40 + width: 50px; 41 + height: 50px; 42 + margin: 12px; 43 + float: left; 44 + } 45 + 46 + .phabricator-header-subheader { 47 + color: #444444; 48 + font-weight: normal; 49 + font-size: 13px; 50 + margin-top: 4px; 51 + }