{% 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" %}
<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 %}
{% load i18n %}
{% load comments %}
-{% load migdal_tags %}
+{% load migdal_tags share %}
<div class="entry entry-short entry-{{ object.type }}">
{% entry_begin object %}
+<div style="clear: both;"></div>
+
+<div class="toolbar">
<div class="more">
{% if object.get_type.commentable %}
</div>
-
<div class="social">
+ {% share object.get_absolute_url object.title %}
</div>
+</div>
+
<div style="clear: both"></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 %}
padding: 1em;
background: #ffd;
font-size: 1.3em; }
+
+.notice {
+ font-size: 1.3em; }
background: #ffd;
font-size: 1.3em;
}
+
+.notice {
+ 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;
- margin-top: .6em;
+ margin-left: 1em; }
+ .entry-wrapped .toolbar {
+ font-size: 1.3em;
+ margin-top: 1.4em;
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 {
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 {
- clear: both;
float: right;
- font-size: 1.3em;
font-style: italic;
- margin-top: .6em;
- margin-bottom: 1.8em;
a {
color: #acacac;
#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; }
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;
+ }
+ }
+}
<!DOCTYPE html>
{% load url from future %}
{% load i18n static %}
-{% load migdal_tags events_tags %}
+{% load migdal_tags events_tags share %}
{% load compressed %}
-<html>
+<html prefix="og: http://ogp.me/ns#">
<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' %}
+
+ <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">
{% 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 %}
--- /dev/null
+{% 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 }}&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 }}&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
--- /dev/null
+from django import template
+register = template.Library()
+
+
+@register.filter
+def build_absolute_uri(uri, request):
+ return request.build_absolute_uri(uri)
--- /dev/null
+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'],
+ }