mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Minor improvements to email management interface
Summary: - If you have an unverified primary email, we show a disabled "Primary" button right now in the "Status" column. Instead we should show an enabled "Verify" button, to allow you to re-send the verification email. - Sort addresses in a predictable way. Test Plan: - Added, verified and removed a secondary email address. - Resent verification email for primary address. - Changed primary address. Reviewers: btrahan, csilvers Reviewed By: btrahan CC: aran Maniphest Tasks: T1184 Differential Revision: https://secure.phabricator.com/D2548
This commit is contained in:
parent
65710ee2d2
commit
e12961802b
1 changed files with 45 additions and 35 deletions
|
@ -51,50 +51,60 @@ final class PhabricatorUserEmailSettingsPanelController
|
||||||
}
|
}
|
||||||
|
|
||||||
$emails = id(new PhabricatorUserEmail())->loadAllWhere(
|
$emails = id(new PhabricatorUserEmail())->loadAllWhere(
|
||||||
'userPHID = %s',
|
'userPHID = %s ORDER BY address',
|
||||||
$user->getPHID());
|
$user->getPHID());
|
||||||
|
|
||||||
$rowc = array();
|
$rowc = array();
|
||||||
$rows = array();
|
$rows = array();
|
||||||
foreach ($emails as $email) {
|
foreach ($emails as $email) {
|
||||||
|
|
||||||
|
$button_verify = javelin_render_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'class' => 'button small grey',
|
||||||
|
'href' => $uri->alter('verify', $email->getID()),
|
||||||
|
'sigil' => 'workflow',
|
||||||
|
),
|
||||||
|
'Verify');
|
||||||
|
|
||||||
|
$button_make_primary = javelin_render_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'class' => 'button small grey',
|
||||||
|
'href' => $uri->alter('primary', $email->getID()),
|
||||||
|
'sigil' => 'workflow',
|
||||||
|
),
|
||||||
|
'Make Primary');
|
||||||
|
|
||||||
|
$button_remove = javelin_render_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'class' => 'button small grey',
|
||||||
|
'href' => $uri->alter('delete', $email->getID()),
|
||||||
|
'sigil' => 'workflow'
|
||||||
|
),
|
||||||
|
'Remove');
|
||||||
|
|
||||||
|
$button_primary = phutil_render_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'class' => 'button small disabled',
|
||||||
|
),
|
||||||
|
'Primary');
|
||||||
|
|
||||||
|
if (!$email->getIsVerified()) {
|
||||||
|
$action = $button_verify;
|
||||||
|
} else if ($email->getIsPrimary()) {
|
||||||
|
$action = $button_primary;
|
||||||
|
} else {
|
||||||
|
$action = $button_make_primary;
|
||||||
|
}
|
||||||
|
|
||||||
if ($email->getIsPrimary()) {
|
if ($email->getIsPrimary()) {
|
||||||
$action = phutil_render_tag(
|
$remove = $button_primary;
|
||||||
'a',
|
|
||||||
array(
|
|
||||||
'class' => 'button small disabled',
|
|
||||||
),
|
|
||||||
'Primary');
|
|
||||||
$remove = $action;
|
|
||||||
$rowc[] = 'highlighted';
|
$rowc[] = 'highlighted';
|
||||||
} else {
|
} else {
|
||||||
if ($email->getIsVerified()) {
|
$remove = $button_remove;
|
||||||
$action = javelin_render_tag(
|
|
||||||
'a',
|
|
||||||
array(
|
|
||||||
'class' => 'button small grey',
|
|
||||||
'href' => $uri->alter('primary', $email->getID()),
|
|
||||||
'sigil' => 'workflow',
|
|
||||||
),
|
|
||||||
'Make Primary');
|
|
||||||
} else {
|
|
||||||
$action = javelin_render_tag(
|
|
||||||
'a',
|
|
||||||
array(
|
|
||||||
'class' => 'button small grey',
|
|
||||||
'href' => $uri->alter('verify', $email->getID()),
|
|
||||||
'sigil' => 'workflow',
|
|
||||||
),
|
|
||||||
'Verify');
|
|
||||||
}
|
|
||||||
$remove = javelin_render_tag(
|
|
||||||
'a',
|
|
||||||
array(
|
|
||||||
'class' => 'button small grey',
|
|
||||||
'href' => $uri->alter('delete', $email->getID()),
|
|
||||||
'sigil' => 'workflow'
|
|
||||||
),
|
|
||||||
'Remove');
|
|
||||||
$rowc[] = null;
|
$rowc[] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue