1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +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:
epriestley 2014-01-12 21:39:50 -08:00
parent 06d12bf58b
commit 3f180496e5
4 changed files with 35 additions and 18 deletions

View file

@ -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.

View file

@ -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())

View file

@ -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;
}
} }

View file

@ -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;
}
} }