]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates-bootstrap/opac/parts/base.tt2
LP#1869971: (follow-up) also apply HTML::Defang in the OPAC templates
[Evergreen.git] / Open-ILS / src / templates-bootstrap / opac / parts / base.tt2
1 <!DOCTYPE html>
2 <html lang='[% ctx.eg_locale %]'>
3     <head prefix="og: http://ogp.me/ns#">
4         <meta charset="utf-8" />
5         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6         [% IF ctx.refresh %]
7         <meta http-equiv="refresh" content="[% ctx.refresh %]" />
8         [% ELSIF ctx.authtime AND !ctx.is_staff %]
9         <meta http-equiv="refresh" content="[% ctx.authtime %]; url=[% ctx.home_page %]" />
10         [% END %]
11         <meta name = "viewport" content = "width=device-width, initial-scale = 1.0">
12         <!--Added bootstrap dependancies-->
13         <link rel="stylesheet" href="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap/dist/css/bootstrap.min.css[% ctx.cache_key %]">
14         <link rel="stylesheet"  href="[% ctx.media_prefix %]/opac/deps/node_modules/@fortawesome/fontawesome-free/css/all.css[% ctx.cache_key %]" />
15         <link rel="stylesheet"  href="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css[% ctx.cache_key %]" />
16         <link rel="stylesheet"  href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css[% ctx.cache_key %]" />
17         <link rel="stylesheet" href="[% ctx.opac_root %]/css/style.css[% ctx.cache_key %]&amp;dir=[%
18           IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %]rtl[%
19           ELSE %]ltr[% END %]" />
20           <link rel="stylesheet" href="[% ctx.opac_root %]/css/mediaQuery.css[% ctx.cache_key %]" />
21         [% IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %]
22         <link rel="stylesheet" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto-rtl.css[% ctx.cache_key %]" />
23         [% END %]
24
25            [% IF ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_css') %]
26             [% custom_css = ctx.defang_string(ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_css')) %]
27         [% '<style>'; custom_css ; '</style>' %]
28         [% END %]
29
30         [% matomo_id = ctx.get_org_setting(ctx.search_ou, 'opac.analytics.matomo_id'); %]
31         [% matomo_url = ctx.get_org_setting(ctx.search_ou, 'opac.analytics.matomo_url'); %]
32         [% IF matomo_id && matomo_url %]
33            [% matomo_enabled = 1; %]
34         [% END %]
35
36         [%- libname = ctx.get_aou(ctx.search_ou).name;
37             libname = libname | html;
38             libsname = ctx.get_aou(ctx.search_ou).shortname; %]
39         <title>[%- IF ctx.user_stats.messages.unread;
40                       l('([_1])', ctx.user_stats.messages.unread);
41                    END;
42                -%]
43                [% l('[_1] - [_2]', ctx.page_title, libname) %]</title>
44         <link rel="unapi-server" type="application/xml" title="unAPI" href="/opac/extras/unapi" />
45         <link type="application/opensearchdescription+xml" rel='search' title="[% l('[_1] OpenSearch', libname) %]" href="/opac/extras/opensearch/1.1/[% libsname | uri %]/-/osd.xml" />
46         [%-# Hook for page-specific metadata such as <meta name="robots" content="noindex"> %]
47         [%- ctx.metalinks.push('<meta property="og:title" content="' _ ctx.page_title _ '" />'); %]
48         [%- ctx.metalinks.push('<meta property="og:site_name" content="' _ libname _ '" />'); %]
49         [% FOREACH meta IN ctx.metalinks; meta _ "\n"; END; -%]
50         [% IF want_dojo %]
51         <style>
52             @import "[% ctx.media_prefix %]/js/dojo/dijit/themes/tundra/tundra.css[% ctx.cache_key %]";
53         </style>
54         [% END %]
55
56         [% IF !ctx.is_staff %]
57             [% INCLUDE 'opac/parts/goog_analytics.tt2' %]
58             [% INCLUDE 'opac/parts/matomo_analytics.tt2' %]
59         [% END %]
60         [% PROCESS 'opac/parts/stripe.tt2' %]
61 <script  src="[% ctx.media_prefix %]/opac/deps/node_modules/jquery/dist/jquery.min.js"></script>
62
63                 <script>
64                         $(document).ready(function(){
65                                 $("#loginModal").on('shown.bs.modal', function(){
66                                         $(this).find('#username_field').focus();
67                                 });
68                 // password visibility eye
69                 let btn = document.getElementById('show_password');
70                 let input = document.getElementById('password_field');
71                 let icon = btn.querySelector('i');
72                 btn.addEventListener('click', () => {
73                     if(input.type == 'password'){
74                         input.type = 'text';
75                         icon.setAttribute('class', 'fas fa-eye');
76                         btn.setAttribute('aria-checked', 'true');
77                         input.setAttribute('aria-description', "[% l('Your password is visible!') %]");
78                     }else {
79                         input.type = 'password';
80                         icon.setAttribute('class', 'fas fa-eye-slash');
81                         btn.setAttribute('aria-checked', 'false');
82                         input.setAttribute('aria-description', "[% l('Your password is not visible.') %]");
83                     }
84                     input.focus();
85                 });
86                 let loginForm = document.getElementById('login_form');
87                 loginForm.addEventListener('submit', ()=>{
88                     input.type = 'password';
89                 });
90                         });
91                 </script>
92
93     </head>
94     <body[% IF want_dojo; ' class="tundra d-flex flex-column min-vh-100"'; ELSE; ' class="tundra d-flex flex-column min-vh-100"';  END %]>
95         <h1 class="sr-only">[% l('Catalog') %]</h1>
96         [%#Each content page needs (at minimum) an <h2> describing the content%]
97        <div class="mb-3">
98         [% content %]
99         </div>
100         [% IF ctx.page != "login" ;%]
101         [% INCLUDE 'opac/parts/login/login_modal.tt2' %]
102         [% END;%]
103         <h2 class="sr-only">[% l('Additional Resources') %]</h2>
104         [% INCLUDE 'opac/parts/footer.tt2' %]
105
106         [% INCLUDE 'opac/parts/js.tt2' %]
107         <script>
108     $(document).ready(function(){
109     $('.tooltip').tooltip();
110     });
111 </script>
112         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
113             [%- INCLUDE 'opac/parts/chilifresh.tt2' %]
114         [%- END %]
115
116
117
118     </body>
119 </html>