mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 00:10:57 +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:
parent
ef7cc5df24
commit
b80f5e9105
4 changed files with 42 additions and 11 deletions
|
@ -5,18 +5,36 @@
|
|||
*/
|
||||
abstract class PholioController extends PhabricatorController {
|
||||
|
||||
public function buildSideNav() {
|
||||
public function buildSideNav($filter = null, $for_app = false) {
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
$nav->addLabel('Create');
|
||||
$nav->addFilter('new', pht('Create Mock'));
|
||||
|
||||
$nav->addLabel('Mocks');
|
||||
$nav->addFilter('view/all', pht('All Mocks'));
|
||||
|
||||
if ($for_app) {
|
||||
$nav->addFilter('new/', pht('Create Mock'));
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ final class PholioMockEditController extends PholioController {
|
|||
}
|
||||
|
||||
if (!$files) {
|
||||
$e_images = 'Required';
|
||||
$e_images = pht('Required');
|
||||
$errors[] = pht('You must add at least one image to the mock.');
|
||||
} else {
|
||||
$mock->setCoverPHID(head($files)->getPHID());
|
||||
|
@ -211,6 +211,7 @@ final class PholioMockEditController extends PholioController {
|
|||
$nav,
|
||||
array(
|
||||
'title' => $title,
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ final class PholioMockListController extends PholioController {
|
|||
switch ($filter) {
|
||||
case 'view/all':
|
||||
default:
|
||||
$title = 'All Mocks';
|
||||
$title = pht('All Mocks');
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -44,21 +44,26 @@ final class PholioMockListController extends PholioController {
|
|||
->setImageSize(220, 165));
|
||||
}
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($title);
|
||||
|
||||
$content = array(
|
||||
$header,
|
||||
$board,
|
||||
$pager,
|
||||
);
|
||||
|
||||
$nav->appendChild($content);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav());
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName($title)
|
||||
->setHref($this->getApplicationURI())
|
||||
);
|
||||
$nav->setCrumbs($crumbs);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => $title,
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,15 @@ final class PholioMockViewController extends PholioController {
|
|||
|
||||
$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(
|
||||
$crumbs,
|
||||
$header,
|
||||
$actions,
|
||||
$properties,
|
||||
|
@ -83,7 +91,6 @@ final class PholioMockViewController extends PholioController {
|
|||
$add_comment,
|
||||
);
|
||||
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$content,
|
||||
array(
|
||||
|
|
Loading…
Reference in a new issue