mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Put some crumbs on some project pages
Summary: Ref T10010. This is primarily to make "Parent > Child > Grandchild" navigation more manageable for subprojects, at least for now. Test Plan: Viewed profile, members, feed; saw crumbs. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10010 Differential Revision: https://secure.phabricator.com/D14891
This commit is contained in:
parent
5e715c1aca
commit
2b5d4bca8a
5 changed files with 43 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue