Skip to content
Permalink
Browse files

#768: Added cookie notice bar

  • Loading branch information...
nlubisch committed May 14, 2017
1 parent 171f186 commit 2a2f9afb70f16ad5e336abe0219abe22f0d54712
@@ -0,0 +1,89 @@
<style>
{literal}
.cookie-notice--container {
display: none;
position: relative;
top: 0;
left: 0;
width: 100%;
height: 30px;
border-bottom: 1px solid grey;
background: white;
}
.cookie-notice--container .cookie-notice--text {
width: 100%;
display: inline-block;
text-align: center;
line-height: 30px;
font-size: 14px;
}
.cookie-notice--container .cookie-notice--information-button,
.cookie-notice--container .cookie-notice--close-button {
padding: 2px 0;
margin-left: 10px;
display: inline-block;
}
.cookie-notice--container .cookie-notice--information-button input[type=button],
.cookie-notice--container .cookie-notice--close-button input[type=button] {
height: 24px;
}
body.cookie-notice--body .cookie-notice--container {
display: block;
}
body.cookie-notice--body #overall {
}
body.cookie-notice--body #overall #langstripe {
position: relative;
}
body.cookie-notice--body #overall .page-container-1 {
position: relative;
margin-top: 0;
}
{/literal}
</style>
<div class="cookie-notice--container">
<div class="cookie-notice--text">
{t}This website uses cookies. If you stay on this site you accept the usage of cookies.{/t}
<div class="cookie-notice--information-button">
<a href="/articles.php?page=dsb">
<input type="button" class="formbutton" value="{t}More information{/t}" />
</a>
</div>
<div class="cookie-notice--close-button">
<input type="button" class="formbutton" id="js--cookie-notice--close-button" value="{t}Close{/t}" />
</div>
</div>
</div>
<script>
{literal}
var ocCookieNoticeName = 'occookienotice';
function checkCookieExists(name) {
return document.cookie.indexOf(name) !== -1;
}
document.addEventListener("DOMContentLoaded", function() {
var bodyElement = document.getElementsByTagName('body')[0];
if (!checkCookieExists(ocCookieNoticeName)) {
bodyElement.className += " cookie-notice--body";
}
var cookieNoticeCloseButton = document.getElementById('js--cookie-notice--close-button');
cookieNoticeCloseButton.onclick = function () {
document.cookie = ocCookieNoticeName+"=1; path=/";
bodyElement.classList.remove("cookie-notice--body");
return false;
};
});
{/literal}
</script>
@@ -108,7 +108,8 @@
<body{if $opt.session.url==true} onload="initSessionTimeout()"{/if}
{foreach from=$opt.page.body_load item=loadItem name=bodyload}{if $smarty.foreach.bodyload.first} onload="{/if}{$loadItem};{if $smarty.foreach.bodyload.last}"{/if}{/foreach}
{foreach from=$opt.page.body_unload item=unloadItem name=bodyunload}{if $smarty.foreach.bodyunload.first} onunload="{/if}{$unloadItem};{if $smarty.foreach.bodyunload.last}"{/if}{/foreach}
{if $opt.template.popup!=false} class="popup"{/if}>
class="{if $opt.template.popup!=false}popup{/if}">
{include file="header/cookie_notice.tpl"}
{if $opt.template.popup!=true}
<div id="overall">
<div id="langstripe">
@@ -1932,4 +1932,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2630', 'The use
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2631', 'Please save the changed geocache properties first.', '2016-08-02 15:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2632', 'Handycap: Blind', '2016-08-02 15:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2633', 'This Cache can be found by blind people.', '2016-08-02 15:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2634', 'More information', '2017-05-14 21:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2635', 'Close', '2017-05-14 21:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2636', 'This website uses cookies. If you stay on this site you accept the usage of cookies.', '2017-05-14 21:00:00');

@@ -2713,3 +2713,5 @@ INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('2620'
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('2621', './templates2/ocstyle/search.tpl', '126');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('2632', 'table:cache_attrib;field=name', '0');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('2633', 'table:cache_attrib;field=html_desc', '0');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('2634', './templates2/ocstyle/header/cookie_notice.tpl', '57');
INSERT INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('2635', './templates2/ocstyle/header/cookie_notice.tpl', '57');
@@ -1929,3 +1929,6 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2630', 'DE', 'Der Benutzer <b>%1%2</b> exestiert nicht.', '2016-10-17 03:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2632', 'DE', 'Handycap: Blind', '2017-05-02 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2633', 'DE', 'Dieser Cache kann von Menschen mit Sehbehinderung gefunden werden.', '2017-05-02 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2634', 'DE', 'Mehr Informationen', '2017-05-14 21:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2635', 'DE', 'Schließen', '2017-05-14 21:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2636', 'DE', 'Diese Webseite verwendet Cookies. Wenn Sie auf der Seite weitersurfen, stimmen Sie der Cookie-Nutzung zu.', '2017-05-14 21:00:00');
@@ -1837,3 +1837,6 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE

INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2632', 'EN', 'Handycap: Blind', '2017-05-02 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2633', 'EN', 'This Cache can be found by blind people.', '2017-05-02 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2634', 'EN', 'More information', '2017-05-14 21:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2635', 'EN', 'Close', '2017-05-14 21:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2636', 'EN', 'This website uses cookies. If you stay on this site you accept the usage of cookies.', '2017-05-14 21:00:00');

0 comments on commit 2a2f9af

Please sign in to comment.
You can’t perform that action at this time.