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