Changed rendering of fragment lists.
[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     
59     {% autopaginate object_list 10 %}
60     <div id="books-list">
61         {% with tags|last as last_tag %}
62         {% if last_tag.has_description %}
63             <div id="description">
64                 {{ last_tag.description|safe }}
65             </div>
66             <div id="toggle-description"><p>Zwiń opis ▲</p></div>
67         {% endif %}
68         {% endwith %}
69         <ol>
70         {% for book in object_list %}
71             <li>{% book book %}</li>
72         {% endfor %}
73         </ol>
74         {% paginate %}
75     </div>
76     <div id="tags-list">
77         <div class="dontsplit">
78             {% if categories.set %}
79                 <h2>Zestawy</h2>
80                 <ul>
81                 {% for set in categories.set %}
82                     <li><a href="{% catalogue_url tags set %}">{{ set }}&nbsp;({{ set.count }})</a></li>
83                 {% endfor %}
84                 </ul>
85             {% endif %}
86         </div>
87         <div class="dontsplit">
88             {% if categories.author %}
89                 <h2>Autorzy</h2>
90                 <ul>
91                 {% for author in categories.author %}
92                     <li><a href="{% catalogue_url tags author %}">{{ author }}&nbsp;({{ author.count }})</a></li>
93                 {% endfor %}
94                 </ul>
95             {% endif %}
96         </div>
97         <div class="dontsplit">
98             {% if categories.epoch %}
99                 <h2>Epoki</h2>
100                 <ul>
101                 {% for epoch in categories.epoch %}
102                     <li><a href="{% catalogue_url tags epoch %}">{{ epoch }}&nbsp;({{ epoch.count }})</a></li>
103                 {% endfor %}
104                 </ul>
105             {% endif %}
106         </div>
107         <div class="dontsplit">
108             {% if categories.kind %}
109                 <h2>Rodzaje</h2>
110                 <ul>
111                 {% for kind in categories.kind %}
112                     <li><a href="{% catalogue_url tags kind %}">{{ kind }}&nbsp;({{ kind.count }})</a></li>
113                 {% endfor %}
114                 </ul>
115             {% endif %}
116         </div>
117         <div class="dontsplit">
118             {% if categories.genre %}
119                 <h2>Gatunki literackie</h2>
120                 <ul>
121                 {% for genre in categories.genre %}
122                     <li><a href="{% catalogue_url tags genre %}">{{ genre }}&nbsp;({{ genre.count }})</a></li>
123                 {% endfor %}
124                 </ul>
125             {% endif %}
126         </div>
127         <div class="dontsplit">
128             {% if categories.theme %}
129                 <h2>Motywy</h2>
130                 <ul>
131                 {% for theme in categories.theme %}
132                     <li><a href="{% catalogue_url tags theme %}">{{ theme }} ({{ theme.count }})</a></li>
133                 {% endfor %}
134                 </ul>
135             {% endif %}
136         </div>
137     </div>
138     <div id="set-window">
139         <div class="header"><a href="#" class="jqmClose">Zamknij</a></div>
140         <div class="target">
141             <p><img src="/media/img/indicator.gif" /> Ładowanie</p>
142         </div>
143     </div>
144 {% endblock %}