From: Radek Czajka Date: Tue, 19 Nov 2013 13:10:35 +0000 (+0100) Subject: Merge branch 'master' into rwd X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/64cf4d889127d7dc3ea893e8a27711468276dc47?ds=sidebyside;hp=-c Merge branch 'master' into rwd Conflicts: apps/catalogue/templates/catalogue/book_short.html apps/funding/static/funding/funding.css apps/wolnelektury_core/templates/main_page.html --- 64cf4d889127d7dc3ea893e8a27711468276dc47 diff --combined apps/catalogue/templates/catalogue/book_detail.html index bf8a726f1,f266742c1..480c85a28 --- a/apps/catalogue/templates/catalogue/book_detail.html +++ b/apps/catalogue/templates/catalogue/book_detail.html @@@ -1,7 -1,7 +1,7 @@@ {% extends "base.html" %} - {% load cache i18n %} + {% load i18n %} {% load thumbnail %} - {% load common_tags catalogue_tags pagination_tags %} + {% load common_tags catalogue_tags %} {% block titleextra %}{{ book.pretty_title }}{% endblock %} {% block ogimage %}{% if book.cover %}{{ book.cover.url|build_absolute_uri:request }}{% endif %}{% endblock %} @@@ -17,9 -17,7 +17,9 @@@ {% work_list book_children %} -

{% trans "See also" %}:

+
+

{% trans "See also" %}:

{% related_books book %} +
{% endblock %} diff --combined apps/catalogue/templates/catalogue/book_short.html index c8fb9520b,96ceaa6c6..4acefe285 --- a/apps/catalogue/templates/catalogue/book_short.html +++ b/apps/catalogue/templates/catalogue/book_short.html @@@ -2,10 -2,23 +2,10 @@@ {% load catalogue_tags social_tags %} {% load thumbnail %}
-
+
+
-
- {% if book.cover %} - {% if main_link %}{% endif %} - Cover - {% if main_link %}{% endif %} - {% endif %} - {% block cover-area-extra %}{% endblock %} -
@@@ -27,9 -40,9 +27,9 @@@
-
+
- {% for name, slug in related.tags.author %} - {{ name }}{% if not forloop.last %}, + {% for tag in related.tags.author %} + {% related_tag_name tag %}{% if not forloop.last %}, {% endif %}{% endfor %}{% for title, slug in related.parents %}, {{ title }}{% endfor %}
@@@ -40,46 -53,29 +40,46 @@@
+
+ {% if book.cover %} + {% if main_link %}{% endif %} + Cover + {% if main_link %}{% endif %} + {% endif %} + {% block cover-area-extra %}{% endblock %} +
{% spaceless %} + {% trans "Epoch" %}:  - {% for name, slug in related.tags.epoch %} - {{ name }} + {% for tag in related.tags.epoch %} + {% related_tag_name tag %} - {% if not forloop.last %}{% endif %} + {% if not forloop.last %}, {% endif %} {% endfor %} - + + {% trans "Kind" %}:  - {% for name, slug in related.tags.kind %} - {{ name }} + {% for tag in related.tags.kind %} + {% related_tag_name tag %} - {% if not forloop.last %}{% endif %} + {% if not forloop.last %}, {% endif %} {% endfor %} - + + {% trans "Genre" %}:  - {% for name, slug in related.tags.genre %} - {{ name }} + {% for tag in related.tags.genre %} + {% related_tag_name tag %} - {% if not forloop.last %}{% endif %} + {% if not forloop.last %}, {% endif %} {% endfor %} - + {% endspaceless %}
@@@ -89,12 -85,12 +89,12 @@@ {% block book-box-extra-info %}{% endblock %} {% block box-append %} {% endblock %} +
{% block right-column %} {% endblock %}
diff --combined apps/catalogue/views.py index 50b6e3e73,d2b79c7ee..b0575403b --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@@ -17,7 -17,7 +17,7 @@@ from django.contrib.auth.decorators imp from django.utils.datastructures import SortedDict from django.utils.http import urlquote_plus from django.utils import translation - from django.utils.translation import ugettext as _, ugettext_lazy + from django.utils.translation import get_language, ugettext as _, ugettext_lazy from django.views.decorators.vary import vary_on_headers from ajaxable.utils import JSONResponse, AjaxableFormView @@@ -36,7 -36,7 +36,7 @@@ permanent_cache = get_cache('permanent' @vary_on_headers('X-Requested-With') def catalogue(request): - cache_key='catalogue.catalogue' + cache_key='catalogue.catalogue/' + get_language() output = permanent_cache.get(cache_key) if output is None: tags = models.Tag.objects.exclude( @@@ -70,6 -70,7 +70,7 @@@ def book_list(request, filter=None, get context=None, ): """ generates a listing of all books, optionally filtered with a test function """ + cache_key = "%s/%s" % (cache_key, get_language()) cached = permanent_cache.get(cache_key) if cached is not None: rendered_nav, rendered_book_list = cached @@@ -289,14 -290,6 +290,14 @@@ def book_text(request, slug) related = book.related_info() return render_to_response('catalogue/book_text.html', locals(), context_instance=RequestContext(request)) +def book_text2(request, slug): + book = get_object_or_404(models.Book, slug=slug) + + if not book.has_html_file(): + raise Http404 + related = book.related_info() + return render_to_response('catalogue/book_text_new.html', locals(), + context_instance=RequestContext(request)) # ========== diff --combined apps/wolnelektury_core/templates/main_page.html index 54ca0031f,812094fce..fd51cf371 --- a/apps/wolnelektury_core/templates/main_page.html +++ b/apps/wolnelektury_core/templates/main_page.html @@@ -7,47 -7,47 +7,47 @@@ {% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %} {% block body %} -
{% render_cite cite %} -
+ {% spaceless %} -
-

- {% trans "What's new?" %} -

-
- {% chunk "promo" %} -
-
+
+

{% trans "What's new?" %}

+
+ {% chunk "promo" %} +
+
-

{% trans "Recent publications" %}

+
+

{% trans "Recent publications" %}

- {% cache 60 last-published-on-main %} + {% cache 60 last-published-on-main LANGUAGE_CODE %} {% for book in last_published %} {% book_mini book %} {% endfor %} {% endcache %} +
-
-

{% trans "News" %}

+
+

{% trans "News" %}

{# 135 is the id of new publications category of our master blog. perhaps this URL should go to settings. #} {% cache 1800 latest-blog-posts %} {% latest_blog_posts "http://nowoczesnapolska.org.pl/feed/?cat=-135" %} {% endcache %} -
+ -
-

{% trans "Utilities" %}

+
+

{% trans "Utilities" %}

-
+ -
-

{% trans "Information" %}

+
+

{% trans "Information" %}

-
+ {% endspaceless %}