social
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Aug 2012 15:12:45 +0000 (17:12 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Aug 2012 15:12:45 +0000 (17:12 +0200)
22 files changed:
migdal/templates/migdal/entry/entry_detail.html
migdal/templates/migdal/entry/entry_short.html
migdal/templates/migdal/last_comments.html
prawokultury/static/css/base.css
prawokultury/static/css/base.scss
prawokultury/static/css/entry.css
prawokultury/static/css/entry.scss
prawokultury/static/css/sidebar.css
prawokultury/static/css/sidebar.scss
prawokultury/static/img/social/bigfacebook.png [new file with mode: 0644]
prawokultury/static/img/social/biggoogle.png [new file with mode: 0644]
prawokultury/static/img/social/bignk.png [new file with mode: 0644]
prawokultury/static/img/social/bigtwitter.png [new file with mode: 0644]
prawokultury/static/img/social/facebook.png [new file with mode: 0644]
prawokultury/static/img/social/google.png [new file with mode: 0644]
prawokultury/static/img/social/nk.png [new file with mode: 0644]
prawokultury/static/img/social/twitter.png [new file with mode: 0644]
prawokultury/static/img/square-logo.png [new file with mode: 0644]
prawokultury/templates/base.html
prawokultury/templates/share.html [new file with mode: 0755]
prawokultury/templatetags/common_tags.py [new file with mode: 0755]
prawokultury/templatetags/share.py [new file with mode: 0755]

index 1f322be..ef842b8 100755 (executable)
@@ -1,6 +1,19 @@
 {% extends "base.html" %}
 {% load comments i18n %}
 {% extends "base.html" %}
 {% load comments i18n %}
-{% load migdal_tags %}
+{% load common_tags migdal_tags share %}
+
+
+{% block "titleextra" %}{{ entry.title }} ::{% endblock %}
+{% block "ogtitle" %}{{ entry.title }}{% endblock %}
+{% block "ogtype" %}article{% endblock %}
+{% block "ogdescription"%}{{ entry.lead|striptags|truncatewords:10 }}{% endblock %}
+{% block "ogimage" %}{% spaceless %}
+{% if entry.image %}
+    {{ entry.image.url|build_absolute_uri:request }}
+{% else %}
+    {{ block.super }}
+{% endif %}
+{% endspaceless %}{% endblock %}
 
 
 {% block "main_menu" %}
 
 
 {% block "main_menu" %}
 <div class="body">
 {{ entry.body }}
 </div>
 <div class="body">
 {{ entry.body }}
 </div>
+
+<div style="clear: both;"></div>
+
+<div class="toolbar">
+<div class="social">
+    {% share object.get_absolute_url object.title %}
+</div>
+</div>
+
 <div style="clear: both"></div>
 
 {% if entry.get_type.commentable %}
 <div style="clear: both"></div>
 
 {% if entry.get_type.commentable %}
index 5dbef6f..31dbf9e 100755 (executable)
@@ -1,6 +1,6 @@
 {% load i18n %}
 {% load comments %}
 {% load i18n %}
 {% load comments %}
-{% load migdal_tags %}
+{% load migdal_tags share %}
 
 
 <div class="entry entry-short entry-{{ object.type }}">
 
 
 <div class="entry entry-short entry-{{ object.type }}">
@@ -8,6 +8,9 @@
 
 {% entry_begin object %}
 
 
 {% entry_begin object %}
 
+<div style="clear: both;"></div>
+
+<div class="toolbar">
 <div class="more">
 
 {% if object.get_type.commentable %}
 <div class="more">
 
 {% if object.get_type.commentable %}
 
 </div>
 
 
 </div>
 
-
 <div class="social">
 <div class="social">
+    {% share object.get_absolute_url object.title %}
 </div>
 </div>
+</div>
+
 
 
 <div style="clear: both"></div>
 
 
 <div style="clear: both"></div>
index 2b5945a..f26cfea 100755 (executable)
@@ -6,7 +6,7 @@
     <a href="{{ comment.get_absolute_url }}">
         <div class="title">{{ comment.content_object.title }}</div>
         <div class="author">{{ comment.name }}</div>
     <a href="{{ comment.get_absolute_url }}">
         <div class="title">{{ comment.content_object.title }}</div>
         <div class="author">{{ comment.name }}</div>
-        <div class="body">{{ comment.comment|textile_restricted_pl|striptags|truncatechars:32 }}</div>
+        <div class="body">{{ comment.comment|textile_restricted_pl|striptags|truncatewords:8 }}</div>
     </a>
     </li>
   {% endfor %}
     </a>
     </li>
   {% endfor %}
index 615e005..aa0c016 100644 (file)
@@ -28,3 +28,6 @@ h1 {
   padding: 1em;
   background: #ffd;
   font-size: 1.3em; }
   padding: 1em;
   background: #ffd;
   font-size: 1.3em; }
