mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Add crumbs to Differential
Summary: Adds very basic crumbs to Differential, to prevent regression when we drop the application menu. I'll do a more proper pass at this but want to unblock landing the commit sequence for all this stuff. Test Plan: Looked at detail view and list view, saw crumbs, clicked them. Reviewers: chad Reviewed By: chad CC: aran Maniphest Tasks: T1960 Differential Revision: https://secure.phabricator.com/D4111
This commit is contained in:
parent
f306cab653
commit
cd2e39025e
6 changed files with 42 additions and 16 deletions
|
@ -24,4 +24,17 @@ abstract class DifferentialController extends PhabricatorController {
|
|||
return $response->setContent($page->render());
|
||||
}
|
||||
|
||||
public function buildApplicationCrumbs() {
|
||||
$crumbs = parent::buildApplicationCrumbs();
|
||||
|
||||
$create_uri = new PhutilURI('/differential/diff/create/');
|
||||
$crumbs->addAction(
|
||||
id(new PhabricatorMenuItemView())
|
||||
->setHref($this->getApplicationURI('/diff/create/'))
|
||||
->setName('Create Diff')
|
||||
->setIcon('create'));
|
||||
|
||||
return $crumbs;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -175,25 +175,24 @@ final class DifferentialRevisionListController extends DifferentialController {
|
|||
$filter_view = new AphrontListFilterView();
|
||||
$filter_view->appendChild($filter_form);
|
||||
|
||||
if (!$viewer_is_anonymous) {
|
||||
$create_uri = new PhutilURI('/differential/diff/create/');
|
||||
$filter_view->addButton(
|
||||
phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => (string)$create_uri,
|
||||
'class' => 'green button',
|
||||
),
|
||||
'Create Revision'));
|
||||
}
|
||||
|
||||
$side_nav->appendChild($filter_view);
|
||||
|
||||
foreach ($panels as $panel) {
|
||||
$side_nav->appendChild($panel);
|
||||
}
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$name = $side_nav
|
||||
->getMenu()
|
||||
->getItem($side_nav->getSelectedFilter())
|
||||
->getName();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName($name)
|
||||
->setHref($request->getRequestURI()));
|
||||
$side_nav->setCrumbs($crumbs);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$side_nav,
|
||||
array(
|
||||
'title' => 'Differential Home',
|
||||
|
|
|
@ -411,10 +411,19 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
$page_pane,
|
||||
));
|
||||
|
||||
$object_id = 'D'.$revision->getID();
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName($object_id)
|
||||
->setHref('/'.$object_id));
|
||||
$nav->setCrumbs($crumbs);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => 'D'.$revision->getID().' '.$revision->getTitle(),
|
||||
'title' => $object_id.' '.$revision->getTitle(),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ final class AphrontSideNavFilterView extends AphrontView {
|
|||
$uri = null) {
|
||||
|
||||
$item = id(new PhabricatorMenuItemView())
|
||||
->setKey($key)
|
||||
->setKey(strlen($key) ? $key : null)
|
||||
->setName($name);
|
||||
|
||||
if ($uri) {
|
||||
|
|
|
@ -43,7 +43,7 @@ final class PhabricatorCrumbView extends AphrontView {
|
|||
'span',
|
||||
array(
|
||||
'class' => 'phabricator-crumb-icon '.
|
||||
'sprite-apps-large app-'.$this->icon.'-dark',
|
||||
'sprite-apps-large app-'.$this->icon.'-dark-large',
|
||||
),
|
||||
'');
|
||||
}
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
vertical-align: top;
|
||||
|
||||
box-shadow: 0 1px rgba(0, 0, 0, 0.25);
|
||||
|
||||
/* TODO: Position this over the slider for Differential's file tree view.
|
||||
Remove this once that gets sorted out. */
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.phabricator-crumbs-view,
|
||||
|
|
Loading…
Reference in a new issue