1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

Add actions to mobile crumbs

Summary: Adds in the ActionList into Crumbs for mobile on many applications.

Test Plan: Tested each application except probably drydock since not sure how to test that. Also cleaned up Ponder a little.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5648
This commit is contained in:
Chad Little 2013-04-10 13:08:36 -07:00
parent 0b1410b1d7
commit c51f45fbcd
13 changed files with 56 additions and 40 deletions

View file

@ -39,6 +39,7 @@ final class DrydockLeaseViewController extends DrydockController {
$log_table->appendChild($pager); $log_table->appendChild($pager);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName($title) ->setName($title)

View file

@ -51,6 +51,7 @@ final class DrydockResourceViewController extends DrydockController {
$log_table->appendChild($pager); $log_table->appendChild($pager);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName(pht('Resource %d', $resource->getID()))); ->setName(pht('Resource %d', $resource->getID())));

View file

@ -22,15 +22,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
} }
$this->loadHandles(array($file->getAuthorPHID())); $this->loadHandles(array($file->getAuthorPHID()));
$phid = $file->getPHID(); $phid = $file->getPHID();
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName('F'.$file->getID())
->setHref($this->getApplicationURI("/info/{$phid}/")));
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setHeader($file->getName()); ->setHeader($file->getName());
@ -45,6 +37,13 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
$actions = $this->buildActionView($file); $actions = $this->buildActionView($file);
$properties = $this->buildPropertyView($file); $properties = $this->buildPropertyView($file);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName('F'.$file->getID())
->setHref($this->getApplicationURI("/info/{$phid}/")));
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$crumbs, $crumbs,

View file

@ -30,14 +30,15 @@ final class PhabricatorMacroViewController
$macro->getPHID()); $macro->getPHID());
$this->loadHandles($subscribers); $this->loadHandles($subscribers);
$actions = $this->buildActionView($macro);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setHref($this->getApplicationURI('/view/'.$macro->getID().'/')) ->setHref($this->getApplicationURI('/view/'.$macro->getID().'/'))
->setName($title_short)); ->setName($title_short));
$actions = $this->buildActionView($macro);
$properties = $this->buildPropertyView($macro, $file, $subscribers); $properties = $this->buildPropertyView($macro, $file, $subscribers);
$xactions = id(new PhabricatorMacroTransactionQuery()) $xactions = id(new PhabricatorMacroTransactionQuery())

View file

@ -53,6 +53,7 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
$source_code = $this->buildSourceCodeView($paste); $source_code = $this->buildSourceCodeView($paste);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()) $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView())
->setActionList($actions)
->addCrumb( ->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName('P'.$paste->getID()) ->setName('P'.$paste->getID())

View file

@ -85,6 +85,7 @@ final class PholioMockViewController extends PholioController {
$add_comment = $this->buildAddCommentView($mock); $add_comment = $this->buildAddCommentView($mock);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav()); $crumbs = $this->buildApplicationCrumbs($this->buildSideNav());
$crumbs->setActionList($actions);
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName('M'.$mock->getID()) ->setName('M'.$mock->getID())

View file

@ -47,6 +47,8 @@ final class PhortuneAccountViewController extends PhortuneController {
->setHref('#') ->setHref('#')
->setDisabled(true)); ->setDisabled(true));
$crumbs->setActionList($actions);
$properties = id(new PhabricatorPropertyListView()) $properties = id(new PhabricatorPropertyListView())
->setObject($account) ->setObject($account)
->setUser($user); ->setUser($user);

View file

@ -23,16 +23,6 @@ final class PhortuneProductViewController extends PhabricatorController {
$title = pht('Product: %s', $product->getProductName()); $title = pht('Product: %s', $product->getProductName());
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName(pht('Products'))
->setHref($this->getApplicationURI('product/')));
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName(pht('#%d', $product->getID()))
->setHref($request->getRequestURI()));
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setHeader($product->getProductName()); ->setHeader($product->getProductName());
@ -46,6 +36,17 @@ final class PhortuneProductViewController extends PhabricatorController {
->setHref($edit_uri) ->setHref($edit_uri)
->setIcon('edit')); ->setIcon('edit'));
$crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName(pht('Products'))
->setHref($this->getApplicationURI('product/')));
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName(pht('#%d', $product->getID()))
->setHref($request->getRequestURI()));
$properties = id(new PhabricatorPropertyListView()) $properties = id(new PhabricatorPropertyListView())
->setUser($user) ->setUser($user)
->addProperty(pht('Type'), $product->getTypeName()) ->addProperty(pht('Type'), $product->getTypeName())

