Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Show tracks for talks

  • Loading branch information...
commit ff1f3f22399ff7e95fee1943867dd63302f3c9a3 1 parent e12c787
@mhagander authored
View
7 postgresqleu/confreg/views.py
@@ -741,7 +741,7 @@ def talkvote(request, confname):
# Render the form. Need to do this with a manual query, can't figure
# out the right way to do it with the django ORM.
- curs.execute("SELECT s.id, s.title, s.status, s.abstract, s.submissionnote, (SELECT string_agg(spk.fullname, ',') FROM confreg_speaker spk INNER JOIN confreg_conferencesession_speaker cs ON cs.speaker_id=spk.id WHERE cs.conferencesession_id=s.id) AS speakers, (SELECT string_agg(spk.fullname || '(' || spk.company || ')', ',') FROM confreg_speaker spk INNER JOIN confreg_conferencesession_speaker cs ON cs.speaker_id=spk.id WHERE cs.conferencesession_id=s.id) AS speakers_full, u.username, v.vote, v.comment, avg(v.vote) OVER (PARTITION BY s.id)::numeric(3,2) AS avg FROM (confreg_conferencesession s CROSS JOIN auth_user u) LEFT JOIN confreg_conferencesessionvote v ON v.session_id=s.id AND v.voter_id=u.id WHERE s.conference_id=%(confid)s AND u.id IN (SELECT user_id FROM confreg_conference_talkvoters tv WHERE tv.conference_id=%(confid)s) ORDER BY " + order + "s.title,s.id, u.id=%(userid)s DESC, u.username", {
+ curs.execute("SELECT s.id, s.title, s.status, s.abstract, s.submissionnote, (SELECT string_agg(spk.fullname, ',') FROM confreg_speaker spk INNER JOIN confreg_conferencesession_speaker cs ON cs.speaker_id=spk.id WHERE cs.conferencesession_id=s.id) AS speakers, (SELECT string_agg(spk.fullname || '(' || spk.company || ')', ',') FROM confreg_speaker spk INNER JOIN confreg_conferencesession_speaker cs ON cs.speaker_id=spk.id WHERE cs.conferencesession_id=s.id) AS speakers_full, u.username, v.vote, v.comment, avg(v.vote) OVER (PARTITION BY s.id)::numeric(3,2) AS avg, trackname FROM (confreg_conferencesession s CROSS JOIN auth_user u) LEFT JOIN confreg_track track ON track.id=s.track_id LEFT JOIN confreg_conferencesessionvote v ON v.session_id=s.id AND v.voter_id=u.id WHERE s.conference_id=%(confid)s AND u.id IN (SELECT user_id FROM confreg_conference_talkvoters tv WHERE tv.conference_id=%(confid)s) ORDER BY " + order + "s.title,s.id, u.id=%(userid)s DESC, u.username", {
'confid': conference.id,
'userid': request.user.id,
})
@@ -749,7 +749,7 @@ def talkvote(request, confname):
def getusernames(all):
firstid = all[0][0]
- for id, title, status, abstract, submissionnote, speakers, speakers_full, username, vote, comment, avgvote in all:
+ for id, title, status, abstract, submissionnote, speakers, speakers_full, username, vote, comment, avgvote, track in all:
if id != firstid:
return
yield username
@@ -757,7 +757,7 @@ def getusernames(all):
def transform(all):
lastid = -1
rd = {}
- for id, title, status, abstract, submissionnote, speakers, speakers_full, username, vote, comment, avgvote in all:
+ for id, title, status, abstract, submissionnote, speakers, speakers_full, username, vote, comment, avgvote, track in all:
if id != lastid:
if lastid != -1:
yield rd
@@ -773,6 +773,7 @@ def transform(all):
'users': [],
'comments': '',
'owncomment': '',
+ 'track': track,
}
lastid = id
rd['users'].append(vote)
View
1  template/confreg/sessionvotes.html
@@ -55,6 +55,7 @@
<td onClick="showDialog({{s.id}}, '{{s.title|escape|escapejs|escape}}')" class="dlgClickable">{{s.title}} ({{s.speakers}})
<div id="popup_{{s.id}}" class="dlg">
<div><strong>Speakers:</strong> {{s.speakers_full}}</div>
+ <div><strong>Track:</strong> {{s.track}}</div>
<p>
{{s.abstract}}
</p>
Please sign in to comment.
Something went wrong with that request. Please try again.