From 88a1ed933da9890d32eef05cec2d42f347e710c4 Mon Sep 17 00:00:00 2001 From: Taka Date: Mon, 26 Nov 2018 14:14:48 +0000 Subject: [PATCH] Include flags in the SCENARIO template. --- vasl_templates/webapp/data/default-template-pack/players.j2 | 4 ++-- vasl_templates/webapp/static/snippets.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/vasl_templates/webapp/data/default-template-pack/players.j2 b/vasl_templates/webapp/data/default-template-pack/players.j2 index be51942..879dab5 100644 --- a/vasl_templates/webapp/data/default-template-pack/players.j2 +++ b/vasl_templates/webapp/data/default-template-pack/players.j2 @@ -10,8 +10,8 @@ "> - {{PLAYER_1_NAME}}:
- {{PLAYER_2_NAME}}: + {%if PLAYER_FLAG_1%} {%endif%}{{PLAYER_1_NAME}}:
+ {%if PLAYER_FLAG_2%} {%endif%}{{PLAYER_2_NAME}}: ELR: {{PLAYER_1_ELR}}
ELR: {{PLAYER_2_ELR}} diff --git a/vasl_templates/webapp/static/snippets.js b/vasl_templates/webapp/static/snippets.js index fd83256..961c4e7 100644 --- a/vasl_templates/webapp/static/snippets.js +++ b/vasl_templates/webapp/static/snippets.js @@ -84,9 +84,13 @@ function make_snippet( $btn, extra_params, show_date_warnings ) params.OB_ORDNANCE_WIDTH = params.OB_ORDNANCE_WIDTH_2 ; } - // include the player display names + // include the player display names and flags params.PLAYER_1_NAME = get_nationality_display_name( params.PLAYER_1 ) ; params.PLAYER_2_NAME = get_nationality_display_name( params.PLAYER_2 ) ; + if ( gUserSettings["include-flags-in-snippets"] ) { + params.PLAYER_FLAG_1 = make_player_flag_url( get_player_nat( 1 ) ) ; + params.PLAYER_FLAG_2 = make_player_flag_url( get_player_nat( 2 ) ) ; + } // pass through all the player colors and names params.PLAYER_NAMES = {} ;