Move search, new room into thread column in Conpherence
Summary:
Moves search and new room out of crumb bar and into the thread column. This opens up space to add "Edit Room" into the crumbs area as an action link. Also removed 'widget-edit' pathways and javascript.
Fixes T8972
Test Plan:
Search, New, Edit rooms. Click different rooms, see correct URL each time.
{F1813226}
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: Korvin
Maniphest Tasks: T8972
Differential Revision: https://secure.phabricator.com/D16543
This commit is contained in:
@@ -38,28 +38,8 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||
$crumbs = parent::buildApplicationCrumbs();
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$crumbs->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setName(pht('Search'))
|
||||
->setHref($this->getApplicationURI('search/'))
|
||||
->setIcon('fa-search'));
|
||||
|
||||
if ($is_rooms) {
|
||||
if (!$is_rooms) {
|
||||
$crumbs
|
||||
->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setName(pht('New Room'))
|
||||
->setHref($this->getApplicationURI('new/'))
|
||||
->setIcon('fa-plus-square')
|
||||
->setWorkflow(true));
|
||||
} else {
|
||||
$crumbs
|
||||
->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setName(pht('New Room'))
|
||||
->setHref($this->getApplicationURI('new/'))
|
||||
->setIcon('fa-plus-square')
|
||||
->setWorkflow(true))
|
||||
->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setName(pht('Room'))
|
||||
@@ -76,6 +56,7 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||
ConpherenceThread $conpherence,
|
||||
array $policy_objects) {
|
||||
assert_instances_of($policy_objects, 'PhabricatorPolicy');
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$data = $conpherence->getDisplayData($this->getViewer());
|
||||
@@ -84,6 +65,21 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||
->setName($data['title'])
|
||||
->setHref('/'.$conpherence->getMonogram()));
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$conpherence,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$crumbs
|
||||
->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->setName(pht('Edit Room'))
|
||||
->setHref(
|
||||
$this->getApplicationURI('update/'.$conpherence->getID()).'/')
|
||||
->setIcon('fa-pencil')
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
return hsprintf(
|
||||
'%s',
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user