From d1f7fbbb6fbdf38f7da4f82db67094cb47b25dc3 Mon Sep 17 00:00:00 2001 From: Robert Lange <robert.lange@uni-leipzig.de> Date: Thu, 30 Sep 2021 12:46:49 +0200 Subject: [PATCH] refs #19684 [finc] add aria-label for submit button on login form * copy abstractBase login.phtml from bootstrap * add aria-label in cataloglogin.phtml and login.phtml --- .../templates/Auth/AbstractBase/login.phtml | 22 +++++++++++++++++++ .../templates/myresearch/cataloglogin.phtml | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml diff --git a/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml b/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml new file mode 100644 index 00000000000..7a7764f9287 --- /dev/null +++ b/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml @@ -0,0 +1,22 @@ +<!-- finc-accessibility: auth - abstractbase - login.phtml --> +<?php $account = $this->auth()->getManager(); ?> +<?php $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> +<?php if (!$sessionInitiator): // display default login form if no login URL provided ?> + <form method="post" action="<?=$this->url('myresearch-home')?>" name="loginForm" class="form-login"> + <?=$this->auth()->getLoginFields()?> + <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>"> + <input type="hidden" name="csrf" value="<?=$this->escapeHtmlAttr($account->getCsrfHash())?>" /> + <div class="form-group"> + <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEsc("Login-to-account") ?>" value="<?=$this->transEsc('Login')?>"> + <?php if ($account->supportsCreation()): ?> + <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> + <?php endif; ?> + <?php if ($account->supportsRecovery()): ?> + <a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> + <?php endif; ?> + </div> + </form> +<?php else: ?> + <a href="<?=$this->escapeHtmlAttr($sessionInitiator)?>" class="btn btn-link" data-lightbox-ignore><?=$this->transEsc("Institutional Login")?></a> +<?php endif; ?> +<!-- finc-accessibility: auth - abstractbase - login.phtml - END --> diff --git a/themes/finc/templates/myresearch/cataloglogin.phtml b/themes/finc/templates/myresearch/cataloglogin.phtml index 65a755ab2d3..1f89d9181e8 100644 --- a/themes/finc/templates/myresearch/cataloglogin.phtml +++ b/themes/finc/templates/myresearch/cataloglogin.phtml @@ -37,7 +37,7 @@ <input id="profile_cat_password" type="password" name="cat_password" value="" class="form-control" autocomplete="current-password"/> </div> <div class="form-group"> - <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"> + <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEsc("Login-to-account") ?>" value="<?=$this->transEsc('Login')?>"> </div> </form> <?php endif; ?> -- GitLab