Merge branch 'master' into zykure/approved
authorJan Behrens <zykure@web.de>
Fri, 19 Jul 2013 07:34:24 +0000 (09:34 +0200)
committerJan Behrens <zykure@web.de>
Fri, 19 Jul 2013 07:34:24 +0000 (09:34 +0200)
Conflicts:
xonstat/static/css/app.min.css

xonstat/batch/badges/skin.py
xonstat/static/css/app.css
xonstat/templates/game_info.mako

index 982512e..f18370f 100644 (file)
@@ -413,16 +413,16 @@ class Skin:
         try:
             txt = "%.2f%%" % round(win_pct, 2)
         except:
-            win_pct = 0
+            win_pct = 0.
 
         if self.winp_pos:
-            if win_pct >= 0.5:
-                nr = 2*(win_pct-0.5)
+            if win_pct >= 50.0:
+                nr = 2*(win_pct/100-0.5)
                 r = nr*self.winp_colortop[0] + (1-nr)*self.winp_colormid[0]
                 g = nr*self.winp_colortop[1] + (1-nr)*self.winp_colormid[1]
                 b = nr*self.winp_colortop[2] + (1-nr)*self.winp_colormid[2]
             else:
-                nr = 2*win_pct
+                nr = 2*(win_pct/100)
                 r = nr*self.winp_colormid[0] + (1-nr)*self.winp_colorbot[0]
                 g = nr*self.winp_colormid[1] + (1-nr)*self.winp_colorbot[1]
                 b = nr*self.winp_colormid[2] + (1-nr)*self.winp_colorbot[2]
index a179feb..6a273b5 100644 (file)
@@ -239,6 +239,31 @@ table td {
   float: left;
 }
 
+
+/* Teamscores */
+.teamscores tr {
+  background-color: #000;
+}
+.teamscores td {
+  padding: 3px;
+  text-align: center;
+  font-size: 12px;
+  font-weight: bold;
+}
+.teamscores tr.red {
+  background-color: #4d0000;
+}
+.teamscores tr.blue {
+  background-color: #00004d;
+}
+.teamscores tr.yellow {
+  background-color: #4d4d00;
+}
+.teamscores tr.pink {
+  background-color: #4d004d;
+}
+
+
 /* Gametype filters */
 .btn-toolbar .nav > li a {
     width: 80px;
index f612645..e498142 100644 (file)
@@ -32,9 +32,9 @@ Game Information
 
 % else:
 <div class="row">
-  <div class="span10 game-detail">
-    <h2>Game Detail</h2>
-    <img width="48" height="48" src="/static/images/icons/48x48/${game.game_type_cd}.png" alt="${game.game_type_cd}"/>
+  <h2>Game Detail</h2>
+  <div class="span6 game-detail">
+    <img width="64" height="64" src="/static/images/icons/48x48/${game.game_type_cd}.png" alt="${game.game_type_cd}"/>
     <p>
     Played: <span class="abstime" data-epoch="${game.epoch()}" title="${game.start_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${game.fuzzy_date()}</span><br />
     Game Type: ${gametype.descr} (${game.game_type_cd})<br />
@@ -46,6 +46,21 @@ Game Information
     </p>
     <span class="clear"></span>
   </div>
+  % if teamscores:
+  <div class="span3 teamscores">
+    <table class="table table-condensed">
+    <thead>
+      <th>Team</th>
+      <th>Score</th>
+    </thead>
+    <tbody>
+    % for ts in teamscores:
+      <tr class="${ts.team}"><td>${ts.team.capitalize()}</td><td>${ts.score}</td></tr>
+    % endfor
+    </tbody>
+    </table>
+  </div>
+  % endif
 </div>
 
 % for team in stats_by_team.keys():