Provide convenience method addTextCrumb() to PhabricatorCrumbsView
Summary: We currently have a lot of calls to `addCrumb(id(new PhabricatorCrumbView())->...)` which can be expressed much more simply with a convenience method. Nearly all crumbs are only textual. Test Plan: - This was mostly automated, then I cleaned up a few unusual sites manually. - Bunch of grep / randomly clicking around. Reviewers: btrahan, chad Reviewed By: btrahan CC: hach-que, aran Differential Revision: https://secure.phabricator.com/D7787
This commit is contained in:
@@ -11,20 +11,12 @@ abstract class DiffusionRepositoryEditController
|
||||
$repo_uri = $this->getRepositoryControllerURI($repository, '');
|
||||
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
|
||||
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName('r'.$repository->getCallsign())
|
||||
->setHref($repo_uri));
|
||||
$crumbs->addTextCrumb('r'.$repository->getCallsign(), $repo_uri);
|
||||
|
||||
if ($is_main) {
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Edit Repository')));
|
||||
$crumbs->addTextCrumb(pht('Edit Repository'));
|
||||
} else {
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Edit'))
|
||||
->setHref($edit_uri));
|
||||
$crumbs->addTextCrumb(pht('Edit'), $edit_uri);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user