@@ -, +, @@ - Adds a new cookieconsent.js script that drives the display and - Adds styles for the cookie consent bar and modal - Adds the creation and population of the cookie consent bar and modal, --- .../prog/css/src/staff-global.scss | 49 ++++++ .../prog/en/includes/intranet-bottom.inc | 69 ++++++++ .../intranet-tmpl/prog/js/cookieconsent.js | 165 ++++++++++++++++++ 3 files changed, 283 insertions(+) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/cookieconsent.js --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4404,6 +4404,55 @@ div .suggestion_note { } } +/* Cookie consent bar */ +#cookieConsentBar { + display: none; + padding: 20px; + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: rgba(0,0,0,0.7); + color: rgba(255,255,255,0.9); + z-index: 1; + a:link, a:visited { + color: #d7ebff; + } + #consentButtons { + margin-top: 10px; + text-align: right; + } + button:not(:last-child) { + margin-right: 10px; + } +} + +/* Cookie consent modal */ +#cookieConsentModal { + .modal-dialog { + width: 700px; + } + .consentModalItem { + display: flex; + align-items: center; + border: 1px solid #ccc; + padding: 10px 20px; + border-radius: 5px; + } + .consentModalItem:not(:last-child) { + margin-bottom: 20px; + } + .consentItemCheckbox { + padding-right: 20px; + } + .consentItemName { + font-weight: bold; + } + #cookieConsentPopupText { + margin: 20px 0; + } +} + @media (min-width: 200px) { } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -1,6 +1,10 @@ [% USE raw %] [% USE Koha %] [% USE KohaPlugins %] +[% USE Asset %] +[% IF Koha.Preference( 'CookieConsent' ) %] + [% USE JSConsents %] +[% END %] [% IF ( ( languages_loop ) && ( ! popup_window ) && ( Koha.Preference('StaffLangSelectorMode') == 'both' || Koha.Preference('StaffLangSelectorMode') == 'footer') ) %] [% UNLESS ( one_language_enabled ) %] @@ -74,5 +78,70 @@ [% END %] [% KohaPlugins.get_plugins_intranet_js | $raw %] + + [% IF Koha.Preference( 'CookieConsent' ) %] + +
+ + + [% END %] + + [% IF Koha.Preference( 'CookieConsent' ) && Koha.Preference( 'ConsentJS' ).length > 0 %] + [% consents = JSConsents.all() %] + [% FOREACH consent IN consents %] + + [% END %] + [% END %] + [% IF Koha.Preference( 'CookieConsent' ) %] + [% Asset.js("js/cookieconsent.js") | $raw %] + [% END %] +