From 433c6550b23500e46ee90b498df71a90c22ff26c Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 17 Jun 2013 12:14:25 -0700 Subject: [PATCH] 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 --- .../PhabricatorAuthRegisterController.php | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php index 9c90f34582..86c509576f 100644 --- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php +++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php @@ -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()) + ->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(