Update tasks/commits, remove diffs from Profile
Summary: Mostly a minor nit-pick, but I hate sending users off the profile and disorient them onto application search. These pages are pretty easy to maintain, I don't expect to need to do more here. I dropped Differential outright. Kept Tasks and Commits. Now you can browse everything about a user on their profile without leaving. Maybe add a link to ApplicationSearch? Not sure it's important. Test Plan: Review tasks and commits on mine and other user profiles. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17470
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorPeopleProfileCommitsController
|
||||
extends PhabricatorPeopleProfileController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
|
||||
$user = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($id))
|
||||
->needProfile(true)
|
||||
->needProfileImage(true)
|
||||
->needAvailability(true)
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
))
|
||||
->executeOne();
|
||||
if (!$user) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$class = 'PhabricatorDiffusionApplication';
|
||||
if (!PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$this->setUser($user);
|
||||
$title = array(pht('Recent Commits'), $user->getUsername());
|
||||
$header = $this->buildProfileHeader();
|
||||
$commits = $this->buildCommitsView($user);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Recent Commits'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$nav = $this->getProfileMenu();
|
||||
$nav->selectFilter(PhabricatorPeopleProfileMenuEngine::ITEM_COMMITS);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->addClass('project-view-home')
|
||||
->addClass('project-view-people-home')
|
||||
->setFooter(array(
|
||||
$commits,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildCommitsView(PhabricatorUser $user) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$commits = id(new DiffusionCommitQuery())
|
||||
->setViewer($viewer)
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
))
|
||||
->setLimit(100)
|
||||
->execute();
|
||||
|
||||
$list = id(new PhabricatorAuditListView())
|
||||
->setViewer($viewer)
|
||||
->setCommits($commits)
|
||||
->setNoDataString(pht('No recent commits.'));
|
||||
|
||||
$view = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Recent Commits'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->appendChild($list);
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user