From ab0c9e362ae388c3da8ed272689887fa1b92fb99 Mon Sep 17 00:00:00 2001 From: Tony Air Date: Fri, 15 Jan 2021 00:08:01 +0700 Subject: [PATCH] IMPR: Login form bootstrap styling improvement --- app/src/Extensions/SiteMemberLoginForm.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/src/Extensions/SiteMemberLoginForm.php b/app/src/Extensions/SiteMemberLoginForm.php index 196b073..3ea9ab1 100644 --- a/app/src/Extensions/SiteMemberLoginForm.php +++ b/app/src/Extensions/SiteMemberLoginForm.php @@ -20,13 +20,25 @@ class SiteMemberLoginForm extends MemberLoginForm parent::__construct($controller, $authenticatorClass, $name, $fields, $actions, $checkCurrentUser); $fields = $this->Fields(); + $actions = $this->Actions(); $email = $fields->fieldByName('Email'); - $email->setAttribute('autocomplete', 'email'); + if ($email) { + $email->setAttribute('autocomplete', 'email'); + } $pass = $fields->fieldByName('Password'); - //$pass->setAttribute('autocomplete', 'current-password'); - $pass->setAutofocus(true); + if($pass) { + //$pass->setAttribute('autocomplete', 'current-password'); + $pass->setAutofocus(true); + } + + $btn = $actions->fieldByName('action_doLogin'); + if($btn) { + $btn->setUseButtonTag(true); + $btn->setButtonContent(' '.$btn->Title()); + $btn->addExtraClass('btn-lg'); + } if (Director::isLive()) { $this->enableSpamProtection();