diff --git a/src/applications/home/application/PhabricatorApplicationHome.php b/src/applications/home/application/PhabricatorApplicationHome.php index 9c487bd2a5..d9edbb094a 100644 --- a/src/applications/home/application/PhabricatorApplicationHome.php +++ b/src/applications/home/application/PhabricatorApplicationHome.php @@ -3,11 +3,11 @@ final class PhabricatorApplicationHome extends PhabricatorApplication { public function getBaseURI() { - return '/'; + return '/home/'; } public function getShortDescription() { - return pht('Where the <3 is'); + return pht('Command Center'); } public function getIconName() { @@ -16,7 +16,8 @@ final class PhabricatorApplicationHome extends PhabricatorApplication { public function getRoutes() { return array( - '/(?:(?P(?:jump))/)?' => 'PhabricatorHomeMainController', + '/' => 'PhabricatorHomeMainController', + '/(?Phome)/' => 'PhabricatorHomeMainController', '/home/' => array( 'create/' => 'PhabricatorHomeQuickCreateController', ), diff --git a/src/applications/home/controller/PhabricatorHomeController.php b/src/applications/home/controller/PhabricatorHomeController.php index 53ac7f8713..17f543e4b9 100644 --- a/src/applications/home/controller/PhabricatorHomeController.php +++ b/src/applications/home/controller/PhabricatorHomeController.php @@ -40,6 +40,15 @@ abstract class PhabricatorHomeController extends PhabricatorController { $applications[$meta_app] = PhabricatorApplication::getByClass($meta_app); $tiles = array(); + + $home_app = new PhabricatorApplicationHome(); + + $tiles[] = id(new PhabricatorApplicationLaunchView()) + ->setApplication($home_app) + ->setApplicationStatus($home_app->loadStatus($user)) + ->addClass('phabricator-application-launch-phone-only') + ->setUser($user); + foreach ($pinned as $pinned_application) { if (empty($applications[$pinned_application])) { continue; diff --git a/src/applications/home/controller/PhabricatorHomeMainController.php b/src/applications/home/controller/PhabricatorHomeMainController.php index 693695e300..30a63fbd09 100644 --- a/src/applications/home/controller/PhabricatorHomeMainController.php +++ b/src/applications/home/controller/PhabricatorHomeMainController.php @@ -3,7 +3,7 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController { - private $filter; + private $only; private $minipanels = array(); public function shouldAllowPublic() { @@ -11,44 +11,49 @@ final class PhabricatorHomeMainController } public function willProcessRequest(array $data) { - $this->filter = idx($data, 'filter'); + $this->only = idx($data, 'only'); } public function processRequest() { $user = $this->getRequest()->getUser(); - $nav = $this->buildNav(); $dashboard = PhabricatorDashboardInstall::getDashboard( $user, $user->getPHID(), get_class($this->getCurrentApplication())); if ($dashboard) { - $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine()) + $content = id(new PhabricatorDashboardRenderingEngine()) ->setViewer($user) ->setDashboard($dashboard) ->renderDashboard(); - $nav->appendChild($rendered_dashboard); } else { $project_query = new PhabricatorProjectQuery(); $project_query->setViewer($user); $project_query->withMemberPHIDs(array($user->getPHID())); $projects = $project_query->execute(); - $nav = $this->buildMainResponse($nav, $projects); + $content = $this->buildMainResponse($projects); } - $nav->appendChild(id(new PhabricatorGlobalUploadTargetView()) - ->setUser($user)); + if (!$this->only) { + $nav = $this->buildNav(); + $nav->appendChild( + array( + $content, + id(new PhabricatorGlobalUploadTargetView())->setUser($user), + )); + $content = $nav; + } return $this->buildApplicationPage( - $nav, + $content, array( 'title' => 'Phabricator', 'device' => true, )); } - private function buildMainResponse($nav, array $projects) { + private function buildMainResponse(array $projects) { assert_instances_of($projects, 'PhabricatorProject'); $viewer = $this->getRequest()->getUser(); @@ -94,7 +99,7 @@ final class PhabricatorHomeMainController $revision_panel = null; } - $content = array( + return array( $welcome_panel, $unbreak_panel, $triage_panel, @@ -104,11 +109,6 @@ final class PhabricatorHomeMainController $commit_panel, $this->minipanels, ); - - $nav->appendChild($content); - - return $nav; - } private function buildUnbreakNowPanel() { diff --git a/src/applications/meta/view/PhabricatorApplicationLaunchView.php b/src/applications/meta/view/PhabricatorApplicationLaunchView.php index e58c3f02b8..512221eb00 100644 --- a/src/applications/meta/view/PhabricatorApplicationLaunchView.php +++ b/src/applications/meta/view/PhabricatorApplicationLaunchView.php @@ -1,6 +1,6 @@ application ? 'a' : 'div'; + } + + protected function getTagAttributes() { + $application = $this->application; + return array( + 'class' => array('phabricator-application-launch-container'), + 'href' => $application ? $application->getBaseURI() : null, + ); + } + + protected function getTagContent() { $application = $this->application; require_celerity_resource('phabricator-application-launch-view-css'); @@ -124,20 +136,10 @@ final class PhabricatorApplicationLaunchView extends AphrontView { ''); } - $classes = array(); - $classes[] = 'phabricator-application-launch-container'; - - $app_button = phutil_tag( - $application ? 'a' : 'div', - array( - 'class' => implode(' ', $classes), - 'href' => $application ? $application->getBaseURI() : null, - ), - array( - $icon, - $content, - )); - - return $app_button; + return array( + $icon, + $content, + ); } + } diff --git a/webroot/rsrc/css/application/base/phabricator-application-launch-view.css b/webroot/rsrc/css/application/base/phabricator-application-launch-view.css index 674337ca43..c412384df0 100644 --- a/webroot/rsrc/css/application/base/phabricator-application-launch-view.css +++ b/webroot/rsrc/css/application/base/phabricator-application-launch-view.css @@ -93,3 +93,11 @@ div.phabricator-application-launch-container { .phabricator-application-attention-count { color: {$sky}; } + +a.phabricator-application-launch-phone-only { + display: none; +} + +.device-phone a.phabricator-application-launch-phone-only { + display: block; +}