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

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

+19 -22
+16 -22
src/applications/people/controller/PhabricatorPeopleController.php
··· 6 6 return true; 7 7 } 8 8 9 + /** 10 + * return AphrontSideNavFilterView 11 + */ 9 12 public function buildSideNavView($for_app = false) { 13 + // we are on /people/* 10 14 $nav = new AphrontSideNavFilterView(); 11 15 $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 12 16 13 - $name = null; 14 - if ($for_app) { 15 - $name = $this->getRequest()->getURIData('username'); 16 - if ($name) { 17 - $nav->setBaseURI(new PhutilURI('/p/')); 18 - $nav->addFilter("{$name}/", $name); 19 - if (id(new PhabricatorCalendarApplication())->isInstalled()) { 20 - $nav->addFilter("{$name}/calendar/", pht('Calendar')); 21 - } 22 - } 23 - } 24 - 25 - if (!$name) { 26 - $viewer = $this->getRequest()->getUser(); 27 - id(new PhabricatorPeopleSearchEngine()) 28 - ->setViewer($viewer) 29 - ->addNavigationItems($nav->getMenu()); 17 + $viewer = $this->getRequest()->getUser(); 18 + id(new PhabricatorPeopleSearchEngine()) 19 + ->setViewer($viewer) 20 + ->addNavigationItems($nav->getMenu()); 30 21 31 - if ($viewer->getIsAdmin()) { 32 - $nav->addLabel(pht('User Administration')); 33 - $nav->addFilter('logs', pht('Activity Logs')); 34 - $nav->addFilter('invite', pht('Email Invitations')); 35 - } 22 + if ($viewer->getIsAdmin()) { 23 + $nav->addLabel(pht('User Administration')); 24 + $nav->addFilter('logs', pht('Activity Logs')); 25 + $nav->addFilter('invite', pht('Email Invitations')); 36 26 } 37 27 38 28 return $nav; 39 29 } 40 30 41 31 public function buildApplicationMenu() { 32 + if ($this->getRequest()->getURIData('username')) { 33 + // we are on /p/name/ so return the default user profile sidebar 34 + return parent::buildApplicationMenu(); 35 + } 42 36 return $this->buildSideNavView(true)->getMenu(); 43 37 } 44 38
+3
src/applications/search/engine/PhabricatorProfileMenuEngine.php
··· 87 87 abstract public function getItemURI($path); 88 88 abstract protected function isMenuEngineConfigurable(); 89 89 90 + /** 91 + * @return array of PhabricatorProfileMenuItemConfiguration objects 92 + */ 90 93 abstract protected function getBuiltinProfileItems($object); 91 94 92 95 protected function getBuiltinCustomProfileItems(