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:
parent
0b1410b1d7
commit
c51f45fbcd
13 changed files with 56 additions and 40 deletions
|
@ -39,6 +39,7 @@ final class DrydockLeaseViewController extends DrydockController {
|
|||
$log_table->appendChild($pager);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setActionList($actions);
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName($title)
|
||||
|
|
|
@ -51,6 +51,7 @@ final class DrydockResourceViewController extends DrydockController {
|
|||
$log_table->appendChild($pager);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setActionList($actions);
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Resource %d', $resource->getID())));
|
||||
|
|
|
@ -22,15 +22,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
|||
}
|
||||
|
||||
$this->loadHandles(array($file->getAuthorPHID()));
|
||||
|
||||
$phid = $file->getPHID();
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName('F'.$file->getID())
|
||||
->setHref($this->getApplicationURI("/info/{$phid}/")));
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($file->getName());
|
||||
|
||||
|
@ -45,6 +37,13 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
|
|||
$actions = $this->buildActionView($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(
|
||||
array(
|
||||
$crumbs,
|
||||
|
|
|
@ -30,14 +30,15 @@ final class PhabricatorMacroViewController
|
|||
$macro->getPHID());
|
||||
|
||||
$this->loadHandles($subscribers);
|
||||
$actions = $this->buildActionView($macro);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setActionList($actions);
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setHref($this->getApplicationURI('/view/'.$macro->getID().'/'))
|
||||
->setName($title_short));
|
||||
|
||||
$actions = $this->buildActionView($macro);
|
||||
$properties = $this->buildPropertyView($macro, $file, $subscribers);
|
||||
|
||||
$xactions = id(new PhabricatorMacroTransactionQuery())
|
||||
|
|
|
@ -53,6 +53,7 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
|
|||
$source_code = $this->buildSourceCodeView($paste);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView())
|
||||
->setActionList($actions)
|
||||
->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName('P'.$paste->getID())
|
||||
|
|
|
@ -85,6 +85,7 @@ final class PholioMockViewController extends PholioController {
|
|||
$add_comment = $this->buildAddCommentView($mock);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav());
|
||||
$crumbs->setActionList($actions);
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName('M'.$mock->getID())
|
||||
|
|
|
@ -47,6 +47,8 @@ final class PhortuneAccountViewController extends PhortuneController {
|
|||
->setHref('#')
|
||||
->setDisabled(true));
|
||||
|
||||
$crumbs->setActionList($actions);
|
||||
|
||||
$properties = id(new PhabricatorPropertyListView())
|
||||
->setObject($account)
|
||||
->setUser($user);
|
||||
|
|
|
@ -23,16 +23,6 @@ final class PhortuneProductViewController extends PhabricatorController {
|
|||
|
||||
$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())
|
||||
->setHeader($product->getProductName());
|
||||
|
||||
|
@ -46,6 +36,17 @@ final class PhortuneProductViewController extends PhabricatorController {
|
|||
->setHref($edit_uri)
|
||||
->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())
|
||||
->setUser($user)
|
||||
->addProperty(pht('Type'), $product->getTypeName())
|
||||
|
|
|
@ -224,14 +224,15 @@ final class PhrictionDocumentController
|
|||
|
||||
$children = $this->renderDocumentChildren($slug);
|
||||
|
||||
$actions = $this->buildActionView($user, $document);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setActionList($actions);
|
||||
$crumb_views = $this->renderBreadcrumbs($slug);
|
||||
foreach ($crumb_views as $view) {
|
||||
$crumbs->addCrumb($view);
|
||||
}
|
||||
|
||||
$actions = $this->buildActionView($user, $document);
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($page_title);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ abstract class PonderController extends PhabricatorController {
|
|||
public function buildStandardPageResponse($view, array $data) {
|
||||
|
||||
$page = $this->buildStandardPageView();
|
||||
$page->setApplicationName('Ponder!');
|
||||
$page->setApplicationName(pht('Ponder!'));
|
||||
$page->setBaseURI('/ponder/');
|
||||
$page->setTitle(idx($data, 'title'));
|
||||
$page->setGlyph("\xE2\x97\xB3");
|
||||
|
@ -20,24 +20,24 @@ abstract class PonderController extends PhabricatorController {
|
|||
$side_nav = new AphrontSideNavFilterView();
|
||||
$side_nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
if ($question && $question->getID()) {
|
||||
$side_nav->addFilter(
|
||||
null,
|
||||
'Q'.$question->getID(),
|
||||
'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');
|
||||
$side_nav->addLabel(pht('Questions'));
|
||||
$side_nav->addFilter('feed', pht('All Questions'));
|
||||
$side_nav->addFilter('questions', pht('Your Questions'));
|
||||
$side_nav->addFilter('answers', pht('Your Answers'));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ final class PonderFeedController extends PonderController {
|
|||
array(
|
||||
'device' => true,
|
||||
'title' => $title,
|
||||
'dust' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -64,15 +64,22 @@ final class PonderQuestionViewController extends PonderController {
|
|||
->setActionURI("/ponder/answer/add/");
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setObjectName('Q'.$question->getID())
|
||||
->setHeader($question->getTitle());
|
||||
|
||||
$actions = $this->buildActionListView($question);
|
||||
$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->appendChild(
|
||||
array(
|
||||
$crumbs,
|
||||
$header,
|
||||
$actions,
|
||||
$properties,
|
||||
|
|
|
@ -30,7 +30,7 @@ final class PhabricatorCrumbsView extends AphrontView {
|
|||
require_celerity_resource('phabricator-crumbs-view-css');
|
||||
|
||||
$action_view = null;
|
||||
if ($this->actions) {
|
||||
if (($this->actions) || ($this->actionListID)) {
|
||||
$actions = array();
|
||||
foreach ($this->actions as $action) {
|
||||
$icon = null;
|
||||
|
|
Loading…
Reference in a new issue