mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 02:32:42 +01:00
Fix several issues with "Logout"
Summary: Ref T1536. - When we render a dialog on a page by itself, put it on a dust background. - Currently, we render "Logout" in two different places. Stop doing that. - Make sure the surviving one has workflow so we get a modal ajax dialog if possible. Test Plan: {F46731} Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T1536 Differential Revision: https://secure.phabricator.com/D6226
This commit is contained in:
parent
9c29174bb4
commit
fe29b27582
3 changed files with 11 additions and 20 deletions
|
@ -21,12 +21,13 @@ final class PhabricatorApplicationAuth extends PhabricatorApplication {
|
|||
$items = array();
|
||||
|
||||
if ($user->isLoggedIn()) {
|
||||
$item = new PHUIListItemView();
|
||||
$item->setName(pht('Log Out'));
|
||||
$item->setIcon('power');
|
||||
$item->setWorkflow(true);
|
||||
$item->setHref('/logout/');
|
||||
$item->setSelected(($controller instanceof PhabricatorLogoutController));
|
||||
$item = id(new PHUIListItemView())
|
||||
->addClass('core-menu-item')
|
||||
->setName(pht('Log Out'))
|
||||
->setIcon('power')
|
||||
->setWorkflow(true)
|
||||
->setHref('/logout/')
|
||||
->setSelected(($controller instanceof PhabricatorLogoutController));
|
||||
$items[] = $item;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,6 +224,7 @@ abstract class PhabricatorController extends AphrontController {
|
|||
$view->appendChild(hsprintf(
|
||||
'<div style="padding: 2em 0;">%s</div>',
|
||||
$response->buildResponseString()));
|
||||
$view->setDust(true);
|
||||
$response = new AphrontWebpageResponse();
|
||||
$response->setContent($view->render());
|
||||
return $response;
|
||||
|
|
|
@ -146,11 +146,9 @@ final class PhabricatorMainMenuView extends AphrontView {
|
|||
|
||||
$actions = array();
|
||||
foreach ($applications as $application) {
|
||||
if ($application->shouldAppearInLaunchView()) {
|
||||
$app_actions = $application->buildMainMenuItems($user, $controller);
|
||||
foreach ($app_actions as $action) {
|
||||
$actions[] = $action;
|
||||
}
|
||||
$app_actions = $application->buildMainMenuItems($user, $controller);
|
||||
foreach ($app_actions as $action) {
|
||||
$actions[] = $action;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,15 +179,6 @@ final class PhabricatorMainMenuView extends AphrontView {
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->isLoggedIn()) {
|
||||
$view->addMenuItem(
|
||||
id(new PHUIListItemView())
|
||||
->addClass('core-menu-item')
|
||||
->setName(pht('Log Out'))
|
||||
->setHref('/logout/')
|
||||
->appendChild($this->renderMenuIcon('power-light-large')));
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue