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
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 = */
/* ============================ */
<div id="toggle-description"><p>Zwiń opis ▲</p></div>
{% endif %}
{% endwith %}
+ {% if shelf_is_set %}
+ <a id="download-shelf">
+ Pobierz wszystkie książki z tej półki
+ </a>
+ {% endif %}
<ol>
{% for book in object_list %}
<li>{{ book.short_html }}</li>