From: Ant Zucaro <azucaro@gmail.com> Date: Sat, 11 Apr 2015 00:21:04 +0000 (-0400) Subject: Improved accuracy tabs on the game page. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b923d87f0916d42e6926b32112a217890fb9ea41;p=xonotic%2Fxonstat.git Improved accuracy tabs on the game page. --- diff --git a/xonstat/static/css/app.css b/xonstat/static/css/app.css index b9fa560..bdff60b 100644 --- a/xonstat/static/css/app.css +++ b/xonstat/static/css/app.css @@ -144,6 +144,31 @@ table thead tr th, table thead tr td, table tr th, table tr td { box-shadow: 0 0 6px 1px rgba(0, 140, 186, 0.7); } +/* accordion overrides */ +.accordion .accordion-navigation, .accordion dd { + border: 1px solid #222222; + margin-bottom: 5px; +} + +.accordion .accordion-navigation > a, .accordion dd > a { + background: none; + color: #C3C3C3; + font-family: "Xolonium", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 0.8rem; +} + +.accordion .accordion-navigation > .content.active, .accordion dd > .content.active { + background: none; +} + +.accordion .accordion-navigation.active > a, .accordion .accordion-navigation > a:hover { + background: #242424; +} + +ul.accordion { + margin-left: 0; +} + /* Footer */ #footer { background: linear-gradient( rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 95% ); diff --git a/xonstat/templates/game_info.mako b/xonstat/templates/game_info.mako index de2acf9..60c5614 100644 --- a/xonstat/templates/game_info.mako +++ b/xonstat/templates/game_info.mako @@ -102,61 +102,54 @@ % endif % if len(captimes) > 0: - <div class="row"> - <div class="small-6 columns"> - <h3>Best Flag Capture Times</h3> - <table class="table-hover table-condensed"> - <thead> + <div class="row"> + <div class="small-6 columns"> + <h3>Best Flag Capture Times</h3> + <table class="table-hover table-condensed"> + <thead> + <tr> + <th>Nick</th> + <th>Captime</th> + </tr> + </thead> + <tbody> + % for pgs in captimes: <tr> - <th>Nick</th> - <th>Captime</th> - </tr> - </thead> - <tbody> - % for pgs in captimes: - <tr> - <td> - % if pgs.player_id > 2: - <a href="${request.route_url("player_info", id=pgs.player_id)}" - title="Go to the info page for this player"> + <td> + % if pgs.player_id > 2: + <a href="${request.route_url("player_info", id=pgs.player_id)}" + title="Go to the info page for this player"> + <span class="nick">${pgs.nick_html_colors()|n}</span> + </a> + % else: <span class="nick">${pgs.nick_html_colors()|n}</span> - </a> - % else: - <span class="nick">${pgs.nick_html_colors()|n}</span> - % endif - </td> - <td>${round(float(pgs.fastest.seconds) + (pgs.fastest.microseconds/1000000.0), 2)}</td> - </tr> - % endfor - </tbody> - </table> + % endif + </td> + <td>${round(float(pgs.fastest.seconds) + (pgs.fastest.microseconds/1000000.0), 2)}</td> + </tr> + % endfor + </tbody> + </table> + </div> </div> - </div> -% endif + % endif -% if len(pgstats) > 0 and len(pwstats) > 0: - <div class="row"> - <div class="small-12 columns"> - <h3>Accuracy Information</h3> - <div class="accordion" id="acc-accordion" style="display:none;"> - % for pgstat in pgstats: - % if pgstat.player_game_stat_id in pwstats: - <div class="accordion-group"> - <div class="accordion-heading"> - <a class="accordion-toggle" data-toggle="collapse" data-parent="#acc-accordion" href="#accuracy-${pgstat.player_game_stat_id}"> - Accuracy for ${pgstat.nick_html_colors()|n} - </a> - </div> - <div id="accuracy-${pgstat.player_game_stat_id}" class="accordion-body collapse in"> - <div class="accordion-inner"> - ${accuracy(pwstats[pgstat.player_game_stat_id])} - </div> - </div> - </div> - % endif - % endfor + % if len(pgstats) > 0 and len(pwstats) > 0: + <div class="row"> + <div class="small-12 columns"> + <ul class="accordion" data-accordion> + % for pgstat in pgstats: + % if pgstat.player_game_stat_id in pwstats: + <li class="accordion-navigation"> + <a href="#accuracy-${pgstat.player_game_stat_id}">Accuracy for ${pgstat.nick_html_colors()|n}</a> + <div id="accuracy-${pgstat.player_game_stat_id}" class="content"> + ${accuracy(pwstats[pgstat.player_game_stat_id])} + </div> + </li> + % endif + % endfor + </ul> + </div> </div> - </div> - % endif - </div> + % endif % endif