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