Ant Zucaro [Sun, 7 Oct 2012 02:37:09 +0000 (22:37 -0400)]
Make the "recent games" table expand with the "more" link.
Previously a big list of scoreboards would be shown if a person
clicked on the "more" link below the "recent games" table on the
player info page. Now a table that is exactly the same is shown,
but with pagination. This is in essence an attempt to keep the
same elements in the view; when a person clicks on a "more" link,
they expect to see more of the same items they were looking at.
The end benefit for players is that they can quickly page through
all of their games and see summary results as well as their elo
changes from one simple view.
Ant Zucaro [Sat, 6 Oct 2012 15:00:30 +0000 (11:00 -0400)]
Add elo deltas to the player info page.
The elo deltas will just show an up, down, or neutral icon for how
their elo has changed during the games in the "recent games" table
at the bottom of the page. Hovering over these icons will show the
actual delta value in the event it went up or down (rather than
stayed the same).
Jan Behrens [Mon, 1 Oct 2012 19:48:47 +0000 (21:48 +0200)]
Moved over to new Xonstat API (using functions xonstat.views.player directly);
enabled UTF-8 encoded playernicks for testing (FIXME: it is known that some nicks cause problems with cairo currently)
Ant Zucaro [Fri, 28 Sep 2012 02:19:52 +0000 (22:19 -0400)]
Add total playing time.
I forgot to add the total playing time from the get_overall_stats
call. This includes it and moves win percentage over to the right
pane to space things out more evenly.
Ant Zucaro [Wed, 26 Sep 2012 02:47:18 +0000 (22:47 -0400)]
Acceptable version of the games breakdown tab.
This version does not have localized time. More code changes are
needed to add it, and I just ran out of time. It is simple enough
to add and will come soon. This commit basically styles the tabs
and also adds a cap_ratio when you click on ctf.
Ant Zucaro [Thu, 20 Sep 2012 02:56:09 +0000 (22:56 -0400)]
Get rid of unneeded functions. Away with you. Away!
All of the old functions returned data in a format that wasn't
very flexible, or didn't break down the information by game type.
Out with them! Named tuples are now used, making for much more
readable (if not a bit lengthy) templates.
Ant Zucaro [Thu, 20 Sep 2012 02:51:53 +0000 (22:51 -0400)]
Initial checkin of tabs for the player_info view.
Underneath the player's nick will be a tabbed list of game types,
starting with "overall." Within each of these tabs will be stats
pertaining to only that game type. This allows players to view
fine-grained details about their playing history.
Note that this commit does not style the table much. This is mainly
to ensure that all of the content is being fetched properly.
Ant Zucaro [Sun, 16 Sep 2012 16:51:25 +0000 (12:51 -0400)]
Undo the addition of zykure's games breakdown stuff.
While the changes are appreciated, they introduce WAY too many
database queries and LOC. They will be rewritten using a more
efficient query structure before inclusion. Also I'd prefer to
use tabs instead of pills, with the tabs being on the left or
right, not along the top/bottom.
Ant Zucaro [Sat, 15 Sep 2012 12:20:48 +0000 (08:20 -0400)]
Fix the header on the ranks page.
Consolidate the logic for the header, which was being neglected.
Now it has the full header present without an h2 which essentially
duplicated the same header. I removed the h2 and left the header.
Ant Zucaro [Sat, 15 Sep 2012 12:12:18 +0000 (08:12 -0400)]
Turn off italics in the header.
People didn't like the italics in the header, stating that it
didn't really fit the style. I didn't really have an opinion
either way, so I straightened it back up. I also removed the non-
breaking space after the header that was put in to "even out" the
slant of the italics.
Jan D. Behrens [Fri, 14 Sep 2012 20:03:03 +0000 (22:03 +0200)]
Minor improvements to the badges generator:
- Fixed mistake int the ^6 color code (leading to wrong colors)
- Extended the playernick down-scaling for too wide nicks (now max. down-scaling is based on fontsize)
Ant Zucaro [Tue, 11 Sep 2012 02:01:54 +0000 (22:01 -0400)]
Add localized time support (on hover).
Without Javascript people will see the UTC time. With Javascript
all of those UTC times will be changed to localtime (accounting
for DST) via the epoch time of the object.
Ant Zucaro [Sat, 8 Sep 2012 18:59:00 +0000 (14:59 -0400)]
Handle the halving of weapon stats a little better.
Default PlayerWeaponStat rows to all 0 to protect for missing
accuracy data. Also halve all of the pwstat members at once
instead of checking on each loop.
Ant Zucaro [Sat, 8 Sep 2012 18:37:18 +0000 (14:37 -0400)]
Use a dummy session variable.
A little while ago I moved down the creation of the actual
DBSession() below the precondition checks to avoid unnecessary
rollback transactions. What I didn't do was check if the session
existed before using it, so when precondition checks failed I was
calling a variable that wasn't defined yet (another exception).
This adds a dummy session variable that I can check before rolling
back, avoiding more exceptions.
Ant Zucaro [Fri, 7 Sep 2012 02:41:45 +0000 (22:41 -0400)]
Halve the weapon stats if the POST request is from version 1.
Version 1 of the weapon stats submissions sent double the weapon
stats. This means that all hit, fired, max, actual, and frag data
were 2x what they should be. The fix is to check for version 1
requests and halve them accordingly. Versions >1 should not have
this problem.
Ant Zucaro [Wed, 5 Sep 2012 03:00:08 +0000 (23:00 -0400)]
Fix broken firefox. Damn you, firefox!
The latest firefox update broke the web borders. This is a
workaround. It compresses the main header by removing the
"get the game" button (not really needed). This change also
swaps out the backgrounds to match xonotic.org and a move of
the title accordingly. All in all I think it looks pretty decent!
Ant Zucaro [Sun, 2 Sep 2012 17:08:36 +0000 (13:08 -0400)]
Use relative time everywhere, but add hover with absolute time.
Use "fuzzy" dates everywhere (e.g. "an hour ago"), but allow for
a hover showing the absolute UTC time when needed. This is done
with a span and a title attribute.
Jan D. Behrens [Thu, 30 Aug 2012 10:53:34 +0000 (12:53 +0200)]
More design work on the two badge themes; also improved skin support
- More parameters that can be changed by skins
- Minimal skin: fixed gametype alignment, retuned coloring to be more modest, some redesign
- Classic skin: gametypes are now aligned to the center if less than max. gameteypes are shown, re-introduced the "no stats" stamp, also some redesign
- Some code cleanup
Jan D. Behrens [Wed, 29 Aug 2012 14:39:59 +0000 (16:39 +0200)]
A collection of smaller improvements to the badges generator
- Fixed a bug in the commandline parser
- Finally fixed the "win/loss" bug (new query, also a bit faster)
- Split up "render" and "data" parts of the code (skin.py & playerdata.py)
- Reworked overlay images for classic/minimal skin (source .xcf files included)
Jan D. Behrens [Wed, 29 Aug 2012 10:58:31 +0000 (12:58 +0200)]
Added multiple skin support and better commandline parsing
- Skins other than "classic" will be put into a subdir in the output directory (e.g. output/minimal/###.png)
- By default, "classic" and "minimal" badges are created for all players that were active in the last 6 hours
- A skin list can be passed to the program for testing (e.g. "gen_badges.py classic archer")
- The "-force" parameter enforces an update of all badges by setting delta to 2^24 hours
- The "-test" parameter limits the number of players to be considered to 200 (used for testing)
Ant Zucaro [Wed, 29 Aug 2012 02:01:12 +0000 (22:01 -0400)]
Add a cutoff date.
The cutoff date is the date before which games are not considered.
In other words, a player must play within the cutoff date range in
order to have his or her badge regenerated. This is to prevent
generating images for every single player, every single run.
Jan D. Behrens [Tue, 28 Aug 2012 12:41:22 +0000 (14:41 +0200)]
Added rudimentary skin support to badges (also moved large parts of code outside the main program)
- To select skin, run gen_badges.py with the skin name as argument (i.e. "classic" or "archer").
Ant Zucaro [Sat, 25 Aug 2012 12:17:04 +0000 (08:17 -0400)]
Add player badge batch job (via zykure).
The player badge batch job uses cairo to generate a summary
image of the given player's statistics. It can be run
periodically to maintain the "freshness" of the data. The
tricky thing with this batch job is getting cairo working
within the virtualenv - one has to install it in the machine
and then symbolically link to the ENV. This is obviously not
ideal, but it does work.
Many thanks to zykure for this well-designed image!
Jan D. Behrens [Thu, 23 Aug 2012 20:01:04 +0000 (22:01 +0200)]
Re-implemented the badges generator, now it uses the cairo API for rendering.
Rendering one image takes about 0.2 sec, including the DB queries for each player.
Jan D. Behrens [Thu, 23 Aug 2012 20:01:04 +0000 (22:01 +0200)]
Re-implemented the badges generator, now it uses the cairo API for rendering.
Rendering one image takes about 0.2 sec, including the DB queries for each player.
Ant Zucaro [Thu, 23 Aug 2012 11:40:51 +0000 (07:40 -0400)]
Wait for precondition checks before beginning the DB transaction.
SQLA's DBSession implicitly starts a PG transaction. When this
happens before the precondition checks (blank game, verified req, etc)
then an unneccesary transaction is started. Delay grabbing a new
DBSession until AFTER these checks are done prevents these useless
transactions from occurring. This means we should see little to
no ROLLBACK transactions in Munin once this is in place.
Jan D. Behrens [Sun, 5 Aug 2012 10:52:38 +0000 (12:52 +0200)]
Restructured player_info page to now include more detailed stats for specific gametypes (currently duel,dm,tdm,ctf)
The total_stats dictionary now also holds much more information than before, especially gametype-dependent info
Also added "favorite server" line, showing on which server the player is most likely to be found
This commit implements some of the suggestions from Feature Request #1039:
Organizing Player page statistics - http://dev.xonotic.org/issues/1039