Rearrange source to src dir.
[redakcja.git] / src / catalogue / templates / catalogue / book_list / book_list.html
1 {% load i18n %}
2 {% load pagination_tags %}
3 {% load username from common_tags %}
4
5
6 <form name='filter' action='{{ request.path }}'>
7 <input type='hidden' name="title" value="{{ request.GET.title }}" />
8 <input type='hidden' name="stage" value="{{ request.GET.stage }}" />
9 {% if not viewed_user %}
10     <input type='hidden' name="user" value="{{ request.GET.user }}" />
11 {% endif %}
12 <input type='hidden' name="all" value="{{ request.GET.all }}" />
13 <input type='hidden' name="status" value="{{ request.GET.status }}" />
14 <input type='hidden' name="project" value="{{ request.GET.project }}" />
15 </form>
16
17
18 <table id="file-list"{% if viewed_user %} class="book-list-user"{% endif %}>
19     <thead><tr>
20         <th></th>
21         <th></th>
22         <th>
23             <input class='check-filter' type='checkbox' name='all' title='{% trans "Show hidden books" %}'
24                 {% if request.GET.all %}checked='checked'{% endif %} />
25             </th>
26         <th class='book-search-column'>
27             <form>
28             <input title='{% trans "Search in book titles" %}' name="title"
29                 class='text-filter' value="{{ request.GET.title }}" />
30             </form>
31         </th>
32         <th><select name="stage" class="filter">
33             <option value=''>- {% trans "stage" %} -</option>
34             <option {% if request.GET.stage == '-' %}selected="selected"
35                     {% endif %}value="-">- {% trans "none" %} -</option>
36             {% for stage in stages %}
37                 <option {% if request.GET.stage == stage.slug %}selected="selected"
38                     {% endif %}value="{{ stage.slug }}">{{ stage.name }}</option>
39             {% endfor %}
40         </select></th>
41
42         {% if not viewed_user %}
43             <th><select name="user" class="filter">
44                 <option value=''>- {% trans "editor" %} -</option>
45                 <option {% if request.GET.user == '-' %}selected="selected"
46                         {% endif %}value="-">- {% trans "none" %} -</option>
47                 {% for user in users %}
48                     <option {% if request.GET.user == user.username %}selected="selected"
49                         {% endif %}value="{{ user.username }}">{{ user|username }} ({{ user.count }})</option>
50                 {% endfor %}
51             </select></th>
52         {% else %}
53             <th style='display: none'></th>
54         {% endif %}
55
56         <th><select name="status" class="filter">
57             <option value=''>- {% trans "status" %} -</option>
58             {% for state, label in states %}
59                 <option {% if request.GET.status == state %}selected="selected"
60                         {% endif %}value='{{ state }}'>{{ label }}</option>
61             {% endfor %}
62         </select></th>
63
64         <th><select name="project" class="filter">
65             <option value=''>- {% trans "project" %} -</option>
66                 <option {% if request.GET.project == '-' %}selected="selected"
67                         {% endif %}value="-">- {% trans "none" %} -</option>
68             {% for project in projects %}
69                 <option {% if request.GET.project == project.pk|slugify %}selected="selected"
70                         {% endif %}value='{{ project.pk }}'>{{ project.name }}</option>
71             {% endfor %}
72         </select></th>
73
74     </tr></thead>
75
76     {% with cnt=books|length %}
77     {% autopaginate books 100 %}
78     <tbody>
79     {% for item in books %}
80         {% with item.book as book %}
81             {{ book.short_html|safe }}
82             {% if not book.single %}
83                 {% for chunk in item.chunks %}
84                     {{ chunk.short_html|safe }}
85                 {% endfor %}
86             {% endif %}
87         {% endwith %}
88     {% endfor %}
89     <tr><th class='paginator' colspan="6">
90         {% paginate %}
91         {% blocktrans count c=cnt %}{{c}} book{% plural %}{{c}} books{% endblocktrans %}</th></tr>
92     </tbody>
93     {% endwith %}
94 </table>
95 {% if not books %}
96     <p>{% trans "No books found." %}</p>
97 {% endif %}
98
99 <form id='chunk_mass_edit' action='{% url "catalogue_chunk_mass_edit" %}' style="display:none;">
100 {% csrf_token %}
101 <input type="hidden" name="ids" />
102 <label for="mass_edit_stage">{% trans "Set stage" %}</label><input type="hidden" name="stage" id="mass_edit_stage"/>
103 <label for="mass_edit_user">{% trans "Set user" %}</label><input type="hidden" name="user" id="mass_edit_user" />
104 <input type="hidden" name="status" />
105 <label for="mass_edit_project">{% trans "Project" %}</label><input type="hidden" name="project" id="mass_edit_project" />
106 <label for="mass_edit_more_users">{% trans "More users" %}</label>
107 </form>
108
109 <select name="other-user" style="display:none;">
110   {% for user in other_users %}
111   <option {% if request.GET.user == user.username %}selected="selected"
112           {% endif %}value="{{ user.username }}">{{ user|username }} ({{ user.count }})</option>
113   {% endfor %}
114 </select>