]> git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Add elo deltas to the player info page.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 6 Oct 2012 15:00:30 +0000 (11:00 -0400)
committerJan Behrens <zykure@web.de>
Sun, 23 Dec 2012 14:18:32 +0000 (15:18 +0100)
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).

xonstat/static/css/img/glyphicons-halflings-white.png [new file with mode: 0644]
xonstat/static/css/img/glyphicons-halflings.png [new file with mode: 0644]
xonstat/static/css/style.css
xonstat/templates/player_info.mako

diff --git a/xonstat/static/css/img/glyphicons-halflings-white.png b/xonstat/static/css/img/glyphicons-halflings-white.png
new file mode 100644 (file)
index 0000000..3bf6484
Binary files /dev/null and b/xonstat/static/css/img/glyphicons-halflings-white.png differ
diff --git a/xonstat/static/css/img/glyphicons-halflings.png b/xonstat/static/css/img/glyphicons-halflings.png
new file mode 100644 (file)
index 0000000..a996999
Binary files /dev/null and b/xonstat/static/css/img/glyphicons-halflings.png differ
index d8720661712eda625af652f54c5a0ec9ca12d4e7..58aa20d866290e38daa2994dd423daa4ebba46ad 100755 (executable)
@@ -1147,7 +1147,7 @@ table .span12 {
   width: 14px;
   height: 14px;
   vertical-align: text-top;
-  background-image: url(../img/glyphicons-halflings.png);
+  background-image: url('img/glyphicons-halflings.png');
   background-position: 14px 14px;
   background-repeat: no-repeat;
   *margin-right: .3em;
@@ -1156,7 +1156,7 @@ table .span12 {
   *margin-left: 0;
 }
 .icon-white {
-  background-image: url(../img/glyphicons-halflings-white.png);
+  background-image: url('img/glyphicons-halflings-white.png');
 }
 .icon-glass {
   background-position: 0      0;
@@ -3512,3 +3512,5 @@ header h2 { display:none; }
 .nav-tabs > li > a { border-radius: 4px 4px 4px 4px; text-align: center; }
 .nav-tabs > li > a:hover { background-color: #111; border-color: #333; }
 .nav-tabs { border-bottom: 0px solid #000; }
+
+.table .tdcenter { text-align: center; }
index 6ec476e68da170501f0277cb88a535b562e57787..34737f67944e72d18444e72717a6fe8e8f574f9e 100644 (file)
@@ -219,7 +219,7 @@ Player Information
           </div>
           <div class="span5">
             <p>
-            Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
+              Win Percentage: <small>${round(g.win_pct,2)}% (${g.wins} wins, ${g.losses} losses) <br /></small>
 
             % if g.game_type_cd in overall_stats:
               % if overall_stats[g.game_type_cd].k_d_ratio is not None:
@@ -430,13 +430,14 @@ Player Information
            <th>Map</th>
            <th>Result</th>
            <th>Played</th>
+           <th>Elo</th>
         </tr>
       </thead>
       <tbody>
       % for (gamestat, game, server, map) in recent_games:
         <tr>
-           <td><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">view</a></td>
-           <td style="width:20px;"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
+           <td class="tdcenter"><a class="btn btn-primary btn-small" href="${request.route_url('game_info', id=game.game_id)}" title="View detailed information about this game">view</a></td>
+           <td class="tdcenter"><img title="${game.game_type_cd}" src="/static/images/icons/24x24/${game.game_type_cd}.png" alt="${game.game_type_cd}" /></td>
            <td>${server.name}</td>
            <td>${map.name}</td>
            <td>
@@ -455,6 +456,15 @@ Player Information
           % endif
            </td>
            <td><span class="abstime" data-epoch="${game.epoch()}" title="${game.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${game.fuzzy_date()}</span></td>
+           <td class="tdcenter">
+             % if round(gamestat.elo_delta,2) > 0:
+             <span title="Elo went up by ${round(gamestat.elo_delta,2)}"><i class="icon-arrow-up icon-white"></i></span>
+             % elif round(gamestat.elo_delta,2) < 0:
+             <span title="Elo went down by ${round(gamestat.elo_delta,2)}"><i class="icon-arrow-down icon-white"></i></span>
+             % else:
+             <span title="Elo did not change"><i class="icon-minus icon-white"></i></span>
+             % endif
+           </td>
         </tr>
       % endfor
       </tbody>