pricing login modal : added password strength description, and lost password link

This commit is contained in:
2021-01-12 10:17:49 +01:00
parent 02c983e7e0
commit efd88d298b
5 changed files with 33 additions and 9 deletions

View File

@@ -7,6 +7,8 @@
use \Drupal\Core\Form\FormStateInterface;
use \Drupal\Core\Block\BlockPluginInterface;
use \Drupal\Core\Url;
use \Drupal\Core\Link;
/**
* implements hook_form_FORM_ID_alter()
@@ -24,6 +26,10 @@ function materio_user_form_user_login_form_alter(&$form, FormStateInterface $for
"@keyup.enter" => "login"
);
$url = Url::fromRoute('user.pass');
$form['pass']['#description'] = Link::fromTextAndUrl('Forgot your password?', $url)->toString();
// "<a href="{{ path('user.pass') }}">{{ 'Forgot your password?'|t }}</a>";
$form['actions']['submit']['#attributes'] = array(
"@click.prevent" => "login"
);
@@ -59,6 +65,7 @@ function materio_user_form_user_modal_form_alter(&$form, FormStateInterface $for
function _materio_user_process_password_confirm($element){
// ksm($element);
$element['pass1']['#description'] = t('Password must contains Lowercase and Uppercase Letters, numbers, and punctuation.');
$element['pass1']['#attributes'] += array(
"v-model" => "pass1",
"placeholder" => $element['pass1']['#title'],