Add a breadcrumbs element

Summary:
Add a basic breadcrumbs element, and implement it in Paste.

This needs some polish but is most of the way there.

Test Plan:
{F26443}
{F26444}
{F26445}

(This element is not visible on devices.)

Reviewers: chad

Reviewed By: chad

CC: aran, btrahan

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4087
This commit is contained in:
epriestley
2012-12-07 13:35:17 -08:00
parent f910e38ecc
commit 1c9a6be979
18 changed files with 354 additions and 179 deletions

View File

@@ -173,27 +173,35 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
if (!$is_create) {
$submit->addCancelButton($paste->getURI());
$submit->setValue('Save Paste');
$title = 'Edit '.$paste->getFullName();
$submit->setValue(pht('Save Paste'));
$title = pht('Edit %s', $paste->getFullName());
$short = pht('Edit');
} else {
$submit->setValue('Create Paste');
$title = 'Create Paste';
$submit->setValue(pht('Create Paste'));
$title = pht('Create Paste');
$short = pht('Create');
}
$form
->appendChild($submit);
$nav = $this->buildSideNavView();
$nav->selectFilter('edit');
$nav->appendChild(
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView());
if (!$is_create) {
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName('P'.$paste->getID())
->setHref('/P'.$paste->getID()));
}
$crumbs->addCrumb(
id(new PhabricatorCrumbView())->setName($short));
return $this->buildApplicationPage(
array(
$crumbs,
id(new PhabricatorHeaderView())->setHeader($title),
$error_view,
$form,
));
return $this->buildApplicationPage(
$nav,
),
array(
'title' => $title,
'device' => true,