Move member/watch actions to "Members/Watchers" page
Summary:
Ref T10054. This tries to make the members page a bit more consistent and provide hints to users about subproject/milestone membership rules. In particular:
- You now join, leave, watch, unwatch, add and remove members, and lock and unlock membership from the members screen.
- We now explain the membership rule for the project on this screen. There are currently four rules:
- Normal Project: Join/leave normally.
- Parent Project: Uses subprojects to determine members.
- Milestone: Uses parent project to determine members.
- Locked: Membership is locked.
- (Future) Imported from LDAP/other external sources: Membership is determined by something else.
Test Plan: {F1064878}
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T10054
Differential Revision: https://secure.phabricator.com/D15059
This commit is contained in:
@@ -106,65 +106,6 @@ final class PhabricatorProjectProfileController
|
||||
->setWorkflow(true));
|
||||
}
|
||||
|
||||
$can_lock = $can_edit && $this->hasApplicationCapability(
|
||||
ProjectCanLockProjectsCapability::CAPABILITY);
|
||||
|
||||
if ($project->getIsMembershipLocked()) {
|
||||
$lock_name = pht('Unlock Project');
|
||||
$lock_icon = 'fa-unlock';
|
||||
} else {
|
||||
$lock_name = pht('Lock Project');
|
||||
$lock_icon = 'fa-lock';
|
||||
}
|
||||
|
||||
$view->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName($lock_name)
|
||||
->setIcon($lock_icon)
|
||||
->setHref($this->getApplicationURI("lock/{$id}/"))
|
||||
->setDisabled(!$can_lock)
|
||||
->setWorkflow(true));
|
||||
|
||||
$action = null;
|
||||
if (!$project->isUserMember($viewer->getPHID())) {
|
||||
$can_join = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$project,
|
||||
PhabricatorPolicyCapability::CAN_JOIN);
|
||||
|
||||
$action = id(new PhabricatorActionView())
|
||||
->setUser($viewer)
|
||||
->setRenderAsForm(true)
|
||||
->setHref('/project/update/'.$project->getID().'/join/')
|
||||
->setIcon('fa-plus')
|
||||
->setDisabled(!$can_join)
|
||||
->setName(pht('Join Project'));
|
||||
$view->addAction($action);
|
||||
} else {
|
||||
$action = id(new PhabricatorActionView())
|
||||
->setWorkflow(true)
|
||||
->setHref('/project/update/'.$project->getID().'/leave/')
|
||||
->setIcon('fa-times')
|
||||
->setName(pht('Leave Project...'));
|
||||
$view->addAction($action);
|
||||
|
||||
if (!$project->isUserWatcher($viewer->getPHID())) {
|
||||
$action = id(new PhabricatorActionView())
|
||||
->setWorkflow(true)
|
||||
->setHref('/project/watch/'.$project->getID().'/')
|
||||
->setIcon('fa-eye')
|
||||
->setName(pht('Watch Project'));
|
||||
$view->addAction($action);
|
||||
} else {
|
||||
$action = id(new PhabricatorActionView())
|
||||
->setWorkflow(true)
|
||||
->setHref('/project/unwatch/'.$project->getID().'/')
|
||||
->setIcon('fa-eye-slash')
|
||||
->setName(pht('Unwatch Project'));
|
||||
$view->addAction($action);
|
||||
}
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
@@ -206,18 +147,10 @@ final class PhabricatorProjectProfileController
|
||||
->setAsInline(true)
|
||||
: phutil_tag('em', array(), pht('None')));
|
||||
|
||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
$viewer,
|
||||
$project);
|
||||
|
||||
$view->addProperty(
|
||||
pht('Looks Like'),
|
||||
$viewer->renderHandle($project->getPHID())->setAsTag(true));
|
||||
|
||||
$view->addProperty(
|
||||
pht('Joinable By'),
|
||||
$descriptions[PhabricatorPolicyCapability::CAN_JOIN]);
|
||||
|
||||
$field_list = PhabricatorCustomField::getObjectFields(
|
||||
$project,
|
||||
PhabricatorCustomField::ROLE_VIEW);
|
||||
|
||||
Reference in New Issue
Block a user