View file

@ -224,14 +224,15 @@ final class PhrictionDocumentController
$children = $this->renderDocumentChildren($slug); $children = $this->renderDocumentChildren($slug);
$actions = $this->buildActionView($user, $document);
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumb_views = $this->renderBreadcrumbs($slug); $crumb_views = $this->renderBreadcrumbs($slug);
foreach ($crumb_views as $view) { foreach ($crumb_views as $view) {
$crumbs->addCrumb($view); $crumbs->addCrumb($view);
} }
$actions = $this->buildActionView($user, $document);
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setHeader($page_title); ->setHeader($page_title);

View file

@ -5,7 +5,7 @@ abstract class PonderController extends PhabricatorController {
public function buildStandardPageResponse($view, array $data) { public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView(); $page = $this->buildStandardPageView();
$page->setApplicationName('Ponder!'); $page->setApplicationName(pht('Ponder!'));
$page->setBaseURI('/ponder/'); $page->setBaseURI('/ponder/');
$page->setTitle(idx($data, 'title')); $page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x97\xB3"); $page->setGlyph("\xE2\x97\xB3");
@ -20,24 +20,24 @@ abstract class PonderController extends PhabricatorController {
$side_nav = new AphrontSideNavFilterView(); $side_nav = new AphrontSideNavFilterView();
$side_nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $side_nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($question && $question->getID()) { $side_nav->addLabel(pht('Questions'));
$side_nav->addFilter( $side_nav->addFilter('feed', pht('All Questions'));
null, $side_nav->addFilter('questions', pht('Your Questions'));
'Q'.$question->getID(), $side_nav->addFilter('answers', pht('Your Answers'));
'Q'.$question->getID());
}
$side_nav->addLabel('Create');
$side_nav->addFilter('question/ask', 'Ask a Question');
$side_nav->addLabel('Questions');
$side_nav->addFilter('feed', 'All Questions');
$side_nav->addLabel('User');
$side_nav->addFilter('questions', 'Your Questions');
$side_nav->addFilter('answers', 'Your Answers');
return $side_nav; return $side_nav;
} }
public function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs
->addAction(
id(new PhabricatorMenuItemView())
->setName(pht('New Question'))
->setHref('question/ask')
->setIcon('create'));
return $crumbs;
}
} }

View file

@ -80,6 +80,7 @@ final class PonderFeedController extends PonderController {
array( array(
'device' => true, 'device' => true,
'title' => $title, 'title' => $title,
'dust' => true,
)); ));
} }

View file

@ -64,15 +64,22 @@ final class PonderQuestionViewController extends PonderController {
->setActionURI("/ponder/answer/add/"); ->setActionURI("/ponder/answer/add/");
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setObjectName('Q'.$question->getID())
->setHeader($question->getTitle()); ->setHeader($question->getTitle());
$actions = $this->buildActionListView($question); $actions = $this->buildActionListView($question);
$properties = $this->buildPropertyListView($question, $subscribers); $properties = $this->buildPropertyListView($question, $subscribers);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView());
$crumbs->setActionList($actions);
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName('Q'.$this->questionID)
->setHref('/Q'.$this->questionID));
$nav = $this->buildSideNavView($question); $nav = $this->buildSideNavView($question);
$nav->appendChild( $nav->appendChild(
array( array(
$crumbs,
$header, $header,
$actions, $actions,
$properties, $properties,

View file

@ -30,7 +30,7 @@ final class PhabricatorCrumbsView extends AphrontView {
require_celerity_resource('phabricator-crumbs-view-css'); require_celerity_resource('phabricator-crumbs-view-css');
$action_view = null; $action_view = null;
if ($this->actions) { if (($this->actions) || ($this->actionListID)) {
$actions = array(); $actions = array();
foreach ($this->actions as $action) { foreach ($this->actions as $action) {
$icon = null; $icon = null;