+
+.notice {
+  font-size: 1.3em; }
index 01723b1..67115d2 100644 (file)
@@ -36,3 +36,7 @@ h1 {
     background: #ffd;
     font-size: 1.3em;
 }
     background: #ffd;
     font-size: 1.3em;
 }
+
+.notice {
+    font-size: 1.3em;
+}
index d3a9a5e..655ae63 100644 (file)
     font-size: 1.3em; }
   .entry-wrapped .body {
     font-size: 1.3em; }
     font-size: 1.3em; }
   .entry-wrapped .body {
     font-size: 1.3em; }
-  .entry-wrapped .more {
-    clear: both;
-    float: right;
-    font-size: 1.3em;
+  .entry-wrapped blockquote {
+    position: relative;
+    left: 1em;
     font-style: italic;
     font-style: italic;
-    margin-top: .6em;
+    margin-left: 1em; }
+  .entry-wrapped .toolbar {
+    font-size: 1.3em;
+    margin-top: 1.4em;
     margin-bottom: 1.8em; }
     margin-bottom: 1.8em; }
+    .entry-wrapped .toolbar .social a {
+      margin-right: .6em; }
+  .entry-wrapped .more {
+    float: right;
+    font-style: italic; }
     .entry-wrapped .more a {
       color: #acacac; }
     .entry-wrapped .more .read-more {
     .entry-wrapped .more a {
       color: #acacac; }
     .entry-wrapped .more .read-more {
index 5ce77cb..62de95a 100644 (file)
         margin-left: 1em;
     }
 
         margin-left: 1em;
     }
 
+    .toolbar {
+        font-size: 1.3em;
+        margin-top: 1.4em;
+        margin-bottom: 1.8em;
+
+        .social a {
+            margin-right: .6em;
+            img {
+                vertical-align: middle;
+            }
+        }
+    }
+
     .more {
     .more {
-        clear: both;
         float: right;
         float: right;
-        font-size: 1.3em;
         font-style: italic;
         font-style: italic;
-        margin-top: .6em;
-        margin-bottom: 1.8em;
 
         a {
             color: #acacac;
 
         a {
             color: #acacac;
index 6ee67da..8358e45 100644 (file)
   #latest-comments .body {
     margin-top: 1.3em;
     font-size: 1.1em; }
   #latest-comments .body {
     margin-top: 1.3em;
     font-size: 1.1em; }
+
+#sidebar .social {
+  padding-top: 2em;
+  padding-bottom: 2em; }
+  #sidebar .social a {
+    margin-right: 2em; }
+    #sidebar .social a img {
+      vertical-align: top; }
index 2607deb..df4ab3e 100644 (file)
         margin-top: 1.3em;
         font-size: 1.1em;
     }
         margin-top: 1.3em;
         font-size: 1.1em;
     }
