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

index 3f5f951..1149c7e 100644 (file)
@@ -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 (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;
+}
index 217a2fd..9950fae 100644 (file)
@@ -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 {
index 5b08be6..f0dd6cb 100644 (file)
@@ -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 (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/prawokultury/templates/annoy.html b/prawokultury/templates/annoy.html
new file mode 100755 (executable)
index 0000000..9b9e8fd
--- /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 Prawo Kultury 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 86eb25b..34c795e 100755 (executable)
@@ -19,6 +19,7 @@
         <meta property='og:locale' content='pl_PL' />
     </head>
     <body>
+    {% include "annoy.html" %}
     <div id="body">
         <div id="header-bar">
         <div class="bar-left">