Merge branch 'with-dvcs'
[redakcja.git] / apps / catalogue / templates / catalogue / book_list / book_list.html
1 {% load i18n %}
2 {% load pagination_tags %}
3
4
5 <form name='filter' action=''>
6 <input type='hidden' name="title" value="{{ request.GET.title }}" />
7 <input type='hidden' name="stage" value="{{ request.GET.stage }}" />
8 {% if not viewed_user %}
9     <input type='hidden' name="user" value="{{ request.GET.user }}" />
10 {% endif %}
11 <input type='hidden' name="all" value="{{ request.GET.all }}" />
12 <input type='hidden' name="status" value="{{ request.GET.status }}" />
13 </form>
14
15 <table id="file-list"{% if viewed_user %} class="book-list-user"{% endif %}>
16     <thead><tr>
17         <th></th>
18         <th>
19             <input class='check-filter' type='checkbox' name='all' title='{% trans "Show hidden books" %}'
20                 {% if request.GET.all %}checked='checked'{% endif %} />
21             </th>
22         <th class='book-search-column'>
23             <form>
24             <input title='{% trans "Search in book titles" %}' name="title"
25                 class='text-filter' value="{{ request.GET.title }}" />
26             </form>
27         </th>
28         <th><select name="stage" class="filter">
29             <option value=''>- {% trans "stage" %} -</option>
30             <option {% if request.GET.stage == '-' %}selected="selected"
31                     {% endif %}value="-">- {% trans "none" %} -</option>
32             {% for stage in stages %}
33                 <option {% if request.GET.stage == stage.slug %}selected="selected"
34                     {% endif %}value="{{ stage.slug }}">{{ stage.name }}</option>
35             {% endfor %}
36         </select></th>
37
38         {% if not viewed_user %}
39             <th><select name="user" class="filter">
40                 <option value=''>- {% trans "editor" %} -</option>
41                 <option {% if request.GET.user == '-' %}selected="selected"
42                         {% endif %}value="-">- {% trans "none" %} -</option>
43                 {% for user in users %}
44                     <option {% if request.GET.user == user.username %}selected="selected"
45                         {% endif %}value="{{ user.username }}">{{ user.first_name }} {{ user.last_name }} ({{ user.count }})</option>
46                 {% endfor %}
47             </select></th>
48         {% endif %}
49
50         <th><select name="status" class="filter">
51             <option value=''>- {% trans "status" %} -</option>
52             {% for state, label in states %}
53                 <option {% if request.GET.status == state %}selected="selected"
54                         {% endif %}value='{{ state }}'>{{ label }}</option>
55             {% endfor %}
56         </select></th>
57
58     </tr></thead>
59
60     {% with cnt=books|length %}
61     {% autopaginate books 100 %}
62     <tbody>
63     {% for item in books %}
64         {% with item.book as book %}
65             {{ book.short_html|safe }}
66             {% if not book.single %}
67                 {% for chunk in item.chunks %}
68                     {{ chunk.short_html|safe }}
69                 {% endfor %}
70             {% endif %}
71         {% endwith %}
72     {% endfor %}
73     <tr><th class='paginator' colspan="5">
74         {% paginate %}
75         {% blocktrans count c=cnt %}{{c}} book{% plural %}{{c}} books{% endblocktrans %}</th></tr>
76     </tbody>
77     {% endwith %}
78 </table>
79 {% if not books %}
80     <p>{% trans "No books found." %}</p>
81 {% endif %}