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