1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Add mobile menu to Ponder

Summary: Ref T3578, adds mobile menus to Ponder

Test Plan: Test Ponder on mobile and desktop, click in Ask Question links

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T3578

Differential Revision: https://secure.phabricator.com/D13784
This commit is contained in:
Chad Little 2015-08-04 10:48:48 -07:00
parent ec7a0837d5
commit 328210a1a6
2 changed files with 34 additions and 13 deletions

View file

@ -48,17 +48,29 @@ final class PhabricatorPonderApplication extends PhabricatorApplication {
public function getRoutes() {
return array(
'/Q(?P<id>[1-9]\d*)' => 'PonderQuestionViewController',
'/Q(?P<id>[1-9]\d*)'
=> 'PonderQuestionViewController',
'/ponder/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PonderQuestionListController',
'answer/add/' => 'PonderAnswerSaveController',
'answer/edit/(?P<id>\d+)/' => 'PonderAnswerEditController',
'answer/comment/(?P<id>\d+)/' => 'PonderAnswerCommentController',
'answer/history/(?P<id>\d+)/' => 'PonderAnswerHistoryController',
'question/edit/(?:(?P<id>\d+)/)?' => 'PonderQuestionEditController',
'question/comment/(?P<id>\d+)/' => 'PonderQuestionCommentController',
'question/history/(?P<id>\d+)/' => 'PonderQuestionHistoryController',
'preview/' => 'PhabricatorMarkupPreviewController',
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PonderQuestionListController',
'answer/add/'
=> 'PonderAnswerSaveController',
'answer/edit/(?P<id>\d+)/'
=> 'PonderAnswerEditController',
'answer/comment/(?P<id>\d+)/'
=> 'PonderAnswerCommentController',
'answer/history/(?P<id>\d+)/'
=> 'PonderAnswerHistoryController',
'question/edit/(?:(?P<id>\d+)/)?'
=> 'PonderQuestionEditController',
'question/create/'
=> 'PonderQuestionEditController',
'question/comment/(?P<id>\d+)/'
=> 'PonderQuestionCommentController',
'question/history/(?P<id>\d+)/'
=> 'PonderQuestionHistoryController',
'preview/'
=> 'PhabricatorMarkupPreviewController',
'question/(?P<status>open|close)/(?P<id>[1-9]\d*)/'
=> 'PonderQuestionStatusController',
'vote/' => 'PonderVoteSaveController',

View file

@ -2,12 +2,16 @@
abstract class PonderController extends PhabricatorController {
protected function buildSideNavView() {
protected function buildSideNavView($for_app = false) {
$user = $this->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());
@ -17,13 +21,18 @@ abstract class PonderController extends PhabricatorController {
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;