mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 06:42:42 +01:00
Display same items in mobile menu on User Profile page as on desktop
Summary: Display same items in mobile menu on User Profile page as on desktop. (The code did not make too much sense anyway here?) Also remove special but dysfunctional "Calendar" item in mobile view: The resulting URI does not work even if the calendar application is installed. If it ever worked, it should be moved to the default desktop sidebar anyway and not be a mobile-only menu item. Closes T15224 Test Plan: Open http://phorge.localhost/people/ and http://phorge.localhost/p/username and http://phorge.localhost/people/manage/1/, change screen width to less and more than 920px, check at menu items in left bar (>920px) and right upper corner (<920px). Reviewers: O1 Blessed Committers, speck Reviewed By: O1 Blessed Committers, speck Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15224 Differential Revision: https://we.phorge.it/D25687
This commit is contained in:
parent
000bccf8e4
commit
5d479556c3
2 changed files with 19 additions and 22 deletions
|
@ -6,39 +6,33 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return AphrontSideNavFilterView
|
||||||
|
*/
|
||||||
public function buildSideNavView($for_app = false) {
|
public function buildSideNavView($for_app = false) {
|
||||||
|
// we are on /people/*
|
||||||
$nav = new AphrontSideNavFilterView();
|
$nav = new AphrontSideNavFilterView();
|
||||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||||
|
|
||||||
$name = null;
|
$viewer = $this->getRequest()->getUser();
|
||||||
if ($for_app) {
|
id(new PhabricatorPeopleSearchEngine())
|
||||||
$name = $this->getRequest()->getURIData('username');
|
->setViewer($viewer)
|
||||||
if ($name) {
|
->addNavigationItems($nav->getMenu());
|
||||||
$nav->setBaseURI(new PhutilURI('/p/'));
|
|
||||||
$nav->addFilter("{$name}/", $name);
|
|
||||||
if (id(new PhabricatorCalendarApplication())->isInstalled()) {
|
|
||||||
$nav->addFilter("{$name}/calendar/", pht('Calendar'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$name) {
|
if ($viewer->getIsAdmin()) {
|
||||||
$viewer = $this->getRequest()->getUser();
|
$nav->addLabel(pht('User Administration'));
|
||||||
id(new PhabricatorPeopleSearchEngine())
|
$nav->addFilter('logs', pht('Activity Logs'));
|
||||||
->setViewer($viewer)
|
$nav->addFilter('invite', pht('Email Invitations'));
|
||||||
->addNavigationItems($nav->getMenu());
|
|
||||||
|
|
||||||
if ($viewer->getIsAdmin()) {
|
|
||||||
$nav->addLabel(pht('User Administration'));
|
|
||||||
$nav->addFilter('logs', pht('Activity Logs'));
|
|
||||||
$nav->addFilter('invite', pht('Email Invitations'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $nav;
|
return $nav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildApplicationMenu() {
|
public function buildApplicationMenu() {
|
||||||
|
if ($this->getRequest()->getURIData('username')) {
|
||||||
|
// we are on /p/name/ so return the default user profile sidebar
|
||||||
|
return parent::buildApplicationMenu();
|
||||||
|
}
|
||||||
return $this->buildSideNavView(true)->getMenu();
|
return $this->buildSideNavView(true)->getMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,9 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
|
||||||
abstract public function getItemURI($path);
|
abstract public function getItemURI($path);
|
||||||
abstract protected function isMenuEngineConfigurable();
|
abstract protected function isMenuEngineConfigurable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array of PhabricatorProfileMenuItemConfiguration objects
|
||||||
|
*/
|
||||||
abstract protected function getBuiltinProfileItems($object);
|
abstract protected function getBuiltinProfileItems($object);
|
||||||
|
|
||||||
protected function getBuiltinCustomProfileItems(
|
protected function getBuiltinCustomProfileItems(
|
||||||
|
|
Loading…
Reference in a new issue