]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/player_info.mako
Fix a JavaScript hover issue (via zykure).
[xonotic/xonstat.git] / xonstat / templates / player_info.mako
index da1057aaed5f3aa2887a461dc524824865ce968f..4b9485838f39bb985e5e6f6748ebe49f58e07ee5 100644 (file)
@@ -77,9 +77,11 @@ ${nav.nav('players')}
           }
 
           var previousPoint = null;
+          var previousLabel = null;
           $('#acc-graph').bind("plothover", function (event, pos, item) {
               if (item) {
-                  if (previousPoint != item.dataIndex) {
+                if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) {
+                    previousLabel = item.series.label;
                     previousPoint = item.dataIndex;
 
                     $("#tooltip").remove();
@@ -92,13 +94,15 @@ ${nav.nav('players')}
               else {
                   $("#tooltip").remove();
                   previousPoint = null;
+                  previousLabel = null;
               }
           });
 
           $('#dmg-graph').bind("plothover", function (event, pos, item) {
               if (item) {
-                  if (previousPoint != item.dataIndex) {
+                if ((previousLabel != item.series.label) || (previousPoint != item.dataIndex)) {
                     previousPoint = item.dataIndex;
+                    previousLabel = item.series.label;
 
                     $("#tooltip").remove();
                     var x = item.datapoint[0].toFixed(2),
@@ -110,6 +114,7 @@ ${nav.nav('players')}
               else {
                   $("#tooltip").remove();
                   previousPoint = null;
+                  previousLabel = null;
               }
           });
 
@@ -156,8 +161,6 @@ ${nav.nav('players')}
               dataType: 'json',
               success: plot_dmg_graph
           });
-
-
       })
       </script>
     % endif
@@ -174,28 +177,50 @@ Player Information
 
 % else:
 <div class="row">
-  <div class="span8">
+  <div class="span12">
     <h2>${player.nick_html_colors()|n}</h2>
+  </div>
+</div>
+
+<div class="row">
+  <div class="span6">
+    <p>
+      Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
+
+      Last Seen: <small><span class="abstime" data-epoch="${recent_games[0][1].epoch()}" title="${recent_games[0][1].create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${recent_games[0][1].fuzzy_date()}</span> </small><br />
+
+      Playing Time: <small>${total_stats['alivetime']} </small><br />
+
+      <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in games_breakdown]) %>
+      Games Played: <small>${total_games} (${games_breakdown_str})</small><br />
+
+      % if fav_map is not None:
+      Favorite Map: <small><a href="${request.route_url('map_info', id=fav_map['id'])}" title="view map info">${fav_map['name']}</a></small><br />
+      % endif
+    </p>
+  </div>
+  <div class="span6">
     <p>
-       Member Since: <small>${player.create_dt.strftime('%m/%d/%Y at %I:%M %p')} </small><br />
-       Last Seen: <small>${recent_games[0][1].fuzzy_date()} </small><br />
-       Playing Time: <small>${total_stats['alivetime']} </small><br />
        % if total_games > 0 and total_stats['wins'] is not None:
        Win Percentage: <small>${round(float(total_stats['wins'])/total_games * 100, 2)}% (${total_stats['wins']} wins, ${total_games - total_stats['wins']} losses) </small><br />
        % endif
+
        % if total_stats['kills'] > 0 and total_stats['deaths'] > 0:
        Kill Ratio: <small>${round(float(total_stats['kills'])/total_stats['deaths'], 3)} (${total_stats['kills']} kills, ${total_stats['deaths']} deaths) </small><br />
        % endif
-       <% games_breakdown_str = ', '.join(["{0} {1}".format(ng, gt) for (gt, ng) in games_breakdown]) %>
-       Games Played: <small>${total_games} (${games_breakdown_str})</small><br />
+
        % if elos_display is not None and len(elos_display) > 0:
        Elo:
           <small>${', '.join(elos_display)} </small>
           <br />
           %if '*' in ', '.join(elos_display):
-              <small><i>*preliminary Elo</i></small>
+              <small><i>*preliminary Elo</i></small><br />
           %endif
       % endif
+
+      % if ranks_display != '':
+      Ranks: <small>${ranks_display}</small><br />
+      % endif
     </p>
   </div>
 </div>
@@ -382,7 +407,7 @@ Player Information
             % endif
           % endif
            </td>
-           <td>${game.fuzzy_date()}</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>
         </tr>
       % endfor
       </tbody>