ded592276dfdf3ca6d1cfe05a2a37ff4bd0e8617
[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 <input type='hidden' name="project" value="{{ request.GET.project }}" />
14 </form>
15
16
17 <table id="file-list"{% if viewed_user %} class="book-list-user"{% endif %}>
18     <thead><tr>
19         <th></th>
20         <th class='book-search-column'>
21             <form>
22             <input title='Szukaj w tytułach modułów' name="title"
23                 class='text-filter' value="{{ request.GET.title }}" />
24             </form>
25         </th>
26         <th><select name="stage" class="filter">
27             <option value=''>- {% trans "stage" %} -</option>
28             <option {% if request.GET.stage == '-' %}selected="selected"
29                     {% endif %}value="-">- {% trans "none" %} -</option>
30             {% for stage in stages %}
31                 <option {% if request.GET.stage == stage.slug %}selected="selected"
32                     {% endif %}value="{{ stage.slug }}">{{ stage.name }}</option>
33             {% endfor %}
34         </select></th>
35
36         {% if not viewed_user %}
37             <th><select name="user" class="filter">
38                 <option value=''>- {% trans "editor" %} -</option>
39                 <option {% if request.GET.user == '-' %}selected="selected"
40                         {% endif %}value="-">- {% trans "none" %} -</option>
41                 {% for user in users %}
42                     <option {% if request.GET.user == user.username %}selected="selected"
43                         {% endif %}value="{{ user.username }}">{{ user.first_name }} {{ user.last_name }} ({{ user.count }})</option>
44                 {% endfor %}
45             </select></th>
46         {% endif %}
47
48         <th><select name="project" class="filter">
49             <option value=''>- poziom edukacyjny -</option>
50                 <option {% if request.GET.project == '-' %}selected="selected"
51                         {% endif %}value="-">- {% trans "none" %} -</option>
52             {% for project in projects %}
53                 <option {% if request.GET.project == project.pk|slugify %}selected="selected"
54                         {% endif %}value='{{ project.pk }}'>{{ project.name }}</option>
55             {% endfor %}
56         </select></th>
57
58         <th></th>
59     </tr></thead>
60
61     {% with cnt=books|length %}
62     {% autopaginate books 100 %}
63     <tbody>
64     {% for item in books %}
65         {% with item.book as book %}
66             {{ book.short_html|safe }}
67             {% if not book.single %}
68                 {% for chunk in item.chunks %}
69                     {{ chunk.short_html|safe }}
70                 {% endfor %}
71             {% endif %}
72         {% endwith %}
73     {% endfor %}
74     <tr><th class='paginator' colspan="5">
75         {% paginate %}
76         {% blocktrans count c=cnt %}{{c}} module{% plural %}{{c}} modules{% endblocktrans %}</th></tr>
77     </tbody>
78     {% endwith %}
79 </table>
80 {% if not books %}
81     <p>Nie znaleziono modułów.</p>
82 {% endif %}
83
84 <form id='chunk_mass_edit' action='{% url "catalogue_chunk_mass_edit" %}' style="display:none;">
85 {% csrf_token %}
86 <input type="hidden" name="ids" />
87 <label for="mass_edit_stage">{% trans "Set stage" %}</label><input type="hidden" name="stage" id="mass_edit_stage"/>
88 <label for="mass_edit_user">{% trans "Set user" %}</label><input type="hidden" name="user" id="mass_edit_stage" />
89 <input type="hidden" name="status" />
90 <label for="mass_edit_project">Poziom edukacyjny</label><input type="hidden" name="project" id="mass_edit_project" />
91 <label for="mass_edit_publish">{% trans "Mark publishable" %}</label>
92 <label for="mass_edit_unpublish">{% trans "Mark not publishable" %}</label>
93 <label for="mass_edit_other">{% trans "Other user" %}</label>
94 </form>
95
96 <select name="other-user" style="display:none;">
97   {% for user in other_users %}
98   <option {% if request.GET.user == user.username %}selected="selected"
99           {% endif %}value="{{ user.username }}">{{ user.first_name }} {{ user.last_name }} ({{ user.count }})</option>
100   {% endfor %}
101 </select>