From f88f26e37b7f97e31ff75742eecd21d7f3fe4f16 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 9 Mar 2012 13:47:52 +0100 Subject: [PATCH] some opengraph info --- apps/catalogue/templatetags/catalogue_tags.py | 4 + wolnelektury/context_processors.py | 2 +- wolnelektury/settings.py | 11 - wolnelektury/templates/base.html | 193 +---------------- .../templates/catalogue/book_detail.html | 2 + wolnelektury/templates/main_page.html | 1 + wolnelektury/templates/superbase.html | 201 ++++++++++++++++++ 7 files changed, 211 insertions(+), 203 deletions(-) create mode 100644 wolnelektury/templates/superbase.html diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 14ed64da8..e9b1610c8 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -45,6 +45,10 @@ def capfirst(text): except IndexError: return '' +@register.filter +def build_absolute_uri(uri, request): + return request.build_absolute_uri(uri) + @register.simple_tag def html_title_from_tags(tags): diff --git a/wolnelektury/context_processors.py b/wolnelektury/context_processors.py index 0cbf60513..fa8515ec5 100644 --- a/wolnelektury/context_processors.py +++ b/wolnelektury/context_processors.py @@ -1,6 +1,6 @@ +from django.conf import settings def extra_settings(request): - from django.conf import settings return { 'STATIC_URL': settings.STATIC_URL, } diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py index 8ee4e43de..07b1ef004 100644 --- a/wolnelektury/settings.py +++ b/wolnelektury/settings.py @@ -286,17 +286,6 @@ COMPRESS_VERSION = True COMPRESS_CSS_FILTERS = None THUMBNAIL_QUALITY = 95 -THUMBNAIL_EXTENSION = 'png' - -THUMBNAIL_PROCESSORS = ( - # Default processors - 'sorl.thumbnail.processors.colorspace', - 'sorl.thumbnail.processors.autocrop', - 'sorl.thumbnail.processors.scale_and_crop', - 'sorl.thumbnail.processors.filters', - # Custom processors - 'sponsors.processors.add_padding', -) TRANSLATION_REGISTRY = "wolnelektury.translation" diff --git a/wolnelektury/templates/base.html b/wolnelektury/templates/base.html index e3faca161..fac93191c 100644 --- a/wolnelektury/templates/base.html +++ b/wolnelektury/templates/base.html @@ -1,193 +1,4 @@ - - - {% load cache compressed i18n %} - {% load catalogue_tags reporting_stats sponsor_tags %} - - - - {% block title %}{% trans "Wolne Lektury" %} :: - {% block titleextra %}{% endblock %}{% endblock %} - - - {% compressed_css "all" %} - {% compressed_css "screen" %} - - - +{% extends "superbase.html" %} - {% block extrahead %} - {% endblock %} - - - {% block bodycontent %} - -
- - - -
-
- - - -
- -
- - {{search_form.q}} - -
- -
- -
-
- - - -
-
- - - -
- - - -
- - - - {% block body %} - {% endblock %} - - - - -
- -
{# end main-content #} - - - - - - - {# template #} -
- -
-

* {% trans "Loading" %}

-
-
- - - {% endblock bodycontent %} - - - - - {% compressed_js "base" %} - - - - +{% block ogtitle %}{% block titleextra %}{% endblock %}{% endblock %} diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index dd4d9078a..a996d66ee 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -1,8 +1,10 @@ {% extends "base.html" %} {% load cache i18n %} +{% load thumbnail %} {% load catalogue_tags pagination_tags %} {% block titleextra %}{{ book.pretty_title }}{% endblock %} +{% block ogimage %}{{ book.cover.url|build_absolute_uri:request }}{% endblock %} {% block metadescription %}{% book_title book %}. {{ block.super }}{% endblock %} diff --git a/wolnelektury/templates/main_page.html b/wolnelektury/templates/main_page.html index 9e8f92243..f92028fb3 100755 --- a/wolnelektury/templates/main_page.html +++ b/wolnelektury/templates/main_page.html @@ -3,6 +3,7 @@ {% block title %}{% trans "Wolne Lektury internet library" %}{% endblock %} +{% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %} {% block body %} diff --git a/wolnelektury/templates/superbase.html b/wolnelektury/templates/superbase.html new file mode 100644 index 000000000..5813a2b7f --- /dev/null +++ b/wolnelektury/templates/superbase.html @@ -0,0 +1,201 @@ + + + {% load cache compressed i18n %} + {% load catalogue_tags reporting_stats sponsor_tags %} + + + + + + + + + {% block ogextra %}{% endblock %} + + + {% block title %}{% trans "Wolne Lektury" %} :: + {% block titleextra %}{% endblock %}{% endblock %} + + + {% compressed_css "all" %} + {% compressed_css "screen" %} + + + + + {% block extrahead %} + {% endblock %} + + + + {% block bodycontent %} + +
+ + + +
+
+ + + +
+ +
+ + {{search_form.q}} + +
+ +
+ +
+
+ + + +
+
+ + + +
+ + + +
+ + + + {% block body %} + {% endblock %} + + + + +
+ +
{# end main-content #} + + + + + + + {# template #} +
+ +
+

* {% trans "Loading" %}

+
+
+ + + {% endblock bodycontent %} + + + + + {% compressed_js "base" %} + + + + -- 2.20.1