From: Marek Stępniowski Date: Sat, 13 Sep 2008 21:36:10 +0000 (+0200) Subject: Added link to download all books from current shelf. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/062c5ec3437a944e39b486d36a54a6a11fa332d1?ds=sidebyside;hp=f2f7dc5451e8e2f7dbf385998088618ef2e4538f Added link to download all books from current shelf. --- 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 }}