Bug 36141: Add classes to CAS text on OPAC login page

This enhancement makes it easier for libraries to change the CAS-related messages on the OPAC login page.

It moved the invalid CAS login message above the CAS loging heading,
like for Shibboleth login.

Test plan :
1) Enable system preference 'casAuthentication'
2) Restart all caches (restart_all in koha-testing-docker)
3) Go to OPAC, logged out
4) Click on 'Log in to your account'
5) In the staff interface, edit the OPACUserJS system preference. Add the following JS and Save:
   $(".cas_invalid").text("Test changing the invalid CAS login message.");
   $(".cas_title").text("Test changing the CAS login heading.");
   $(".cas_url").text("Test changing the CAS account link text.");
   $(".cas_url").after(' <i class="fa fa-globe" aria-hidden="true"></i>');
6) Refresh the OPAC and confirm the text changes to reflect your JS.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0e1289d014)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0d343979bd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolin Somers 2024-02-21 10:09:30 +01:00
parent ba9a7a47d9
commit 0c7dbb159f
1 changed files with 12 additions and 10 deletions

View File

@ -88,7 +88,7 @@
[% IF ( casAuthentication ) %]
[% IF ( invalidCasLogin ) %]
<!-- This is what is displayed if cas login has failed -->
<p>Sorry, the CAS login also failed. If you have a local login you may use that below.</p>
<p class="cas_invalid">Sorry, the CAS login also failed. If you have a local login you may use that below.</p>
[% ELSE %]
<p>If you have a CAS account, you may use that below.</p>
[% END %]
@ -103,7 +103,7 @@
[% END # /IF invalidShibLogin %]
[% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
[% IF ( casAuthentication ) %]
<h2>CAS login</h2>
<h2 class="cas_title">CAS login</h2>
<p>If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.</p>
[% ELSE %]
<h2 class="shib_local_title">Local login</h2>
@ -116,34 +116,36 @@
[% IF ( casAuthentication ) %]
[% IF ( shibbolethAuthentication ) %]
[% IF ( casServerUrl ) %]
<p><a href="[% casServerUrl | $raw %]">Log in.</a><p>
<p><a class="cas_url" href="[% casServerUrl | $raw %]">Log in.</a><p>
[% END %]
[% IF ( casServersLoop ) %]
<p>Please choose against which one you would like to authenticate: </p>
<ul>
[% FOREACH casServer IN casServersLoop %]
<li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
<li><a class="cas_url" href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
[% END %]
</ul>
[% END %]
[% ELSE %]
<h2>CAS login</h2>
[% IF ( invalidCasLogin ) %]
<!-- This is what is displayed if cas login has failed -->
<p>Sorry, the CAS login failed.</p>
<div class="alert alert-info">
<!-- This is what is displayed if cas login has failed -->
<p class="cas_invalid">Sorry, the CAS login failed.</p>
</div>
[% END %]
<h2 class="cas_title">CAS login</h2>
[% IF ( casServerUrl ) %]
<p><a href="[% casServerUrl | $raw %]">Log in using a CAS account.</a><p>
<p><a class="cas_url" href="[% casServerUrl | $raw %]">Log in using a CAS account.</a><p>
[% END %]
[% IF ( casServersLoop ) %]
<p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
<ul>
[% FOREACH casServer IN casServersLoop %]
<li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
<li><a class="cas_url" href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
[% END %]
</ul>
[% END %]