diff --git a/src/applications/ponder/application/PhabricatorPonderApplication.php b/src/applications/ponder/application/PhabricatorPonderApplication.php index 999580e90b..953f683128 100644 --- a/src/applications/ponder/application/PhabricatorPonderApplication.php +++ b/src/applications/ponder/application/PhabricatorPonderApplication.php @@ -1,88 +1,100 @@ [1-9]\d*)' => 'PonderQuestionViewController', + '/Q(?P[1-9]\d*)' + => 'PonderQuestionViewController', '/ponder/' => array( - '(?:query/(?P[^/]+)/)?' => 'PonderQuestionListController', - 'answer/add/' => 'PonderAnswerSaveController', - 'answer/edit/(?P\d+)/' => 'PonderAnswerEditController', - 'answer/comment/(?P\d+)/' => 'PonderAnswerCommentController', - 'answer/history/(?P\d+)/' => 'PonderAnswerHistoryController', - 'question/edit/(?:(?P\d+)/)?' => 'PonderQuestionEditController', - 'question/comment/(?P\d+)/' => 'PonderQuestionCommentController', - 'question/history/(?P\d+)/' => 'PonderQuestionHistoryController', - 'preview/' => 'PhabricatorMarkupPreviewController', + '(?:query/(?P[^/]+)/)?' + => 'PonderQuestionListController', + 'answer/add/' + => 'PonderAnswerSaveController', + 'answer/edit/(?P\d+)/' + => 'PonderAnswerEditController', + 'answer/comment/(?P\d+)/' + => 'PonderAnswerCommentController', + 'answer/history/(?P\d+)/' + => 'PonderAnswerHistoryController', + 'question/edit/(?:(?P\d+)/)?' + => 'PonderQuestionEditController', + 'question/create/' + => 'PonderQuestionEditController', + 'question/comment/(?P\d+)/' + => 'PonderQuestionCommentController', + 'question/history/(?P\d+)/' + => 'PonderQuestionHistoryController', + 'preview/' + => 'PhabricatorMarkupPreviewController', 'question/(?Popen|close)/(?P[1-9]\d*)/' => 'PonderQuestionStatusController', 'vote/' => 'PonderVoteSaveController', ), ); } public function getMailCommandObjects() { return array( 'question' => array( 'name' => pht('Email Commands: Questions'), 'header' => pht('Interacting with Ponder Questions'), 'object' => new PonderQuestion(), 'summary' => pht( 'This page documents the commands you can use to interact with '. 'questions in Ponder.'), ), ); } public function getApplicationSearchDocumentTypes() { return array( PonderQuestionPHIDType::TYPECONST, ); } } diff --git a/src/applications/ponder/controller/PonderController.php b/src/applications/ponder/controller/PonderController.php index 30bd412504..a14d70c773 100644 --- a/src/applications/ponder/controller/PonderController.php +++ b/src/applications/ponder/controller/PonderController.php @@ -1,32 +1,41 @@ getRequest()->getUser(); $nav = new AphrontSideNavFilterView(); $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); + if ($for_app) { + $nav->addFilter('question/create/', pht('Ask Question')); + } + id(new PonderQuestionSearchEngine()) ->setViewer($user) ->addNavigationItems($nav->getMenu()); $nav->selectFilter(null); return $nav; } + public function buildApplicationMenu() { + return $this->buildSideNavView($for_app = true)->getMenu(); + } + protected function buildApplicationCrumbs() { $crumbs = parent::buildApplicationCrumbs(); + $href = $this->getApplicationURI('question/create/'); $crumbs ->addAction( id(new PHUIListItemView()) - ->setName(pht('Create Question')) - ->setHref('/ponder/question/edit/') + ->setName(pht('Ask Question')) + ->setHref($href) ->setIcon('fa-plus-square')); return $crumbs; } }