Start annoying.
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 15 Mar 2013 09:18:18 +0000 (10:18 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 15 Mar 2013 09:18:18 +0000 (10:18 +0100)
edumed/settings.d/50-static.py
edumed/static/css/annoy.css [new file with mode: 0755]
edumed/static/js/annoy.js [new file with mode: 0755]
edumed/templates/annoy.html [new file with mode: 0755]
edumed/templates/base.html

index 4013a66..835c8a5 100644 (file)
@@ -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 (executable)
index 0000000..17f689d
--- /dev/null
@@ -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 (executable)
index 0000000..78c34e4
--- /dev/null
@@ -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 (executable)
index 0000000..d48e669
--- /dev/null
@@ -0,0 +1,18 @@
+{% load static %}
+<a id='annoy-on' href="http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/">1%</a>
+<div id='annoy'>
+    <a href="http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/">
+        <img src='http://static.wolnelektury.pl/img/procent.png' alt="Logo akcji 1%" style="float:left;margin: 0 2em" /></a>
+    <p>Droga użytkowniczko, drogi użytkowniku!</p>
+    <p>Czy wiesz, że Edukacja Medialna to jeden z&nbsp;projektów
+    <strong>fundacji Nowoczesna Polska</strong> –
+    organizacji pożytku publicznego działającej na rzecz wolności korzystania
+    z&nbsp;dóbr kultury? Wesprzyj nasze działania, przeznaczając na nie 1% swojego podatku.
+    Możesz to zrobić, wpisując w&nbsp;zeznaniu podatkowym numer
+    <strong>KRS 0000070056</strong>.</p>
+
+    <p><a href="http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/">Dowiedz się więcej</a></p>
+    
+    <a id='annoy-off'>x</a>
+    <div style="clear:both;"></div>
+</div>
index 48b074f..4e2554c 100644 (file)
@@ -25,6 +25,7 @@
         <!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script></script><![endif]-->
     </head>
     <body id="{% block body-id %}body{% endblock %}">
+        {% include "annoy.html" %}
 
         <div id="header-wrapper">
         <header class="main" style="position:relative;">