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

at recaptime-dev/main 77 lines 2.1 kB view raw
1<?php 2 3final class PhabricatorPeopleProfileCommitsController 4 extends PhabricatorPeopleProfileController { 5 6 public function handleRequest(AphrontRequest $request) { 7 $viewer = $this->getViewer(); 8 $id = $request->getURIData('id'); 9 10 $user = id(new PhabricatorPeopleQuery()) 11 ->setViewer($viewer) 12 ->withIDs(array($id)) 13 ->needProfile(true) 14 ->needProfileImage(true) 15 ->needAvailability(true) 16 ->executeOne(); 17 if (!$user) { 18 return new Aphront404Response(); 19 } 20 21 $class = PhabricatorDiffusionApplication::class; 22 if (!PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) { 23 return new Aphront404Response(); 24 } 25 26 $this->setUser($user); 27 $title = array(pht('Recent Commits'), $user->getUsername()); 28 $header = $this->buildProfileHeader(); 29 $commits = $this->buildCommitsView($user); 30 31 $crumbs = $this->buildApplicationCrumbs(); 32 $crumbs->addTextCrumb(pht('Recent Commits')); 33 $crumbs->setBorder(true); 34 35 $nav = $this->newNavigation( 36 $user, 37 PhabricatorPeopleProfileMenuEngine::ITEM_COMMITS); 38 39 $view = id(new PHUITwoColumnView()) 40 ->setHeader($header) 41 ->addClass('project-view-home') 42 ->addClass('project-view-people-home') 43 ->setFooter(array( 44 $commits, 45 )); 46 47 return $this->newPage() 48 ->setTitle($title) 49 ->setCrumbs($crumbs) 50 ->setNavigation($nav) 51 ->appendChild($view); 52 } 53 54 private function buildCommitsView(PhabricatorUser $user) { 55 $viewer = $this->getViewer(); 56 57 $commits = id(new DiffusionCommitQuery()) 58 ->setViewer($viewer) 59 ->withAuthorPHIDs(array($user->getPHID())) 60 ->needCommitData(true) 61 ->needIdentities(true) 62 ->setLimit(100) 63 ->execute(); 64 65 $list = id(new DiffusionCommitGraphView()) 66 ->setViewer($viewer) 67 ->setCommits($commits) 68 ->setNoDataString(pht('No recent commits.')); 69 70 $view = id(new PHUIObjectBoxView()) 71 ->setHeaderText(pht('Recent Commits')) 72 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 73 ->appendChild($list); 74 75 return $view; 76 } 77}