Skip to content

Commit a0b68d8

Browse files
committed
Bug fixes for batch, round 1
1 parent 1d067de commit a0b68d8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def batch_view(id):
242242
proposals.sort(key=lambda x:-x['voters_count'])
243243
else:
244244
random.shuffle(proposals)
245-
basics = {x['proposal'].id:x['proposal'].title for x in proposals}
245+
basics = {x['proposal'].id:x['proposal'].data['title'] for x in proposals}
246246
vote = l.get_batch_vote(id, request.user.id)
247247
msgs = l.get_batch_messages(id)
248248
l.mark_batch_read(id, request.user.id)

dev-config/PSQL_CONNECTION_STRING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgresql+psycopg2://test:test@localhost:5432/test
1+
postgresql+psycopg2://progcom:progcom@localhost:5432/progcom

logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def toggle_lock_batch(id, lock):
422422
execute(q, lock, id)
423423

424424
def full_proposal_list(email):
425-
q = '''SELECT p.id, p.data->>'title', bg.id as batch_id, p.accepted,
425+
q = '''SELECT p.id, p.data->>'title' AS title, bg.id as batch_id, p.accepted,
426426
array_to_string(p.author_names, ', ') AS author_names,
427427
COALESCE(bg.name, '') AS batchgroup,
428428
EXISTS (SELECT 1 FROM users
@@ -589,7 +589,7 @@ def get_my_pycon(user):
589589
q = 'SELECT batchgroup, accept FROM batchvotes WHERE voter=%s'
590590
votes = fetchall(q, user)
591591

592-
q = '''SELECT data->>'title', id,
592+
q = '''SELECT data->>'title' AS title, id,
593593
array_to_string(author_names, ', ') AS author_names,
594594
accepted
595595
FROM proposals WHERE batchgroup IS NOT NULL'''

templates/batch/batchgroup.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ <h1>Group: {{group.name}}</h1>
88
<h4>This Group is Locked <span class="glyphicon glyphicon-lock"></span></h4>
99
{% endif%}
1010
<div class="col-md-12" style="margin-bottom:1em;">
11-
<ul class="nav nav-pills nav-justified" id="proposal-tabs">
11+
<ul class="nav nav-pills nav-justified" id="proposal-tabs" style="display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;">
1212
{% for p in proposals %}
13-
<li>
14-
<a href="#proposal-{{p.proposal.id}}">{{p.proposal.title}} (#{{p.proposal.id}})
13+
<li style="width:20%;padding-bottom:0;border:1px solid #eee;">
14+
<a href="#proposal-{{p.proposal.id}}" style="height:100%;">{{p.proposal.data.title}} (#{{p.proposal.id}})
1515
{% if p.proposal.count and (vote or request.user.email in config.OBSERVER_EMAILS) %}
1616
<span class="badge">{{p.proposal.count}} nominations</span>
1717
{%endif%}
@@ -80,7 +80,7 @@ <h2>Screening Discussion</h2>
8080
</div>
8181

8282
<script type="underscore/template" id="ordered_row">
83-
<li class="list-group-item"><span class="glyphicon glyphicon-star"></span> <%=title%> (#<%=id%>)
83+
<li class="list-group-item"><span class="glyphicon glyphicon-star"></span> <%=data.title%> (#<%=id%>)
8484
<input type="hidden" name="accept" value="<%=id%>"></li>
8585
</script>
8686

@@ -156,7 +156,7 @@ <h4>Remaining Proposals</h4>
156156
style="display:none;"
157157
{%endif%}
158158
>
159-
{{p.proposal.title}} (#{{p.proposal.id}})
159+
{{p.proposal.data.title}} (#{{p.proposal.id}})
160160
</li>
161161
{% endfor %}
162162
</ul>

0 commit comments

Comments
 (0)