]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/game_info.mako
Add teamnames to teamscores, fix layout issues, fix sorting for LMS/KA
[xonotic/xonstat.git] / xonstat / templates / game_info.mako
index 2de16f56e1f8e0db1e211f409ae240ffb5352284..b9ab8765282b5385401386b7272deb5443e4a377 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="span8 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,14 +46,56 @@ 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>
 
+% if len(tgstats) == len(stats_by_team):
+## if we have teamscores in the db
+% for tgstat in tgstats:
+<div class="row">
+  <div class="span1 teamscore">
+  <div class="teamname ${tgstat.team_html_color()}">
+  ${tgstat.team_html_color().capitalize()}
+  </div>
+  <div class="${tgstat.team_html_color()}">
+  % if game.game_type_cd == 'ctf':
+  ${tgstat.caps}
+  % elif game.game_type_cd == 'ca':
+  ${tgstat.rounds}
+## dom -> ticks, rc -> laps, nb -> goals, as -> objectives
+  % else:
+  ${tgstat.score}
+  % endif
+  </div>
+  </div>
+  <div class="span10 game">
+  ${scoreboard(game.game_type_cd, stats_by_team[tgstat.team], show_elo, show_latency)}
+  </div>
+</div>
+% endfor
+% else:
+% for team in stats_by_team.keys():
 <div class="row">
   <div class="span12 game">
-    <h3>Scoreboard</h3>
-    ${scoreboard(game.game_type_cd, pgstats, show_elo, show_latency)}
+  ${scoreboard(game.game_type_cd, stats_by_team[team], show_elo, show_latency)}
   </div>
 </div>
+% endfor
+% endif
 
 % if len(captimes) > 0:
 <div class="row">