-
Notifications
You must be signed in to change notification settings - Fork 411
/
_paper_list.html
397 lines (394 loc) · 22.6 KB
/
_paper_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
{% from 'message_box.html' import message_box %}
{% from 'events/management/_lists.html' import render_displayed_entries_fragment, render_num_reviews_tooltip %}
{% macro _render_paper_state(paper) %}
{% set paper_css_class = paper.state.css_class %}
<div class="i-tag outline semantic-text state-badge {{ paper_css_class }}"
data-qbubble="{{ render_num_reviews_tooltip(paper.last_revision)|trim|forceescape }}">
{% if paper.state.name == 'submitted' and paper.can_judge(session.user) %}
{% trans count=paper.last_revision.reviews|length -%}
{{- count }} review
{%- pluralize -%}
{{- count }} reviews
{%- endtrans %}
{% else %}
{{- paper.state.title -}}
{% endif %}
</div>
{% endmacro %}
{% macro render_paper_assignment_list(event, total_entries, contribs, static_columns, management=false) %}
{% if not contribs %}
{%- call message_box('info') %}
{%- if total_entries %}
{%- trans -%}
The filtering criteria do not match with any of the existing papers. Try to clear the filters.
{%- endtrans %}
{%- else %}
{%- trans %}There are no papers yet.{% endtrans %}
{%- endif %}
{%- endcall %}
{%- else %}
<form method="POST">
<input type="hidden" name="csrf_token" value="{{ session.csrf_token }}">
<table class="i-table tablesorter">
<thead>
<tr class="i-table">
<th class="i-table thin-column" data-sorter="false"></th>
<th class="i-table id-column">
{%- trans %}ID{% endtrans -%}
</th>
<th class="i-table title-column">
{%- trans %}Title{% endtrans -%}
</th>
{% for item in static_columns %}
<th class="i-table">{{ item.caption }}</th>
{% endfor %}
<th class="i-table {{ 'revision-column' if not management }}">
{%- trans %}Revision{% endtrans -%}
</th>
{% if management %}
<th class="i-table judge-column" data-sorter="false">
{%- trans %}Judges{% endtrans -%}
</th>
{% endif %}
{% if event.cfp.content_reviewing_enabled %}
<th class="i-table content-reviewers-column" data-sorter="false">
{%- trans %}Content reviewers{% endtrans -%}
</th>
{% endif %}
{% if event.cfp.layout_reviewing_enabled %}
<th class="i-table layout-reviewers-column" data-sorter="false">
{%- trans %}Layout reviewers{% endtrans -%}
</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for contrib in contribs %}
{% if contrib.paper %}
{% set last_revision_state = contrib.paper.last_revision.state.title %}
{% else %}
{% set last_revision_state %}
{%- trans %}Paper not yet submitted{% endtrans -%}
{% endset %}
{% endif %}
<tr id="contrib-{{ contrib.id }}" class="i-table contribution-row"
data-friendly-id="{{ contrib.friendly_id }}"
data-title="{{ contrib.title }}">
<td class="i-table id-column">
<span class="vertical-aligner">
<input type="checkbox" class="select-row"
name="contribution_id"
value="{{ contrib.id }}">
</span>
</td>
<td class="i-table id-column">
<span class="vertical-aligner">{{ contrib.friendly_id }}</span>
</td>
<td class="i-table title-column"
data-searchable="{{ contrib.title | lower }}"
data-text="{{ contrib.title | lower }}">
<span class="vertical-aligner">
{% if contrib.paper %}
<a href="{{ url_for('.paper_timeline', contrib) }}">
{{- contrib.title -}}
</a>
{% else %}
{{- contrib.title -}}
{% endif %}
</span>
</td>
{% for item in static_columns %}
{% if item.id == 'state' %}
{% set sort_text = '' %}
{% if contrib.paper %}
{% set acceptances = contrib.paper.last_revision.reviews|selectattr('proposed_action.name', 'equalto', 'accept')|list|length %}
{% set sort_text = '{}-{}-{}'.format('1' if contrib.paper.is_in_final_state else '0', contrib.paper.last_revision.state.name, acceptances) %}
{% endif %}
<td class="i-table"
data-searchable="{{ last_revision_state|lower }}"
data-text="{{ sort_text }}">
{% if contrib.paper %}
<span class="vertical-aligner">
{{ _render_paper_state(contrib.paper) }}
</span>
{% else %}
<span class="i-tag outline semantic-text state-badge">
{% trans %}Not submitted{% endtrans %}
</span>
{% endif %}
</td>
{% elif item.id == 'track' %}
<td class="i-table track-column"
data-searchable="{{ contrib.track.title|lower if contrib.track }}">
<span class="vertical-aligner">
{%- if contrib.track -%}
{{ contrib.track.title_with_group }}
{%- else -%}
{% trans %}No track{% endtrans %}
{%- endif -%}
</span>
</td>
{% elif item.id == 'session' %}
<td class="i-table"
data-searchable="{{ contrib.session.title|lower if contrib.session }}">
<span class="vertical-aligner">
{%- if contrib.session -%}
{% trans title=contrib.session.title -%}
{{ title }}
{%- endtrans %}
{%- else -%}
{% trans %}No session{% endtrans %}
{%- endif -%}
</span>
</td>
{% elif item.id == 'type' %}
<td class="i-table"
data-searchable="{{ contrib.type.name|lower if contrib.type }}">
<span class="vertical-aligner">
{%- if contrib.type -%}
{{ contrib.type.name }}
{%- else -%}
{% trans %}n/a{% endtrans %}
{%- endif -%}
</span>
</td>
{% endif %}
{% endfor %}
<td class="i-table revision-column">
<span class="vertical-aligner">
{%- if contrib.paper.revision_count -%}
{{ contrib.paper.revision_count }}
{%- endif -%}
</span>
</td>
{% if management %}
<td class="i-table person-row-cell"
data-searchable="{{ contrib.paper_judges|join(', ', attribute='name')|lower }}">
<span class="vertical-aligner">
{% for judge in contrib.paper_judges|sort(attribute='display_full_name') -%}
<div class="person-row icon-user">{{ judge.display_full_name }}</div>
{%- endfor %}
</span>
</td>
{% endif %}
{% if event.cfp.content_reviewing_enabled %}
<td class="i-table person-row-cell"
data-searchable="{{ contrib.paper_content_reviewers|join(', ', attribute='name')|lower }}">
<span class="vertical-aligner">
{% for reviewer in contrib.paper_content_reviewers|sort(attribute='display_full_name') -%}
<div class="person-row icon-user">{{ reviewer.display_full_name }}</div>
{%- endfor %}
</span>
</td>
{% endif %}
{% if event.cfp.layout_reviewing_enabled %}
<td class="i-table person-row-cell"
data-searchable="{{ contrib.paper_layout_reviewers|join(', ', attribute='name')|lower }}">
<span class="vertical-aligner">
{% for reviewer in contrib.paper_layout_reviewers|sort(attribute='display_full_name') -%}
<div class="person-row icon-user">{{ reviewer.display_full_name }}</div>
{%- endfor %}
</span>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</form>
{%- endif %}
{% endmacro %}
{% macro render_paper_assignment_content(event, total_entries, contribs, static_columns, selected_entry=none,
management=false) %}
<div class="toolbars space-after">
<div class="toolbar">
<button class="i-button icon-checkbox-checked arrow js-dropdown" data-toggle="dropdown"></button>
<ul class="i-dropdown">
<li>
<a href="#" data-select-all="#assignment-list input:checkbox">{% trans %}All{% endtrans %}</a>
</li>
<li>
<a href="#" data-select-none="#assignment-list input:checkbox">{% trans %}None{% endtrans %}</a>
</li>
</ul>
<button class="i-button icon-settings js-dialog-action js-customize-list highlight"
data-href="{{ url_for('.customize_paper_list', event) }}"
data-title="{% trans %}Customize list{% endtrans %}"
data-dialog-classes="list-filter-dialog"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-ajax-dialog>
{%- trans %}Customize list{% endtrans -%}
</button>
<button class="i-button arrow js-dropdown js-enable-if-checked disabled hide-if-locked"
data-toggle="dropdown">
{%- trans %}Assign{% endtrans -%}
</button>
<ul class="i-dropdown hide-if-locked">
{% if management %}
<li>
<a class="js-requires-selected-row disabled"
data-title="{% trans %}Assign judges to selected contributions{% endtrans %}"
data-href="{{ url_for('.assign_papers', event, role='judge') }}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Judges{% endtrans %}
</a>
</li>
{% endif %}
{% if event.cfp.content_reviewing_enabled %}
<li>
<a class="js-requires-selected-row disabled"
data-title="{% trans %}Assign content reviewers to selected contributions{% endtrans %}"
data-href="{{ url_for('.assign_papers', event, role='content_reviewer') }}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Content reviewers{% endtrans %}
</a>
</li>
{% endif %}
{% if event.cfp.layout_reviewing_enabled %}
<li>
<a class="js-requires-selected-row disabled"
data-title="{% trans %}Assign layout reviewers to selected contributions{% endtrans %}"
data-href="{{ url_for('.assign_papers', event, role='layout_reviewer') }}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Layout reviewers{% endtrans %}
</a>
</li>
{% endif %}
</ul>
<button class="i-button arrow js-dropdown js-enable-if-checked disabled hide-if-locked"
data-toggle="dropdown">
{%- trans %}Unassign{% endtrans -%}
</button>
<ul class="i-dropdown hide-if-locked">
{% if management %}
<li>
<a class="js-requires-selected-row disabled"
data-title="{% trans %}Unassign judges from selected contributions{% endtrans %}"
data-href="{{ url_for('.unassign_papers', event, role='judge') }}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Judges{% endtrans %}
</a>
</li>
{% endif %}
{% if event.cfp.content_reviewing_enabled %}
<li>
<a class="js-requires-selected-row disabled"
data-title="{% trans %}Unassign content reviewers from selected contributions{% endtrans %}"
data-href="{{ url_for('.unassign_papers', event, role='content_reviewer') }}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Content reviewers{% endtrans %}
</a>
</li>
{% endif %}
{% if event.cfp.layout_reviewing_enabled %}
<li>
<a class="js-requires-selected-row disabled"
data-title="{% trans %}Unassign layout reviewers from selected contributions{% endtrans %}"
data-href="{{ url_for('.unassign_papers', event, role='layout_reviewer') }}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Layout reviewers{% endtrans %}
</a>
</li>
{% endif %}
</ul>
<button class="i-button arrow js-dropdown icon-hammer js-requires-selected-row disabled hide-if-locked"
data-toggle="dropdown">
{%- trans %}Judge{% endtrans -%}
</button>
<ul class="i-dropdown hide-if-locked">
<li>
<a class="js-requires-selected-row js-dialog-action"
data-href="{{ url_for('.judge_papers', event) }}"
data-title="{% trans %}Accept selected papers{% endtrans %}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-params='{"judgment": "accept"}'
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Accepted{% endtrans -%}
</a>
</li>
<li>
<a class="js-requires-selected-row js-dialog-action"
data-href="{{ url_for('.judge_papers', event) }}"
data-title="{% trans %}Reject selected papers{% endtrans %}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-params='{"judgment": "reject"}'
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}Rejected{% endtrans -%}
</a>
</li>
<li>
<a class="js-requires-selected-row js-dialog-action"
data-href="{{ url_for('.judge_papers', event) }}"
data-title="{% trans %}Mark to be corrected selected papers{% endtrans %}"
data-params-selector="#assignment-list input[name=contribution_id]:checked"
data-params='{"judgment": "to_be_corrected"}'
data-update='{"html": "#assignment-list", "filter_statistics": "#filter-statistics"}'
data-method="POST"
data-ajax-dialog>
{%- trans %}To be corrected{% endtrans -%}
</a>
</li>
</ul>
<div id="authors-list-container"
class="group"
data-event-id="{{ event.id }}"
data-object-context="contributions"
data-params-selector="#assignment-list input[name=contribution_id]:checked">
</div>
<button class="i-button icon-attachment js-requires-selected-row disabled js-submit-list-form"
data-href="{{ url_for('.download_papers', event) }}">
{%- trans %}Download papers{% endtrans -%}
</button>
{% if management %}
<button class="i-button icon-attachment js-requires-selected-row disabled js-submit-list-form"
data-href="{{ url_for('.export_json', event) }}">
{%- trans %}Export as JSON{% endtrans -%}
</button>
{% endif %}
</div>
<div class="toolbar">
<div class="group">
<div id="filter-statistics">
{{ render_displayed_entries_fragment(contribs|length, total_entries) }}
</div>
</div>
<div class="group">
<span class="i-button label icon-search"></span>
<input type="text" id="search-input" placeholder="{% trans %}Enter #id or search string{% endtrans %}">
</div>
</div>
</div>
<div class="list" id="assignment-list">
{{ render_paper_assignment_list(event, total_entries, contribs, static_columns, management=management) }}
</div>
<div id="filter-placeholder"></div>
<script>
{% if selected_entry %}
$('#search-input').val('#{{ selected_entry }}').trigger('change');
{% endif %}
setupPaperAssignmentList();
setupAuthorsListButton('#authors-list-container');
</script>
{% endmacro %}