mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Put "Subprojects" on top of "Milestones" in the Project UI
Summary: Depends on D19550. Ref T13164. See T12144#226172, mostly. We get some requests to make milestones reorderable, but in most cases users probably wanted subprojects, not milestones. One reason to end up here is that we put "Milestones" on top. Instead, put "Subprojects" on top, since they're the less specialized option and we aren't terribly consistent about it anyway. Test Plan: Viewed project subprojects page, saw "Subprojects" above "Milestones". Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13164 Differential Revision: https://secure.phabricator.com/D19551
This commit is contained in:
parent
45babe82f3
commit
96e3c73159
1 changed files with 31 additions and 32 deletions
|
@ -106,8 +106,8 @@ final class PhabricatorProjectSubprojectsController
|
||||||
->addClass('project-view-people-home')
|
->addClass('project-view-people-home')
|
||||||
->setMainColumn(array(
|
->setMainColumn(array(
|
||||||
$info_view,
|
$info_view,
|
||||||
$milestone_list,
|
|
||||||
$subproject_list,
|
$subproject_list,
|
||||||
|
$milestone_list,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $this->newPage()
|
return $this->newPage()
|
||||||
|
@ -132,28 +132,11 @@ final class PhabricatorProjectSubprojectsController
|
||||||
$project,
|
$project,
|
||||||
PhabricatorPolicyCapability::CAN_EDIT);
|
PhabricatorPolicyCapability::CAN_EDIT);
|
||||||
|
|
||||||
$allows_milestones = $project->supportsMilestones();
|
|
||||||
$allows_subprojects = $project->supportsSubprojects();
|
$allows_subprojects = $project->supportsSubprojects();
|
||||||
|
$allows_milestones = $project->supportsMilestones();
|
||||||
|
|
||||||
$curtain = $this->newCurtainView();
|
$curtain = $this->newCurtainView();
|
||||||
|
|
||||||
if ($allows_milestones && $milestones) {
|
|
||||||
$milestone_text = pht('Create Next Milestone');
|
|
||||||
} else {
|
|
||||||
$milestone_text = pht('Create Milestone');
|
|
||||||
}
|
|
||||||
|
|
||||||
$can_milestone = ($can_create && $can_edit && $allows_milestones);
|
|
||||||
$milestone_href = "/project/edit/?milestone={$id}";
|
|
||||||
|
|
||||||
$curtain->addAction(
|
|
||||||
id(new PhabricatorActionView())
|
|
||||||
->setName($milestone_text)
|
|
||||||
->setIcon('fa-plus')
|
|
||||||
->setHref($milestone_href)
|
|
||||||
->setDisabled(!$can_milestone)
|
|
||||||
->setWorkflow(!$can_milestone));
|
|
||||||
|
|
||||||
$can_subproject = ($can_create && $can_edit && $allows_subprojects);
|
$can_subproject = ($can_create && $can_edit && $allows_subprojects);
|
||||||
|
|
||||||
// If we're offering to create the first subproject, we're going to warn
|
// If we're offering to create the first subproject, we're going to warn
|
||||||
|
@ -176,22 +159,22 @@ final class PhabricatorProjectSubprojectsController
|
||||||
->setDisabled($subproject_disabled)
|
->setDisabled($subproject_disabled)
|
||||||
->setWorkflow($subproject_workflow));
|
->setWorkflow($subproject_workflow));
|
||||||
|
|
||||||
|
if ($allows_milestones && $milestones) {
|
||||||
if (!$project->supportsMilestones()) {
|
$milestone_text = pht('Create Next Milestone');
|
||||||
$note = pht(
|
|
||||||
'This project is already a milestone, and milestones may not '.
|
|
||||||
'have their own milestones.');
|
|
||||||
} else {
|
} else {
|
||||||
if (!$milestones) {
|
$milestone_text = pht('Create Milestone');
|
||||||
$note = pht('Milestones can be created for this project.');
|
|
||||||
} else {
|
|
||||||
$note = pht('This project has milestones.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$curtain->newPanel()
|
$can_milestone = ($can_create && $can_edit && $allows_milestones);
|
||||||
->setHeaderText(pht('Milestones'))
|
$milestone_href = "/project/edit/?milestone={$id}";
|
||||||
->appendChild($note);
|
|
||||||
|
$curtain->addAction(
|
||||||
|
id(new PhabricatorActionView())
|
||||||
|
->setName($milestone_text)
|
||||||
|
->setIcon('fa-plus')
|
||||||
|
->setHref($milestone_href)
|
||||||
|
->setDisabled(!$can_milestone)
|
||||||
|
->setWorkflow(!$can_milestone));
|
||||||
|
|
||||||
if (!$project->supportsSubprojects()) {
|
if (!$project->supportsSubprojects()) {
|
||||||
$note = pht(
|
$note = pht(
|
||||||
|
@ -209,6 +192,22 @@ final class PhabricatorProjectSubprojectsController
|
||||||
->setHeaderText(pht('Subprojects'))
|
->setHeaderText(pht('Subprojects'))
|
||||||
->appendChild($note);
|
->appendChild($note);
|
||||||
|
|
||||||
|
if (!$project->supportsSubprojects()) {
|
||||||
|
$note = pht(
|
||||||
|
'This project is already a milestone, and milestones may not '.
|
||||||
|
'have their own milestones.');
|
||||||
|
} else {
|
||||||
|
if (!$milestones) {
|
||||||
|
$note = pht('Milestones can be created for this project.');
|
||||||
|
} else {
|
||||||
|
$note = pht('This project has milestones.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$curtain->newPanel()
|
||||||
|
->setHeaderText(pht('Milestones'))
|
||||||
|
->appendChild($note);
|
||||||
|
|
||||||
return $curtain;
|
return $curtain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue