]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Improved accuracy tabs on the game page.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 11 Apr 2015 00:21:04 +0000 (20:21 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 11 Apr 2015 00:21:04 +0000 (20:21 -0400)
xonstat/static/css/app.css
xonstat/templates/game_info.mako

index b9fa560496a75d0df0549ef70cc50af7fefc4ac7..bdff60bf81476d46560d56aa329f295b54185017 100644 (file)
@@ -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% );
index de2acf9c52c43c4a161f6d0906848e369671df8d..60c5614017f11e5fc72fee2fcff9292b19799b55 100644 (file)
   % 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