-}
\ No newline at end of file
+}
+
+#sidebar .social {
+    padding-top: 2em;
+    padding-bottom: 2em;
+
+    a {
+        margin-right: 2em;
+        img {
+            vertical-align: middle;
+        }
+    }
+}
diff --git a/prawokultury/static/img/social/bigfacebook.png b/prawokultury/static/img/social/bigfacebook.png
new file mode 100644 (file)
index 0000000..630416c
Binary files /dev/null and b/prawokultury/static/img/social/bigfacebook.png differ
diff --git a/prawokultury/static/img/social/biggoogle.png b/prawokultury/static/img/social/biggoogle.png
new file mode 100644 (file)
index 0000000..19ad19d
Binary files /dev/null and b/prawokultury/static/img/social/biggoogle.png differ
diff --git a/prawokultury/static/img/social/bignk.png b/prawokultury/static/img/social/bignk.png
new file mode 100644 (file)
index 0000000..c119cd1
Binary files /dev/null and b/prawokultury/static/img/social/bignk.png differ
diff --git a/prawokultury/static/img/social/bigtwitter.png b/prawokultury/static/img/social/bigtwitter.png
new file mode 100644 (file)
index 0000000..fafbe64
Binary files /dev/null and b/prawokultury/static/img/social/bigtwitter.png differ
diff --git a/prawokultury/static/img/social/facebook.png b/prawokultury/static/img/social/facebook.png
new file mode 100644 (file)
index 0000000..dca6fe8
Binary files /dev/null and b/prawokultury/static/img/social/facebook.png differ
diff --git a/prawokultury/static/img/social/google.png b/prawokultury/static/img/social/google.png
new file mode 100644 (file)
index 0000000..c8c2882
Binary files /dev/null and b/prawokultury/static/img/social/google.png differ
diff --git a/prawokultury/static/img/social/nk.png b/prawokultury/static/img/social/nk.png
new file mode 100644 (file)
index 0000000..de6650f
Binary files /dev/null and b/prawokultury/static/img/social/nk.png differ
diff --git a/prawokultury/static/img/social/twitter.png b/prawokultury/static/img/social/twitter.png
new file mode 100644 (file)
index 0000000..6745ef4
Binary files /dev/null and b/prawokultury/static/img/social/twitter.png differ
diff --git a/prawokultury/static/img/square-logo.png b/prawokultury/static/img/square-logo.png
new file mode 100644 (file)
index 0000000..cd42d39
Binary files /dev/null and b/prawokultury/static/img/square-logo.png differ
index db10839..e1095eb 100755 (executable)
@@ -1,13 +1,21 @@
 <!DOCTYPE html>
 {% load url from future %}
 {% load i18n static %}
 <!DOCTYPE html>
 {% load url from future %}
 {% load i18n static %}
-{% load migdal_tags events_tags %}
+{% load migdal_tags events_tags share %}
 {% load compressed %}
 {% load compressed %}
-<html>
+<html prefix="og: http://ogp.me/ns#">
     <head>
     <head>
-        <title>{% trans "Culture's right" %}</title>
+       <title>{% trans "Culture's right" %}{% block "titleextra" %}{% endblock %}</title>
        <link rel="shortcut icon" type="image/png" href="{% static "img/favicon.png" %}" />
         {% compressed_css 'base' %}
        <link rel="shortcut icon" type="image/png" href="{% static "img/favicon.png" %}" />
         {% compressed_css 'base' %}
+
+        <meta property='og:url' content='{% block "ogurl" %}{% url 'migdal_main' %}{% endblock %}' />
+        <meta property='og:title' content='{% block "ogtitle" %}{% trans "Culture's right" %}{% endblock %}' />
+        <meta property='og:site_name' content='{% trans "Culture's right" %}' />
+        <meta property='og:description' content='{% block "ogdescription" %}Prawokultury.pl to strona edukacyjna mająca za zadanie w przystępny i rzetelny sposób informować o wszelkich kwestiach związanych z prawem autorskim.{% endblock %}' />
+        <meta property='og:type' content='{% block "ogtype" %}website{% endblock %}' />
+        <meta property='og:image' content='{% block "ogimage" %}{% static "img/square-logo.png"%}{% endblock %}' />
+        <meta property='og:locale' content='pl_PL' />
     </head>
     <body>
     <div id="body">
     </head>
     <body>
     <div id="body">
                     {% categories 'topics' %}
                     {% categories 'types' %}
                 </div>
                     {% categories 'topics' %}
                     {% categories 'types' %}
                 </div>
