6a59e611fb2725e0c40bae92350a1b14b77814cd
[xonotic/xonstat.git] / xonstat / templates / nvd3_damage.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3
4 <%block name="navigation">
5 ${nav.nav('players')}
6 </%block>
7
8 <%block name="title">
9 Player Damage
10 </%block>
11
12 <%block name="css">
13 ${parent.css()}
14 <link href="/static/css/sprites.css" rel="stylesheet">
15 <link href="/static/css/nv.d3.css" rel="stylesheet" type="text/css">
16
17 <style>
18 #damageChartSVG {
19   height: 500px;
20 }
21 </style>
22 </%block>
23
24 <script src="/static/js/d3.v3.min.js"></script>
25
26 <%block name="js">
27 ${parent.js()}
28 <script src="/static/js/d3.v3.js"></script>
29 <script src="/static/js/nv.d3.min.js"></script>
30 <script src="/static/js/weaponCharts.js"></script>
31 <script>
32 % if game_type_cd is not None:
33     d3.json("${request.route_url('player_weaponstats_data_json', id=player_id, _query={'limit':limit, 'game_type':game_type_cd})}", drawDamageChart);
34 % else:
35     d3.json("${request.route_url('player_weaponstats_data_json', id=player_id, _query={'limit':limit})}", drawDamageChart);
36 % endif
37
38 % for gt in ('overall','duel','ctf','dm','tdm','ca','kh','ft','lms','as','dom','nb','cts','rc'):
39 d3.select('.sprite-${gt}').on("click", function() {
40   d3.json("${request.route_url('player_weaponstats_data_json', id=player_id, _query={'limit':limit, 'game_type':gt})}", drawDamageChart);
41 });
42 % endfor
43
44 </script>
45 </%block>
46
47 <div class="row">
48   <div class="span12">
49
50     <div id="damageChart">
51       <svg id="damageChartSVG"></svg>
52     </div>
53
54   </div> <!-- end span12 -->
55 </div> <!-- end row -->
56
57 ##### ROW OF GAME TYPE ICONS #####
58 <div class="row">
59   <div class="span12 tabbable">
60     <ul class="nav nav-tabs">
61       % for gt in ('overall','duel','ctf','dm','tdm','ca','kh','ft','lms','as','dom','nb','cts','rc'):
62       <li 
63       % if game_type_cd == gt or (game_type_cd is None and gt == 'overall'):
64       class="active"
65       % endif
66       >
67         <span class="sprite sprite-${gt}"> </span><br />
68         ${gt} <br />
69       </li>
70       % endfor
71     </ul>
72     <br />
73   </div>
74 </div>