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

Use tags to show user status

Summary: I'll probably move "away" to a custom field, but this is technically broken right now.

Test Plan: {F49416}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

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

+38 -18
+38 -18
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 7 7 private $page; 8 8 9 9 public function shouldRequireAdmin() { 10 - // Default for people app is true 11 - // We desire public access here 12 10 return false; 13 11 } 14 12 ··· 28 26 } 29 27 30 28 public function processRequest() { 31 - 32 29 $viewer = $this->getRequest()->getUser(); 33 30 34 - $user = id(new PhabricatorUser())->loadOneWhere( 35 - 'userName = %s', 36 - $this->username); 31 + $user = id(new PhabricatorPeopleQuery()) 32 + ->setViewer($viewer) 33 + ->withUsernames(array($this->username)) 34 + ->executeOne(); 37 35 if (!$user) { 38 36 return new Aphront404Response(); 39 37 } ··· 61 59 $event->setUser($viewer); 62 60 PhutilEventEngine::dispatchEvent($event); 63 61 $nav = AphrontSideNavFilterView::newFromMenu($event->getValue('menu')); 64 - 65 - $this->page = $nav->selectFilter($this->page, 'feed'); 66 - 67 - $content = $this->renderUserFeed($user); 62 + $nav->selectFilter($this->page, 'feed'); 68 63 69 64 $picture = $user->loadProfileImageURI(); 70 65 ··· 74 69 ->setImage($picture); 75 70 76 71 if ($user->getIsDisabled()) { 77 - $header->setStatus(pht('Disabled')); 78 - } else { 79 - $statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses( 80 - array($user->getPHID())); 81 - if ($statuses) { 82 - $header->setStatus(reset($statuses)->getTerseSummary($viewer)); 83 - } 72 + $header->addTag( 73 + id(new PhabricatorTagView()) 74 + ->setType(PhabricatorTagView::TYPE_STATE) 75 + ->setBackgroundColor(PhabricatorTagView::COLOR_GREY) 76 + ->setName(pht('Disabled'))); 77 + } 78 + 79 + if ($user->getIsAdmin()) { 80 + $header->addTag( 81 + id(new PhabricatorTagView()) 82 + ->setType(PhabricatorTagView::TYPE_STATE) 83 + ->setBackgroundColor(PhabricatorTagView::COLOR_RED) 84 + ->setName(pht('Administrator'))); 85 + } 86 + 87 + if ($user->getIsSystemAgent()) { 88 + $header->addTag( 89 + id(new PhabricatorTagView()) 90 + ->setType(PhabricatorTagView::TYPE_STATE) 91 + ->setBackgroundColor(PhabricatorTagView::COLOR_BLUE) 92 + ->setName(pht('Bot'))); 93 + } 94 + 95 + 96 + $statuses = id(new PhabricatorUserStatus()) 97 + ->loadCurrentStatuses(array($user->getPHID())); 98 + if ($statuses) { 99 + $header->addTag( 100 + id(new PhabricatorTagView()) 101 + ->setType(PhabricatorTagView::TYPE_STATE) 102 + ->setBackgroundColor(PhabricatorTagView::COLOR_ORANGE) 103 + ->setName(head($statuses)->getTerseSummary($viewer))); 84 104 } 85 105 86 106 $actions = id(new PhabricatorActionListView()) ··· 117 137 $nav->appendChild($header); 118 138 $nav->appendChild($actions); 119 139 $nav->appendChild($properties); 120 - $nav->appendChild($content); 140 + $nav->appendChild($this->renderUserFeed($user)); 121 141 122 142 return $this->buildApplicationPage( 123 143 $nav,