-                <!--div class="sidebar-box">
-                    <a href="{% url 'migdal_main_feed' %}">RSS</a>
-                </div-->
+                <div class="sidebar-box social">
+                    {% url 'migdal_main' as main_url %}
+                    {% trans "Culture's right" as site_name %}
+                    {% share main_url site_name "big" %}
+                    <!--a href="{% url 'migdal_main_feed' %}">RSS</a-->
+                </div>
                 <div class="sidebar-box">
                     <h3>{% trans "Latest comments" %}</h3>
                     {% last_comments %}
                 <div class="sidebar-box">
                     <h3>{% trans "Latest comments" %}</h3>
                     {% last_comments %}
diff --git a/prawokultury/templates/share.html b/prawokultury/templates/share.html
new file mode 100755 (executable)
index 0000000..3f6b487
--- /dev/null
@@ -0,0 +1,29 @@
+{% load i18n common_tags static %}
+{% with encoded_url=url|build_absolute_uri:request|urlencode encoded_desc=description|urlencode %}
+<a rel="nofollow" target="_blank" class="facebook"
+    href="https://www.facebook.com/sharer.php?u={{ encoded_url }}">
+    <img src="{% static "img/social/"|add:iconset|add:"facebook.png" %}"
+        alt="{% trans 'Share on Facebook' %}"></a>
+<a rel="nofollow" target="_blank" class="google"
+    href="https://plus.google.com/share?url={{ encoded_url }}">
+    <img src="{% static "img/social/"|add:iconset|add:"google.png" %}"
+        alt="{% trans 'Share on Google+' %}"></a>
+<a rel="nofollow" target="_blank" class="twitter"
+    href="https://twitter.com/intent/tweet?url={{ encoded_url }}&amp;text={{ encoded_desc }}">
+    <img src="{% static "img/social/"|add:iconset|add:"twitter.png" %}"
+        alt="{% trans 'Share on Twitter' %}"></a>
+<a rel="nofollow" target="_blank" class="nk"
+    href="http://nk.pl/#sledzik?shout={{ encoded_desc }}%20{{ encoded_url }}">
+    <img src="{% static "img/social/"|add:iconset|add:"nk.png" %}"
+        alt="{% trans 'Share on NK.pl' %}"></a>
+{% comment %}
+<a rel="nofollow" target="_blank" class="diaspora"
+    href="http://sharetodiaspora.github.com/?title={{ encoded_desc }}&amp;url={{ encoded_url }}">
+    <img src="{% static "img/social/"|add:iconset|add:"diaspora.png" %}"
+        alt="{% trans 'Share on Diaspora' %}"></a>
+<a rel="nofollow" target="_blank" class="blip"
+    href="http://blip.pl/dashboard?body={{ encoded_desc }}%20{{ encoded_url }}">
+    <img src="{% static "img/social/"|add:iconset|add:"blip.png" %}"
+        alt="{% trans 'Share on Blip.pl' %}"></a>
+{% endcomment %}
+{% endwith %}
\ No newline at end of file
diff --git a/prawokultury/templatetags/common_tags.py b/prawokultury/templatetags/common_tags.py
new file mode 100755 (executable)
index 0000000..ccaf03b
--- /dev/null
@@ -0,0 +1,7 @@
+from django import template
+register = template.Library()
+
+
+@register.filter
+def build_absolute_uri(uri, request):
+    return request.build_absolute_uri(uri)
diff --git a/prawokultury/templatetags/share.py b/prawokultury/templatetags/share.py
new file mode 100755 (executable)
index 0000000..ba9a69b
--- /dev/null
@@ -0,0 +1,13 @@
+from django.template import Library
+
+register = Library()
+
+
+@register.inclusion_tag('share.html', takes_context=True)
+def share(context, url, description, iconset=""):
+    return {
+        'url': url,
+        'description': description,
+        'iconset': iconset,
+        'request': context['request'],
+    }