From 062c5ec3437a944e39b486d36a54a6a11fa332d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Sat, 13 Sep 2008 23:36:10 +0200 Subject: [PATCH] Added link to download all books from current shelf. --- apps/catalogue/views.py | 2 +- wolnelektury/media/css/master.css | 13 +++++++++++++ .../templates/catalogue/tagged_object_list.html | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index ade37e52a..052537491 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -103,7 +103,7 @@ def tagged_object_list(request, tags=''): raise Http404 model = models.Book - shelf_is_set = any(tag.category == 'set' for tag in tags) + shelf_is_set = (len(tags) == 1 and tags[0].category == 'set') theme_is_set = any(tag.category == 'theme' for tag in tags) if theme_is_set: model = models.Fragment diff --git a/wolnelektury/media/css/master.css b/wolnelektury/media/css/master.css index cb39604c6..860a2dd50 100644 --- a/wolnelektury/media/css/master.css +++ b/wolnelektury/media/css/master.css @@ -321,6 +321,19 @@ div.shown-tags p { color: #999; } +#download-shelf { + display: block; + width: 100%; + height: 1.5em; + background-color: #EEE; + margin-top: 0.5em; + padding: 0.5em 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + text-align: center; +} + /* ============================ */ /* = Books and fragments list = */ /* ============================ */ diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html index aef6ad5c3..4567e742a 100644 --- a/wolnelektury/templates/catalogue/tagged_object_list.html +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -71,6 +71,11 @@

Zwiń opis ▲

{% endif %} {% endwith %} + {% if shelf_is_set %} + + Pobierz wszystkie książki z tej półki + + {% endif %}
    {% for book in object_list %}
  1. {{ book.short_html }}
  2. -- 2.20.1