IMPR: Login form bootstrap styling improvement

This commit is contained in:
Tony Air 2021-01-15 00:08:01 +07:00
parent 49cebd4050
commit ab0c9e362a

View File

@ -20,13 +20,25 @@ class SiteMemberLoginForm extends MemberLoginForm
parent::__construct($controller, $authenticatorClass, $name, $fields, $actions, $checkCurrentUser); parent::__construct($controller, $authenticatorClass, $name, $fields, $actions, $checkCurrentUser);
$fields = $this->Fields(); $fields = $this->Fields();
$actions = $this->Actions();
$email = $fields->fieldByName('Email'); $email = $fields->fieldByName('Email');
if ($email) {
$email->setAttribute('autocomplete', 'email'); $email->setAttribute('autocomplete', 'email');
}
$pass = $fields->fieldByName('Password'); $pass = $fields->fieldByName('Password');
if($pass) {
//$pass->setAttribute('autocomplete', 'current-password'); //$pass->setAttribute('autocomplete', 'current-password');
$pass->setAutofocus(true); $pass->setAutofocus(true);
}
$btn = $actions->fieldByName('action_doLogin');
if($btn) {
$btn->setUseButtonTag(true);
$btn->setButtonContent('<i class="fas fa-check"></i> '.$btn->Title());
$btn->addExtraClass('btn-lg');
}
if (Director::isLive()) { if (Director::isLive()) {
$this->enableSpamProtection(); $this->enableSpamProtection();