Housekeeping: removed celery dependency and some unused code.
[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></th>
23         <th class='book-search-column'>
24             <form>
25             <input title='{% trans "Search in book titles" %}' name="title"
26                 class='text-filter' value="{{ request.GET.title }}" />
27             </form>
28         </th>
29         <th><select name="stage" class="filter">
30             <option value=''>- {% trans "stage" %} -</option>
31             <option {% if request.GET.stage == '-' %}selected="selected"
32                     {% endif %}value="-">- {% trans "none" %} -</option>
33             {% for stage in stages %}
34                 <option {% if request.GET.stage == stage.slug %}selected="selected"
35                     {% endif %}value="{{ stage.slug }}">{{ stage.name }}</option>
36             {% endfor %}
37         </select></th>
38
39         {% if not viewed_user %}
40             <th><select name="user" class="filter">
41                 <option value=''>- {% trans "editor" %} -</option>
42                 <option {% if request.GET.user == '-' %}selected="selected"
43                         {% endif %}value="-">- {% trans "none" %} -</option>
44                 {% for user in users %}
45                     <option {% if request.GET.user == user.username %}selected="selected"
46                         {% endif %}value="{{ user.username }}">{{ user|username }} ({{ user.count }})</option>
47                 {% endfor %}
48             </select></th>
49         {% else %}
50             <th style='display: none'></th>
51         {% endif %}
52
53         <th><select name="status" class="filter">
54             <option value=''>- {% trans "status" %} -</option>
55             {% for state, label in states %}
56                 <option {% if request.GET.status == state %}selected="selected"
57                         {% endif %}value='{{ state }}'>{{ label }}</option>
58             {% endfor %}
59         </select></th>
60
61         <th><select name="project" class="filter">
62             <option value=''>- {% trans "project" %} -</option>
63                 <option {% if request.GET.project == '-' %}selected="selected"
64                         {% endif %}value="-">- {% trans "none" %} -</option>
65             {% for project in projects %}
66                 <option {% if request.GET.project == project.pk|slugify %}selected="selected"
67                         {% endif %}value='{{ project.pk }}'>{{ project.name }}</option>
68             {% endfor %}
69         </select></th>
70
71     </tr></thead>
72
73     {% with cnt=books|length %}
74     {% autopaginate books 100 %}
75     <tbody>
76     {% for item in books %}
77         {% with book=item.book chunk=item.chunks.0  %}
78             {% include 'catalogue/book_list/book.html' %}
79             {% if not book.single %}
80                 {% for chunk in item.chunks %}
81                     {% include 'catalogue/book_list/chunk.html' %}
82                 {% endfor %}
83             {% endif %}
84         {% endwith %}
85     {% endfor %}
86     <tr><th class='paginator' colspan="6">
87         {% paginate %}
88         {% blocktrans count c=cnt %}{{c}} book{% plural %}{{c}} books{% endblocktrans %}</th></tr>
89     </tbody>
90     {% endwith %}
91 </table>
92 {% if not books %}
93     <p>{% trans "No books found." %}</p>
94 {% endif %}
95
96 <form id='chunk_mass_edit' action='{% url "catalogue_chunk_mass_edit" %}' style="display:none;">
97 {% csrf_token %}
98 <input type="hidden" name="ids" />
99 <label for="mass_edit_stage">{% trans "Set stage" %}</label><input type="hidden" name="stage" id="mass_edit_stage"/>
100 <label for="mass_edit_user">{% trans "Set user" %}</label><input type="hidden" name="user" id="mass_edit_user" />
101 <input type="hidden" name="status" />
102 <label for="mass_edit_project">{% trans "Project" %}</label><input type="hidden" name="project" id="mass_edit_project" />
103 <label for="mass_edit_more_users">{% trans "More users" %}</label>
104 </form>
105
106 <select name="other-user" style="display:none;">
107   {% for user in other_users %}
108   <option {% if request.GET.user == user.username %}selected="selected"
109           {% endif %}value="{{ user.username }}">{{ user|username }} ({{ user.count }})</option>
110   {% endfor %}
111 </select>