mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Add a cancel button, provider crumb, and account card to registration
Summary: Ref T1536. - Add a "Cancel" button, to get back to login. - Add a crumb showing the registering provider. - Add an account card when registering with an external account - Tailor some language to make it less ambiguous ("Phabricator Username", "Register Phabricator Account"). Test Plan: {F46618} {F46619} Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T1536 Differential Revision: https://secure.phabricator.com/D6213
This commit is contained in:
parent
30237aaa47
commit
433c6550b2
1 changed files with 23 additions and 3 deletions
|
@ -23,8 +23,10 @@ final class PhabricatorAuthRegisterController
|
|||
if (strlen($this->accountKey)) {
|
||||
$result = $this->loadAccountForRegistrationOrLinking($this->accountKey);
|
||||
list($account, $provider, $response) = $result;
|
||||
$is_default = false;
|
||||
} else {
|
||||
list($account, $provider, $response) = $this->loadDefaultAccount();
|
||||
$is_default = true;
|
||||
}
|
||||
|
||||
if ($response) {
|
||||
|
@ -259,10 +261,24 @@ final class PhabricatorAuthRegisterController
|
|||
}
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($request->getUser());
|
||||
|
||||
if (!$is_default) {
|
||||
$form->appendChild(
|
||||
id(new AphrontFormMarkupControl())
|
||||
->setLabel(pht('External Account'))
|
||||
->setValue(
|
||||
id(new PhabricatorAuthAccountView())
|
||||
->setUser($request->getUser())
|
||||
->setExternalAccount($account)
|
||||
->setAuthProvider($provider)));
|
||||
}
|
||||
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel(pht('Username'))
|
||||
->setLabel(pht('Phabricator Username'))
|
||||
->setName('username')
|
||||
->setValue($value_username)
|
||||
->setError($e_username));
|
||||
|
@ -305,7 +321,8 @@ final class PhabricatorAuthRegisterController
|
|||
|
||||
$form->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue(pht('Create Account')));
|
||||
->addCancelButton($this->getApplicationURI('start/'))
|
||||
->setValue(pht('Register Phabricator Account')));
|
||||
|
||||
$title = pht('Phabricator Registration');
|
||||
|
||||
|
@ -313,6 +330,9 @@ final class PhabricatorAuthRegisterController
|
|||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName(pht('Register')));
|
||||
$crumbs->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName($provider->getProviderName()));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
|
|
Loading…
Reference in a new issue