-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathproposal_render.html
220 lines (211 loc) · 8.84 KB
/
proposal_render.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
{%import "vote_display.html" as vd%}
{%macro proposal_render(proposal, anonymize=False,
hidetimes=False) %}
{% if not hidetimes %}
<ul class="nav nav-tabs" role="tablist">
{%for version in proposal.data_history%}
<li class="{%if loop.first%} active{%endif%}"><a class="tab-button" href="#rev-{{loop.index0}}">{{version.when|date}}</a></li>
{%endfor%}
</ul>
{% endif %}
<div class="tab-content">
{% for version in proposal.data_history%}
<div class="tab-pane{%if loop.first%} active{%endif%}" id="rev-{{loop.index0}}">
<h1>{{version.title}}</h1>
<table class="table">
<tbody>
<tr><th>Duration</th>
<td>{{version.duration}}</td></tr>
{% if not anonymize %}
<tr><th>Proposer(s)</th>
<td>{{proposal.authors|map(attribute='name')|join(", ")}}</td></tr>
{% endif %}
<tr><th># Speakers</th>
<td>{{proposal.authors|length}}</td></tr>
{% if not hidetimes%}
<tr><th>Created</th>
<td>{{proposal.added_on|date}}</td></tr>
<tr><th>Last Updated</th>
<td>{{version.when|date}}</td></tr>
{%endif%}
</tbody>
</table>
<h3>Description</h3>
<p>
{{version.description|markdown}}
</p>
<h3>Audience</h3>
<p>
{{version.audience}}
</p>
<h3>Outline</h3>
<p>
<pre style="white-space:pre-wrap;border:0;background:none;">
{{version.outline}}
</pre>
</p>
{% if not anonymize %}
<h3>Additional Notes</h3>
<p>
{{version.notes|markdown}}
</p>
{% endif %}
</div>
{%endfor%}
</div>
{%endmacro%}
{%macro user_vote_render(standards, existing_vote)%}
<div class="panel panel-primary" id="user-vote-block">
<div class="panel-heading"
data-content="These votes were loaded from your local browser cache, and are not yet saved." id="vote-panel">
<h3 class="panel-title">This Proposal...</h3>
</div>
<form method="POST" action="vote/" id="vote-form">
<table class="table">
{% for s in standards %}
<tr>
<td>
<div class="btn-group btn-group-xs voting-stripe" style="min-width:75px;">
<button type="button" id="standard-id-{{s.id}}-2"
class="btn
{% if existing_vote
and existing_vote.scores[s.id] == 2 %}
btn-success
{%else %}
btn-default
{%endif%}
" data-val="2"><span class="glyphicon glyphicon-ok" title="Meets Standard"></span></button>
<button type="button"id="standard-id-{{s.id}}-1"
class="btn
{% if existing_vote
and existing_vote.scores[s.id] == 1 %}
btn-warning
{%else %}
btn-default
{%endif%}
" data-val="1"><span class="glyphicon glyphicon-warning-sign" title="Concern it Might Not Meet Standard"></span></button>
<button type="button" id="standard-id-{{s.id}}-0"
class="btn
{% if existing_vote
and existing_vote.scores[s.id] == 0 %}
btn-danger
{%else %}
btn-default
{%endif%}
" data-val="0"><span class="glyphicon glyphicon-remove" title="Does Not Meet Standard"></span></button>
<input name="standard-{{s.id}}"
{%if existing_vote and existing_vote.scores %}
value="{{existing_vote.scores[s.id]}}"
{% else %}
value="-1"
{% endif %}
type="hidden">
</div>
</td>
<td><small>{{s.description}}.</small></td>
</tr>
{% endfor %}
</table>
<div class="panel-body">
{% if existing_vote and existing_vote.nominate %}
<button type="button" class="btn btn-block btn-success" id="nominate"><span class="glyphicon glyphicon-star"></span> Nominated for Special Consideration</button>
<input name="nominate" value="1" type="hidden">
{% else %}
<button type="button" class="btn btn-block btn-default" id="nominate">Nominate for Special Consideration</button>
<input name="nominate" value="0" type="hidden">
{% endif %}
<p class="help-block">
If you feel this talk didn't meet the objective standards but would
still be a strong addition to PyCon, you can nominate it for special
consideration.
</p>
</div>
<div class="panel-footer">
{% if existing_vote %}
<a href="/" class="btn btn-default btn-lg">Next Proposal »</a>
{% endif %}
<button type="Submit" class="btn btn-primary pull-right" id="save"
{% if not existing_vote %}
disabled="disabled"
{% endif %}
>Save Vote</button>
<div class="clearfix"></div>
</div>
</form>
</div>
{%endmacro%}
{%macro existing_vote_render(votes, standards) %}
<div class="panel panel-default" id="existing-votes-block">
<div class="panel-heading">
<h3 class="panel-title">Votes</h3>
</div>
<table class="table">
<thead>
<tr><th></th>
{% for s in standards %}
<th>{{s.id}}</th>
{% endfor %}
<th>N</th>
</tr>
</thead>
<tbody>
{% for v in votes %}
<tr><td>{{v.display_name}}</td>
{% for s in standards %}
<td>{{vd.vote_display(v.scores[s.id])}}</td>
{% endfor %}
<td>{% if v.nominate %}
<span class="glyphicon glyphicon-star"></span>
{%endif%}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{%endmacro%}
{%macro discussion_render(unread, discussion) %}
<div class="panel panel-default" id="discussion-panel">
<div class="panel-heading">
<h3 class="panel-title">Discussion</h3>
</div>
<ul class="list-group">
{% for d in discussion %}
<li class="list-group-item
{% if d.feedback %}list-group-item-danger
{% elif d.name %}list-group-item-success
{%else%}disabled{%endif%}" style="display:flex;justify-content:space-between">
<div>
{%if d.name%}Proposal Author{%else%}<strong>{{d.display_name}}</strong>{%endif%}
{%if d.feedback%}<br><strong>To Author</strong>{%endif%}
</div>
<span style="order:1">{{d.created|date}}</span>
{%if d.name%}<strong>From Author</strong>{%endif%}
</li>
<li class="list-group-item" style="overflow-wrap: break-word;word-wrap: break-word;">
{{d.body}}
</li>
{% endfor %}
</ul>
{% if unread %}
<div class="panel-body">
<form action="mark_read/next/" method="POST">
<div class="btn-group" role="group">
<button id="mark-read" type="button" class="btn btn-danger">Mark Read</button>
<input type="submit" class="btn btn-danger" value="Mark Read, Next Unread">
</div>
</form>
</div>
{% endif %}
<div class="panel-body">
<form method="POST" action="comment/" id="comment-form">
<div class="form-group">
<label for="comment">Add Comment</label>
<textarea type="" class="form-control" id="comment" placeholder="Internal Comment" name="comment"></textarea>
<p class="help-block">Please be both kind and succinct with your comments.</p>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
{% endmacro %}