1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Pholio touchups

Summary: Added crumbs, phts some things, made mobile menus work.

Test Plan: Review Pholio in sb and ios.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2531

Differential Revision: https://secure.phabricator.com/D4973
This commit is contained in:
Chad Little 2013-02-15 10:17:31 -08:00
parent ef7cc5df24
commit b80f5e9105
4 changed files with 42 additions and 11 deletions

View file

@ -5,18 +5,36 @@
*/ */
abstract class PholioController extends PhabricatorController { abstract class PholioController extends PhabricatorController {
public function buildSideNav() { public function buildSideNav($filter = null, $for_app = false) {
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel('Create');
$nav->addFilter('new', pht('Create Mock'));
$nav->addLabel('Mocks'); $nav->addLabel('Mocks');
$nav->addFilter('view/all', pht('All Mocks')); $nav->addFilter('view/all', pht('All Mocks'));
if ($for_app) {
$nav->addFilter('new/', pht('Create Mock'));
}
return $nav; return $nav;
} }
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('Create Mock'))
->setHref($this->getApplicationURI('new/'))
->setIcon('create'));
return $crumbs;
}
public function buildApplicationMenu() {
return $this->buildSideNav(null, true)->getMenu();
}
} }

View file

@ -87,7 +87,7 @@ final class PholioMockEditController extends PholioController {
} }
if (!$files) { if (!$files) {
$e_images = 'Required'; $e_images = pht('Required');
$errors[] = pht('You must add at least one image to the mock.'); $errors[] = pht('You must add at least one image to the mock.');
} else { } else {
$mock->setCoverPHID(head($files)->getPHID()); $mock->setCoverPHID(head($files)->getPHID());
@ -211,6 +211,7 @@ final class PholioMockEditController extends PholioController {
$nav, $nav,
array( array(
'title' => $title, 'title' => $title,
'device' => true,
)); ));
} }

View file

@ -25,7 +25,7 @@ final class PholioMockListController extends PholioController {
switch ($filter) { switch ($filter) {
case 'view/all': case 'view/all':
default: default:
$title = 'All Mocks'; $title = pht('All Mocks');
break; break;
} }
@ -44,21 +44,26 @@ final class PholioMockListController extends PholioController {
->setImageSize(220, 165)); ->setImageSize(220, 165));
} }
$header = id(new PhabricatorHeaderView())
->setHeader($title);
$content = array( $content = array(
$header,
$board, $board,
$pager, $pager,
); );
$nav->appendChild($content); $nav->appendChild($content);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav());
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName($title)
->setHref($this->getApplicationURI())
);
$nav->setCrumbs($crumbs);
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => $title, 'title' => $title,
'device' => true,
)); ));
} }

View file

@ -74,7 +74,15 @@ final class PholioMockViewController extends PholioController {
$add_comment = $this->buildAddCommentView($mock); $add_comment = $this->buildAddCommentView($mock);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav());
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName($title)
->setHref($this->getApplicationURI().'M'.$this->id)
);
$content = array( $content = array(
$crumbs,
$header, $header,
$actions, $actions,
$properties, $properties,
@ -83,7 +91,6 @@ final class PholioMockViewController extends PholioController {
$add_comment, $add_comment,
); );
return $this->buildApplicationPage( return $this->buildApplicationPage(
$content, $content,
array( array(