mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 02:31:10 +01:00
Update project manage page for two column
Summary: Fixes T10545. Converts layout to two column. Test Plan: Review a few project manage pages, see new layout and flag ability. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T10545 Differential Revision: https://secure.phabricator.com/D15450
This commit is contained in:
parent
1392872c5c
commit
2da9fcafbf
2 changed files with 26 additions and 28 deletions
|
@ -30,12 +30,8 @@ final class PhabricatorProjectManageController
|
||||||
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
$header->setStatus('fa-ban', 'red', pht('Archived'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$actions = $this->buildActionListView($project);
|
$curtain = $this->buildCurtain($project);
|
||||||
$properties = $this->buildPropertyListView($project, $actions);
|
$properties = $this->buildPropertyListView($project);
|
||||||
|
|
||||||
$object_box = id(new PHUIObjectBoxView())
|
|
||||||
->setHeader($header)
|
|
||||||
->addPropertyList($properties);
|
|
||||||
|
|
||||||
$timeline = $this->buildTransactionTimeline(
|
$timeline = $this->buildTransactionTimeline(
|
||||||
$project,
|
$project,
|
||||||
|
@ -47,6 +43,16 @@ final class PhabricatorProjectManageController
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
$crumbs->addTextCrumb(pht('Manage'));
|
$crumbs->addTextCrumb(pht('Manage'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
$manage = id(new PHUITwoColumnView())
|
||||||
|
->setHeader($header)
|
||||||
|
->setCurtain($curtain)
|
||||||
|
->addPropertySection(pht('DETAILS'), $properties)
|
||||||
|
->setMainColumn(
|
||||||
|
array(
|
||||||
|
$timeline,
|
||||||
|
));
|
||||||
|
|
||||||
return $this->newPage()
|
return $this->newPage()
|
||||||
->setNavigation($nav)
|
->setNavigation($nav)
|
||||||
|
@ -58,26 +64,22 @@ final class PhabricatorProjectManageController
|
||||||
))
|
))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
array(
|
array(
|
||||||
$object_box,
|
$manage,
|
||||||
$timeline,
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildActionListView(PhabricatorProject $project) {
|
private function buildCurtain(PhabricatorProject $project) {
|
||||||
$request = $this->getRequest();
|
$viewer = $this->getViewer();
|
||||||
$viewer = $request->getUser();
|
|
||||||
|
|
||||||
$id = $project->getID();
|
$id = $project->getID();
|
||||||
|
|
||||||
$view = id(new PhabricatorActionListView())
|
|
||||||
->setUser($viewer);
|
|
||||||
|
|
||||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||||
$viewer,
|
$viewer,
|
||||||
$project,
|
$project,
|
||||||
PhabricatorPolicyCapability::CAN_EDIT);
|
PhabricatorPolicyCapability::CAN_EDIT);
|
||||||
|
|
||||||
$view->addAction(
|
$curtain = $this->newCurtainView($project);
|
||||||
|
|
||||||
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Edit Details'))
|
->setName(pht('Edit Details'))
|
||||||
->setIcon('fa-pencil')
|
->setIcon('fa-pencil')
|
||||||
|
@ -85,7 +87,7 @@ final class PhabricatorProjectManageController
|
||||||
->setDisabled(!$can_edit)
|
->setDisabled(!$can_edit)
|
||||||
->setWorkflow(!$can_edit));
|
->setWorkflow(!$can_edit));
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Edit Menu'))
|
->setName(pht('Edit Menu'))
|
||||||
->setIcon('fa-th-list')
|
->setIcon('fa-th-list')
|
||||||
|
@ -93,7 +95,7 @@ final class PhabricatorProjectManageController
|
||||||
->setDisabled(!$can_edit)
|
->setDisabled(!$can_edit)
|
||||||
->setWorkflow(!$can_edit));
|
->setWorkflow(!$can_edit));
|
||||||
|
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Edit Picture'))
|
->setName(pht('Edit Picture'))
|
||||||
->setIcon('fa-picture-o')
|
->setIcon('fa-picture-o')
|
||||||
|
@ -102,7 +104,7 @@ final class PhabricatorProjectManageController
|
||||||
->setWorkflow(!$can_edit));
|
->setWorkflow(!$can_edit));
|
||||||
|
|
||||||
if ($project->isArchived()) {
|
if ($project->isArchived()) {
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Activate Project'))
|
->setName(pht('Activate Project'))
|
||||||
->setIcon('fa-check')
|
->setIcon('fa-check')
|
||||||
|
@ -110,7 +112,7 @@ final class PhabricatorProjectManageController
|
||||||
->setDisabled(!$can_edit)
|
->setDisabled(!$can_edit)
|
||||||
->setWorkflow(true));
|
->setWorkflow(true));
|
||||||
} else {
|
} else {
|
||||||
$view->addAction(
|
$curtain->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Archive Project'))
|
->setName(pht('Archive Project'))
|
||||||
->setIcon('fa-ban')
|
->setIcon('fa-ban')
|
||||||
|
@ -119,18 +121,15 @@ final class PhabricatorProjectManageController
|
||||||
->setWorkflow(true));
|
->setWorkflow(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $view;
|
return $curtain;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildPropertyListView(
|
private function buildPropertyListView(
|
||||||
PhabricatorProject $project,
|
PhabricatorProject $project) {
|
||||||
PhabricatorActionListView $actions) {
|
$viewer = $this->getViewer();
|
||||||
$request = $this->getRequest();
|
|
||||||
$viewer = $request->getUser();
|
|
||||||
|
|
||||||
$view = id(new PHUIPropertyListView())
|
$view = id(new PHUIPropertyListView())
|
||||||
->setUser($viewer)
|
->setUser($viewer);
|
||||||
->setActionList($actions);
|
|
||||||
|
|
||||||
$view->addProperty(
|
$view->addProperty(
|
||||||
pht('Looks Like'),
|
pht('Looks Like'),
|
||||||
|
|
|
@ -91,7 +91,6 @@ final class PhabricatorProjectProfileController
|
||||||
|
|
||||||
$home = id(new PHUITwoColumnView())
|
$home = id(new PHUITwoColumnView())
|
||||||
->setHeader($header)
|
->setHeader($header)
|
||||||
->setFluid(true)
|
|
||||||
->addClass('project-view-home')
|
->addClass('project-view-home')
|
||||||
->setMainColumn(
|
->setMainColumn(
|
||||||
array(
|
array(
|
||||||
|
|
Loading…
Reference in a new issue