Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add score and progress rows to status table

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
  • Loading branch information...
commit e18bfad8a6262a94f2ce8f928118c7b9ebe1f785 1 parent 2e66056
@stefanha stefanha authored
Showing with 21 additions and 1 deletion.
  1. +11 −1 src/controller.py
  2. +10 −0 src/templates/hunt.html
View
12 src/controller.py
@@ -76,8 +76,18 @@ def get(self, hunt_id):
'question': clue.question,
'answers': answers,
})
+
+ scores = []
+ progresses = []
+ for team in hunt.teams:
+ scores.append(team.score())
+ if team.remaining():
+ progresses.append('%d left' % team.remaining())
+ else:
+ progresses.append(str(team.finish_time))
+
logging.debug('ShowHunt answer_sets: %s' % answer_sets)
- self.response.out.write(utils.render('templates/hunt.html', {'hunt': hunt, 'answer_sets': answer_sets}))
+ self.response.out.write(utils.render('templates/hunt.html', {'hunt': hunt, 'answer_sets': answer_sets, 'scores': scores, 'progresses': progresses}))
@utils.logged_in
def post(self, hunt_id):
View
10 src/templates/hunt.html
@@ -33,6 +33,16 @@
{% endfor %}
</tr>
{% endfor %}
+ <tr><td>Score</td>
+ {% for score in scores %}
+ <td>{{ score }}</td>
+ {% endfor %}
+ </tr>
+ <tr><td>Team progress</td>
+ {% for progress in progresses %}
+ <td>{{ progress }}</td>
+ {% endfor %}
+ </tr>
</table>
</div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.