From: Radek Czajka Date: Fri, 15 Mar 2013 09:18:18 +0000 (+0100) Subject: Start annoying. X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/02e15cdfe6d55f265169350c2418609090a93447?hp=a556e8b9f74e52a0b5c7c6aa3ac32ae4becfaac3 Start annoying. --- diff --git a/edumed/settings.d/50-static.py b/edumed/settings.d/50-static.py index 4013a66..835c8a5 100644 --- a/edumed/settings.d/50-static.py +++ b/edumed/settings.d/50-static.py @@ -25,6 +25,8 @@ PIPELINE_CSS = { 'catalogue/css/section_list.scss', 'curriculum/curriculum.scss', 'jquery/colorbox/colorbox.css', + + 'css/annoy.css', ), 'output_filename': 'compressed/base.css', }, @@ -40,6 +42,8 @@ PIPELINE_JS = { 'catalogue/js/lesson.js', 'sponsors/js/sponsors.js', 'curriculum/curriculum.js', + + 'js/annoy.js', ), 'output_filename': 'compressed/base.js', }, diff --git a/edumed/static/css/annoy.css b/edumed/static/css/annoy.css new file mode 100755 index 0000000..17f689d --- /dev/null +++ b/edumed/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/edumed/static/js/annoy.js b/edumed/static/js/annoy.js new file mode 100755 index 0000000..78c34e4 --- /dev/null +++ b/edumed/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/edumed/templates/annoy.html b/edumed/templates/annoy.html new file mode 100755 index 0000000..d48e669 --- /dev/null +++ b/edumed/templates/annoy.html @@ -0,0 +1,18 @@ +{% load static %} +1% +
+ + Logo akcji 1% +

Droga użytkowniczko, drogi użytkowniku!

+

Czy wiesz, że Edukacja Medialna 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/edumed/templates/base.html b/edumed/templates/base.html index 48b074f..4e2554c 100644 --- a/edumed/templates/base.html +++ b/edumed/templates/base.html @@ -25,6 +25,7 @@ + {% include "annoy.html" %}