From: Radek Czajka Date: Fri, 15 Mar 2013 09:11:10 +0000 (+0100) Subject: Start annoying. X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/67d93435e2d22c6e5a4b3e89037e3adefbcc3084 Start annoying. --- diff --git a/prawokultury/settings.d/50-static.py b/prawokultury/settings.d/50-static.py index 3f5f951..1149c7e 100644 --- a/prawokultury/settings.d/50-static.py +++ b/prawokultury/settings.d/50-static.py @@ -27,6 +27,8 @@ PIPELINE_CSS = { 'css/prevnext.scss', 'css/forms.scss', 'events/events.scss', + + 'css/annoy.css', ), 'output_filename': 'compressed/base.css', }, @@ -35,6 +37,8 @@ PIPELINE_JS = { 'base': { 'source_filenames': ( 'js/promobox.js', + + 'js/annoy.js', ), 'output_filename': 'compressed/base.js', }, diff --git a/prawokultury/static/css/annoy.css b/prawokultury/static/css/annoy.css new file mode 100755 index 0000000..17f689d --- /dev/null +++ b/prawokultury/static/css/annoy.css @@ -0,0 +1,54 @@ +#annoy-on { + font-size: 13px; + line-height: 1.15em; + + padding: .1em 1em; + background: orange; + z-index: 200; + font-family: Arial, sans-serif; + display: block; + padding: 0 1em; + width: 1em; + text-align:center; + border-radius: 0 0 0 1em; + position: absolute; + top: 0; + right: 0; + color: black; + box-shadow: .5em 0 1em black; +} + +#annoy { + font-size: 13px; + line-height: 1.15em; + padding: 1em 5em 1em 0; + display: none; + background: orange; + font-family: Arial, sans-serif; + position: relative; + z-index: 200; + box-shadow: 0 0 1em black; +} +#annoy p { + margin: 0 0 0 10em;; +} +#annoy a { + color: #4E56C8; +} + +#annoy a#annoy-off { + padding: .5em 1em .5em; + width: 1em; + text-align:center; + font-family: Arial, sans-serif; + display: block; + + border-radius: 0 0 0 1em; + position: absolute; + top: 0; + right: 0; + color: black; +} +#annoy a#annoy-off:hover { + cursor: pointer; +} diff --git a/prawokultury/static/css/base.css b/prawokultury/static/css/base.css index 217a2fd..9950fae 100644 --- a/prawokultury/static/css/base.css +++ b/prawokultury/static/css/base.css @@ -6,7 +6,8 @@ body { background-image: url("/static/img/bg.png"); background-repeat: no-repeat; color: #363a3b; - margin-top: 0; + margin: 0; + padding: 0; background-position: 50% 0; } a { diff --git a/prawokultury/static/css/base.scss b/prawokultury/static/css/base.scss index 5b08be6..f0dd6cb 100644 --- a/prawokultury/static/css/base.scss +++ b/prawokultury/static/css/base.scss @@ -7,7 +7,8 @@ body { background-image: url('/static/img/bg.png'); background-repeat: no-repeat; color: #363a3b; - margin-top: 0; + margin: 0; + padding: 0; background-position: 50% 0; } diff --git a/prawokultury/static/js/annoy.js b/prawokultury/static/js/annoy.js new file mode 100755 index 0000000..78c34e4 --- /dev/null +++ b/prawokultury/static/js/annoy.js @@ -0,0 +1,40 @@ +(function($) { + $(function() { + + +var have_localstorage; +try { + localStorage.setItem("test", "test"); + localStorage.removeItem("test"); + have_localstorage = true; +} catch(e) { + have_localstorage = false; +} + + + +$("#annoy-on").click(function(e) { + e.preventDefault(); + $("#annoy").slideDown('fast'); + $(this).hide(); + if (have_localstorage) localStorage.removeItem("annoyed2013"); +}); + +$("#annoy-off").click(function() { + $("#annoy").slideUp('fast'); + $("#annoy-on").show(); + if (have_localstorage) localStorage["annoyed2013"] = true; +}); + + +if (have_localstorage) { + if (!localStorage["annoyed2013"]) { + $("#annoy-on").hide(); + $("#annoy").show(); + } +} + + + + }); +})(jQuery); diff --git a/prawokultury/templates/annoy.html b/prawokultury/templates/annoy.html new file mode 100755 index 0000000..9b9e8fd --- /dev/null +++ b/prawokultury/templates/annoy.html @@ -0,0 +1,18 @@ +{% load static %} +1% +
+ + Logo akcji 1% +

Droga użytkowniczko, drogi użytkowniku!

+

Czy wiesz, że Prawo Kultury to jeden z projektów + fundacji Nowoczesna Polska – + organizacji pożytku publicznego działającej na rzecz wolności korzystania + z dóbr kultury? Wesprzyj nasze działania, przeznaczając na nie 1% swojego podatku. + Możesz to zrobić, wpisując w zeznaniu podatkowym numer + KRS 0000070056.

+ +

Dowiedz się więcej

+ + x +
+
diff --git a/prawokultury/templates/base.html b/prawokultury/templates/base.html index 86eb25b..34c795e 100755 --- a/prawokultury/templates/base.html +++ b/prawokultury/templates/base.html @@ -19,6 +19,7 @@ + {% include "annoy.html" %}