From: Ant Zucaro Date: Wed, 21 Aug 2013 00:01:08 +0000 (-0400) Subject: Refactor the damage graph. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b964212e5b27e50d0bbd54798ed4f3cbc31615f4;p=xonotic%2Fxonstat.git Refactor the damage graph. --- 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: