From b964212e5b27e50d0bbd54798ed4f3cbc31615f4 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Tue, 20 Aug 2013 20:01:08 -0400 Subject: [PATCH] Refactor the damage graph. --- xonstat/templates/damage_graph.mako | 35 +++++++++++++ xonstat/templates/player_info.mako | 80 ++--------------------------- 2 files changed, 38 insertions(+), 77 deletions(-) create mode 100644 xonstat/templates/damage_graph.mako diff --git a/xonstat/templates/damage_graph.mako b/xonstat/templates/damage_graph.mako new file mode 100644 index 0000000..0860504 --- /dev/null +++ b/xonstat/templates/damage_graph.mako @@ -0,0 +1,35 @@ +<%def name="damage_graph(recent_weapons)"> +### splash weapon info is available +% if 'rocketlauncher' in recent_weapons or 'grenadelauncher' in recent_weapons or 'electro' in recent_weapons or 'crylink' in recent_weapons or 'laser' in recent_weapons: +
+
+

Damage Efficiency

+ +
+
+ +
+
    + % for weapon in ['rocketlauncher', 'grenadelauncher', 'electro', 'crylink', 'hagar', 'laser']: + % if weapon in recent_weapons: +
  • + ### the rocketlauncher is underscored first by default (until user selection) + % if weapon == 'rocketlauncher': +
    + % else: +
    + % endif + +

    ${weapon}

    + +
    +
  • + % endif + % endfor +
+
+ +
+
+% endif + diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 293d1d5..2539a0d 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -2,6 +2,7 @@ <%namespace name="nav" file="nav.mako" /> <%namespace file="accuracy.mako" import="accuracy" /> <%namespace file="accuracy_graph.mako" import="accuracy_graph" /> +<%namespace file="damage_graph.mako" import="damage_graph" /> <%block name="navigation"> ${nav.nav('players')} @@ -331,86 +332,11 @@ Player Information - ### ACCURACY GRAPH ${accuracy_graph(recent_weapons)} -% if 'rocketlauncher' in recent_weapons or 'grenadelauncher' in recent_weapons or 'electro' in recent_weapons or 'crylink' in recent_weapons or 'laser' in recent_weapons: -
-
-

Damage Efficiency

-
-
- -
-
    - % if 'rocketlauncher' in recent_weapons: -
  • -
    - -

    Rocket

    - -
    -
  • - % endif - - % if 'grenadelauncher' in recent_weapons: -
  • -
    - -

    Mortar

    - -
    -
  • - % endif - - % if 'electro' in recent_weapons: -
  • -
    - -

    Electro

    - -
    -
  • - % endif - - % if 'crylink' in recent_weapons: -
  • -
    - -

    Crylink

    - -
    -
  • - % endif - - % if 'hagar' in recent_weapons: -
  • -
    - -

    Hagar

    - -
    -
  • - % endif - - % if 'laser' in recent_weapons: -
  • -
    - -

    Laser

    - -
    -
  • - % endif - -
-
- -
-
-% endif - +### DAMAGE GRAPH +${damage_graph(recent_weapons)} ##### RECENT GAMES (v2) #### % if recent_games: -- 2.39.2