diff --git a/src/applications/project/controller/PhabricatorProjectController.php b/src/applications/project/controller/PhabricatorProjectController.php index 2fcb276576..2f90c7d35b 100644 --- a/src/applications/project/controller/PhabricatorProjectController.php +++ b/src/applications/project/controller/PhabricatorProjectController.php @@ -154,4 +154,22 @@ abstract class PhabricatorProjectController extends PhabricatorController { return $nav; } + protected function buildApplicationCrumbs() { + $crumbs = parent::buildApplicationCrumbs(); + + $project = $this->getProject(); + if ($project) { + $ancestors = $project->getAncestorProjects(); + $ancestors = array_reverse($ancestors); + $ancestors[] = $project; + foreach ($ancestors as $ancestor) { + $crumbs->addTextCrumb( + $project->getName(), + $project->getURI()); + } + } + + return $crumbs; + } + } diff --git a/src/applications/project/controller/PhabricatorProjectFeedController.php b/src/applications/project/controller/PhabricatorProjectFeedController.php index 5cd74094fc..571148d2ce 100644 --- a/src/applications/project/controller/PhabricatorProjectFeedController.php +++ b/src/applications/project/controller/PhabricatorProjectFeedController.php @@ -37,11 +37,14 @@ final class PhabricatorProjectFeedController $nav->selectFilter("feed/{$id}/"); $nav->appendChild($box); - return $this->buildApplicationPage( - $nav, - array( - 'title' => $project->getName(), - )); + $crumbs = $this->buildApplicationCrumbs(); + $crumbs->addTextCrumb(pht('Feed')); + + return $this->newPage() + ->setNavigation($nav) + ->setCrumbs($crumbs) + ->setTitle(array($project->getName(), pht('Feed'))) + ->appendChild($box); } private function renderStories(array $stories) { diff --git a/src/applications/project/controller/PhabricatorProjectMembersEditController.php b/src/applications/project/controller/PhabricatorProjectMembersEditController.php index f007650e4a..b018e9389d 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersEditController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersEditController.php @@ -95,14 +95,16 @@ final class PhabricatorProjectMembersEditController $nav = $this->buildIconNavView($project); $nav->selectFilter("members/{$id}/"); - $nav->appendChild($form_box); - $nav->appendChild($member_list); - return $this->buildApplicationPage( - $nav, - array( - 'title' => $title, - )); + $crumbs = $this->buildApplicationCrumbs(); + $crumbs->addTextCrumb(pht('Members')); + + return $this->newPage() + ->setNavigation($nav) + ->setCrumbs($crumbs) + ->setTitle(array($project->getName(), $title)) + ->appendChild($form_box) + ->appendChild($member_list); } private function renderMemberList( diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index cc246b5a2d..fa443ebf6e 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -46,8 +46,11 @@ final class PhabricatorProjectProfileController $nav = $this->buildIconNavView($project); $nav->selectFilter("profile/{$id}/"); + $crumbs = $this->buildApplicationCrumbs(); + return $this->newPage() ->setNavigation($nav) + ->setCrumbs($crumbs) ->setTitle($project->getName()) ->setPageObjectPHIDs(array($project->getPHID())) ->appendChild($object_box) diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index afb4a32e61..6a4ed4afba 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -308,6 +308,11 @@ final class PhabricatorProject extends PhabricatorProjectDAO return $this->color; } + public function getURI() { + $id = $this->getID(); + return "/project/view/{$id}/"; + } + public function save() { if (!$this->getMailKey()) { $this->setMailKey(Filesystem::readRandomCharacters(20));