Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: karenc/SMS-Hunt
base: 5530a07ca5
...
head fork: karenc/SMS-Hunt
compare: e18bfad8a6
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 07, 2011
@stefanha stefanha Allow different users to create hunts with the same name
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2e66056
@stefanha stefanha Add score and progress rows to status table
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
e18bfad
Showing with 22 additions and 2 deletions.
  1. +12 −2 src/controller.py
  2. +10 −0 src/templates/hunt.html
View
14 src/controller.py
@@ -52,7 +52,7 @@ class CreateHunt(webapp.RequestHandler):
@utils.logged_in
def post(self):
hunt_name = self.request.get('hunt-name')
- hunt = Hunt.all().filter('name =', hunt_name).get()
+ hunt = Hunt.all().filter('name =', hunt_name).filter('owner =', self.user).get()
if not hunt:
hunt = Hunt(name=hunt_name, owner=self.user)
hunt.put()
@@ -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>

No commit comments for this range

Something went wrong with that request. Please try again.