]> git.xonotic.org Git - xonotic/xonstat.git/commit - xonstat/templates/main_index.mako
Make the "recent games" section more modular.
authorAnt Zucaro <azucaro@gmail.com>
Mon, 19 Nov 2012 00:27:14 +0000 (19:27 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 19 Nov 2012 00:27:14 +0000 (19:27 -0500)
commitea509b26f2aac5deda01376d5b3e710f542f4c4f
treefa6905ad64175bde699b374a4077f0509f12f41a
parent2778ce37b66e93b40c303909bffcc284d8127820
Make the "recent games" section more modular.

The main page was constructing all of the recent games queries
manually before. Now I've moved the query and the associated
class (which would have been a namedtuple if not for the various
transformations needed) into a new "helpers" view. This view is
intended to house query functions and the corresponding classes
for them, so no more grabbing from a query, then looping around
and creating namedtuples to get stuff like nick_html_colors. Now
one can just pass the row returned by the query to a class, which
will "know" how to construct stuff like that. Win!
xonstat/templates/main_index.mako
xonstat/views/helpers.py [new file with mode: 0644]
xonstat/views/main.py