This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
/
table_slice_place.html
175 lines (170 loc) · 8.61 KB
/
table_slice_place.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
{% import "macros/popovers.html" as popovers %}
{% if is_index and not place and data -%}
{% set place = data %}
{%- endif %}
{% if is_index %}
{% set table_id = "place-slice-table-index" %}
{% else %}
{% set table_id = "place-slice-table" %}
{% endif %}
<div class="table-responsive">
<table id="{{ table_id }}" class="table slice-table data-table table-header-stuck">
{% if is_index %}
<colgroup>
<col style="width:24%">
<col style="width:23%">
<col style="width:5%">
<col style="width:6%">
</colgroup>
{% else %}
<colgroup>
<col style="width:20%">
<col style="width:23%">
<col style="width:5%">
<col style="width:8%">
<col style="width:6%">
<col style="width:4%">
</colgroup>
{% endif %}
<thead class="" style="">
<tr>
<th class="clickable">{{ gettext("Dataset") }}</th>
<th>{{ gettext("Breakdown") }}</th>
<th>{{ gettext("Info") }}</th>
{% if not is_index %}
<th>{{ gettext("Year") }}</th>
{% endif %}
<th class="clickable">{{ gettext("Score") }}</th>
{% if not is_index %}
<th class="admin"><span class="sr-only">{{ gettext("Admin") }}</span></th>
{% endif %}
</tr>
</thead>
<tbody>
{% if is_index %}
{% set entryBaseUrl = 'place' %}
{% else %}
{% set entryBaseUrl = 'entry' %}
{% endif %}
{% for dataset in datasets %}
{% set entry = entries|find({'dataset': dataset.id, 'place': place.id}) %}
{% set submissions = pending|where({'dataset': dataset.id, 'place': place.id, 'year': year}) %}
<tr id="{{ dataset.id }}" class="entry" data-rank="{{ entry.rank }}" data-score="{{ entry.computedScore }}" data-place="{{ place.id }}" data-name="{{ place.name }}">
<td>
{% if entry -%}<a href="/{{ entryBaseUrl }}/{{ place.id }}/{{ dataset.id }}{{ urlContext }}">{%- endif %}
{{ dataset.name }}
{% if entry -%}</a>{%- endif %}
</td>
<td>
<ul class="availability availability-slice">
{% for question in questions %}
{% if entry %}
{% set answer = entry.getAnswerValueForQuestion(question) %}
{% set pass = 'yes' if question.pass(answer) else 'no' %}
{% endif %}
<li class="{{ pass }}" title="{{ question.question }}" data-toggle="popover" data-content="{{ popovers.popover_slice_content(question.description)|escape }}"><i class="fa fa-{{ question.icon }}"></i> </li>
{% endfor %}
</ul>
</td>
<td class="info-expander" title="Click for full details">
<a aria-expanded="false" data-toggle="collapse" data-target="#detail-{{ dataset.id }}" class="collapsed">
<i class="fa fa-info-circle"></i>
</a>
</td>
{% if not is_index %}
<td class="year">
{% if entry %}
<span title="{{ entry.updatedAt|dateformat }} ({{ gettext('Submitted by') }} {{ entry.Submitter.fullName() }}{% if entry.Reviewer %} {{ gettext('and reviewed by') }} {{ entry.Reviewer.fullName() }}{% endif %})">{{ entry.year }}</span>
{% endif %}
</td>
{% endif %}
<td class="score" data-score="{% if entry %}{{ entry.computedRelativeScore }}{% endif %}">
{% if entry %}<span>{{ entry.computedRelativeScore }}%</span>{% endif %}
</td>
{% if not is_index %}
<td class="admin">
{% if submissions|length %}
<a class="propose" title="{{ gettext('Sorry, only one submission can be waiting for review at a time - please come back in a few days to submit new information') }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
{% else %}
<a href="{{ format('/submit/?place=%(place)s&dataset=%(dataset)s', {place:place.id, dataset:dataset.id}) }}" class="propose" title="{{ gettext('Propose Revisions') }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
{% endif %}
</td>
{% endif %}
</tr>
{% if entry.details %}
<tr id="detail-{{ dataset.id }}" class="details collapse">
{% if is_index %}
<td colspan="4">
{% else %}
<td colspan="6">
{% endif %}
{# hack around tablesorter and our row toggler #}<span style="visibility: hidden;">{{ dataset.name }}</span>
{% if entry.details %}
{{ entry.details|marked }}
{% endif %}
<br />
</td>
</tr>
{% endif %}
{% if not is_index %}
{% for submission in submissions %}
<tr id="submission-{{dataset.id}}-{{loop.index}}" data-rank="{{entry.rank}}" data-score="{{submission.computedScore}}" data-place="{{place.name}}" class="queued submission submission-{{dataset.id}}">
<td class="queued-context">
{# hack around tablesorter and our row toggler #}<span style="visibility: hidden;">{{ dataset.name }}</span>
<h6><span class="icon">↳</span> {{ gettext("Awaiting review") }}</h6>
<span title="{{ gettext('Submitted by')}} {{ submission.Submitter.firstName}}" class="queued-user">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span>
{{ submission.Submitter.firstName }}
</span>
<br>
<span title="{{ gettext('Submitted on')}} {{ submission.createdAt|dateformat }}" class="queued-time">
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></i>
{{ submission.createdAt|simpledelta }}
</span>
</td>
<td>
<ul class="availability availability-slice">
{% for question in questions %}
{% if submission %}
{% set answer = submission.getAnswerValueForQuestion(question) %}
{% set pass = 'yes' if question.pass(answer) else 'no' %}
{% endif %}
<li class="{{ pass }}" title="{% if pass == 'yes' %}It's {% elif pass == 'no' %}It's not {% endif %}{{ question.questionshort|lower }}"><i class="fa fa-{{ question.icon }}"></i> </li>
{% endfor %}
</ul>
</td>
<td class="info-expander" title="Click for full details">
<a data-toggle="collapse" data-target="#detail-submission-{{dataset.id}}-{{loop.index}}" class="collapsed">
<i class="fa fa-info-circle"></i>
</a>
</td>
{% if not is_index %}
<td class="year">
{% if submission %}
<span title="{{ submission.updatedAt|dateformat }} ({{ gettext('Submitted by') }} {{ submission.Submitter.fullName() }})">{{ submission.year }}</span>
{% endif %}
</td>
{% endif %}
<td class="score" data-score="{{ submission.computedRelativeScore }}"><span>{{ submission.computedRelativeScore }}%</span></td>
{% if not is_index %}
<td class="admin">
<a href="{{ format('/submission/%(submissionid)s', {submissionid: submission.id}) }}" class="view" title="{{ gettext('View Submission') }}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
</td>
{% endif %}
</tr>
<tr id="detail-submission-{{dataset.id}}-{{loop.index}}" class="details collapse">
<td colspan="6">
{# hack around tablesorter and our row toggler #}<span style="visibility: hidden;">{{ dataset.name }}</span>
{% if submission.details %}
{{ submission.details|marked }}
{% endif %}
<br />
</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
<div id="popover" class="popover fade bottom in" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>