mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Straighten out some crumbs and links for workboards
Summary: Ref T1344. Minor tweaks for crumb/link stuff -- @mikn has been doing some work here recently and I want to unblock him. Test Plan: Viewed board; viewed column edit screen. Reviewers: chad, btrahan Reviewed By: chad CC: mikn, aran Maniphest Tasks: T1344 Differential Revision: https://secure.phabricator.com/D7937
This commit is contained in:
parent
06d12bf58b
commit
3f180496e5
4 changed files with 35 additions and 18 deletions
|
@ -74,6 +74,15 @@ final class PhabricatorProjectBoardController
|
||||||
}
|
}
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->addTextCrumb(
|
||||||
|
$project->getName(),
|
||||||
|
$this->getApplicationURI('view/'.$project->getID().'/'));
|
||||||
|
$crumbs->addTextCrumb(pht('Board'));
|
||||||
|
|
||||||
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||||
|
$viewer,
|
||||||
|
$project,
|
||||||
|
PhabricatorPolicyCapability::CAN_EDIT);
|
||||||
|
|
||||||
$actions = id(new PhabricatorActionListView())
|
$actions = id(new PhabricatorActionListView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
|
@ -81,7 +90,9 @@ final class PhabricatorProjectBoardController
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Add Column/Milestone/Sprint'))
|
->setName(pht('Add Column/Milestone/Sprint'))
|
||||||
->setHref($this->getApplicationURI('board/'.$this->id.'/edit/'))
|
->setHref($this->getApplicationURI('board/'.$this->id.'/edit/'))
|
||||||
->setIcon('create'));
|
->setIcon('create')
|
||||||
|
->setDisabled(!$can_edit)
|
||||||
|
->setWorkflow(!$can_edit));
|
||||||
|
|
||||||
$plist = id(new PHUIPropertyListView());
|
$plist = id(new PHUIPropertyListView());
|
||||||
// TODO: Need this to get actions to render.
|
// TODO: Need this to get actions to render.
|
||||||
|
|
|
@ -112,6 +112,12 @@ final class PhabricatorProjectBoardEditController
|
||||||
->addCancelButton($view_uri));
|
->addCancelButton($view_uri));
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->addTextCrumb(
|
||||||
|
$project->getName(),
|
||||||
|
$this->getApplicationURI('view/'.$project->getID().'/'));
|
||||||
|
$crumbs->addTextCrumb(
|
||||||
|
pht('Board'),
|
||||||
|
$this->getApplicationURI('board/'.$project->getID().'/'));
|
||||||
$crumbs->addTextCrumb($title);
|
$crumbs->addTextCrumb($title);
|
||||||
|
|
||||||
$form_box = id(new PHUIObjectBoxView())
|
$form_box = id(new PHUIObjectBoxView())
|
||||||
|
|
|
@ -21,21 +21,4 @@ abstract class PhabricatorProjectController extends PhabricatorController {
|
||||||
return $nav;
|
return $nav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildApplicationCrumbs() {
|
|
||||||
$crumbs = parent::buildApplicationCrumbs();
|
|
||||||
|
|
||||||
$can_create = $this->hasApplicationCapability(
|
|
||||||
ProjectCapabilityCreateProjects::CAPABILITY);
|
|
||||||
|
|
||||||
$crumbs->addAction(
|
|
||||||
id(new PHUIListItemView())
|
|
||||||
->setName(pht('Create Project'))
|
|
||||||
->setHref($this->getApplicationURI('create/'))
|
|
||||||
->setIcon('create')
|
|
||||||
->setWorkflow(!$can_create)
|
|
||||||
->setDisabled(!$can_create));
|
|
||||||
|
|
||||||
return $crumbs;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,4 +51,21 @@ final class PhabricatorProjectListController
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function buildApplicationCrumbs() {
|
||||||
|
$crumbs = parent::buildApplicationCrumbs();
|
||||||
|
|
||||||
|
$can_create = $this->hasApplicationCapability(
|
||||||
|
ProjectCapabilityCreateProjects::CAPABILITY);
|
||||||
|
|
||||||
|
$crumbs->addAction(
|
||||||
|
id(new PHUIListItemView())
|
||||||
|
->setName(pht('Create Project'))
|
||||||
|
->setHref($this->getApplicationURI('create/'))
|
||||||
|
->setIcon('create')
|
||||||
|
->setWorkflow(!$can_create)
|
||||||
|
->setDisabled(!$can_create));
|
||||||
|
|
||||||
|
return $crumbs;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue