Added caching of latest blog posts fetched from wolnepodreczniki blog.
[wolnelektury.git] / templates / catalogue / tagged_book_list.html
1 {% extends "base.html" %}
2 {% load catalogue_tags pagination_tags %}
3
4 {% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %}
5
6 {% block bodyid %}books{% endblock %}
7
8 {% block extrahead %}
9     <script type="text/javascript">
10         $(function() {            
11             // $('#tags-list ul').addClass('dontsplit');
12             // $('#tags-list').columnize({width: 180});
13             
14             $('#books-list .book').hover(
15                 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
16                 function() { $(this).css({background: '#FFF'}); }
17             ).click(function() {
18                 location.href = $('h2 a', this).attr('href');
19             });
20             
21             $('#toggle-description').hover(
22                 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
23                 function() { $(this).css({background: '#EEE'}); }
24             ).click(function() {
25                 if ($('#description').hasClass('hidden')) {
26                     $('#description').slideDown('fast').removeClass('hidden');
27                     $('p', this).html('Zwiń opis ▲');
28                 } else {
29                     $('#description').slideUp('fast').addClass('hidden');
30                     $('p', this).html('Rozwiń opis ▼');
31                 }
32             });
33             
34             var target = $('#set-window div.target');
35             
36             $('#set-window').jqm({
37                 ajax: '@href', 
38                 target: target[0],
39                 overlay: 60,
40                 trigger: 'a.jqm-trigger', 
41                 onShow: function(hash) { 
42                     var offset = $(hash.t).offset();
43                     target.html('<p><img src="/media/img/indicator.gif" /> Ładowanie</p>');
44                     hash.w.css({position: 'absolute', left: offset.left, top: offset.top}).show() },
45                 onLoad: function(hash) { 
46                     $('form', hash.w).ajaxForm({
47                         target: target,
48                         success: function() { setTimeout(function() { $('#set-window').jqmHide() }, 1000) }
49                     });
50                 }});
51         });
52     </script>
53 {% endblock %}
54
55 {% block body %}
56     <h1>{% title_from_tags tags %}</h1>
57     {% breadcrumbs tags %}
58     {# <form action="." method="get" accept-charset="utf-8" id="search-form"> #}
59     {#     <ol> #}
60     {#         {% for tag in tags %} #}
61     {#         <li class="category"><a href="{% catalogue_url tag %}">{{ tag }}</a> | <a href="{% catalogue_url tags -tag %}">x</a></li> #}
62     {#         {% endfor %} #}
63     {#         <li>{{ form.q }} <input type="submit" value="Szukaj"/></li> #}
64     {#     </ol> #}
65     {# </form> #}
66     
67     {% autopaginate object_list 10 %}
68     <div id="books-list">
69         {% with tags|last as last_tag %}
70         {% if last_tag.has_description %}
71             <div id="description">
72                 {{ last_tag.description|safe }}
73             </div>
74             <div id="toggle-description"><p>Zwiń opis ▲</p></div>
75         {% endif %}
76         {% endwith %}
77         <ol>
78         {% for book in object_list %}
79             <li>{% include "catalogue/_book.html" %}</li>
80         {% endfor %}
81         </ol>
82         {% paginate %}
83     </div>
84     <div id="tags-list">
85         <div class="dontsplit">
86             {% if categories.set %}
87                 <h2>Zestawy</h2>
88                 <ul>
89                 {% for set in categories.set %}
90                     <li><a href="{% catalogue_url tags set %}">{{ set }}&nbsp;({{ set.count }})</a></li>
91                 {% endfor %}
92                 </ul>
93             {% endif %}
94         </div>
95         <div class="dontsplit">
96             {% if categories.author %}
97                 <h2>Autorzy</h2>
98                 <ul>
99                 {% for author in categories.author %}
100                     <li><a href="{% catalogue_url tags author %}">{{ author }}&nbsp;({{ author.count }})</a></li>
101                 {% endfor %}
102                 </ul>
103             {% endif %}
104         </div>
105         <div class="dontsplit">
106             {% if categories.epoch %}
107                 <h2>Epoki</h2>
108                 <ul>
109                 {% for epoch in categories.epoch %}
110                     <li><a href="{% catalogue_url tags epoch %}">{{ epoch }}&nbsp;({{ epoch.count }})</a></li>
111                 {% endfor %}
112                 </ul>
113             {% endif %}
114         </div>
115         <div class="dontsplit">
116             {% if categories.kind %}
117                 <h2>Rodzaje</h2>
118                 <ul>
119                 {% for kind in categories.kind %}
120                     <li><a href="{% catalogue_url tags kind %}">{{ kind }}&nbsp;({{ kind.count }})</a></li>
121                 {% endfor %}
122                 </ul>
123             {% endif %}
124         </div>
125         <div class="dontsplit">
126             {% if categories.genre %}
127                 <h2>Gatunki literackie</h2>
128                 <ul>
129                 {% for genre in categories.genre %}
130                     <li><a href="{% catalogue_url tags genre %}">{{ genre }}&nbsp;({{ genre.count }})</a></li>
131                 {% endfor %}
132                 </ul>
133             {% endif %}
134         </div>
135         <div class="dontsplit">
136             {% if categories.theme %}
137                 <h2>Motywy</h2>
138                 <ul>
139                 {% for theme in categories.theme %}
140                     <li><a href="{% catalogue_url tags theme %}">{{ theme }} ({{ theme.count }})</a></li>
141                 {% endfor %}
142                 </ul>
143             {% endif %}
144         </div>
145     </div>
146     <div id="set-window">
147         <div class="header"><a href="#" class="jqmClose">Zamknij</a></div>
148         <div class="target">
149             <p><img src="/media/img/indicator.gif" /> Ładowanie</p>
150         </div>
151     </div>
152 {% endblock %}