summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-12-30 00:06:11 +0100
committeremkael <emkael@tlen.pl>2019-12-30 00:06:11 +0100
commitc904ec2a826f1a55adff51d8db90f224008ca350 (patch)
tree23dc8703544119c2f8e5faee7ef5bf366ac76181
parent3d06a19e83334356da988dcf866655f98b06ee42 (diff)
Support for absolute URLs for team flags
-rw-r--r--jfr_playoff/generator.py10
-rw-r--r--jfr_playoff/template.py2
2 files changed, 10 insertions, 2 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index 5411e0e..7d108d2 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -1,4 +1,5 @@
from datetime import datetime
+import urlparse
from jfr_playoff.dto import coalesce
from jfr_playoff.template import PlayoffTemplate
@@ -435,4 +436,11 @@ class PlayoffGenerator(object):
def get_flag(self, team):
flag = self.data.get_team_image(team)
- return '' if flag is None else self.p_temp.get('LEADERBOARD_ROW_FLAG', flag)
+ return '' \
+ if flag is None \
+ else self.p_temp.get(
+ 'LEADERBOARD_ROW_FLAG',
+ ''
+ if bool(urlparse.urlparse(flag).netloc)
+ else 'images/',
+ flag)
diff --git a/jfr_playoff/template.py b/jfr_playoff/template.py
index c4e6d4f..c72378c 100644
--- a/jfr_playoff/template.py
+++ b/jfr_playoff/template.py
@@ -149,7 +149,7 @@ class PlayoffTemplateStrings(object):
'''
LEADERBOARD_ROW_FLAG = '''
- <img class="fl" src="images/%s" />
+ <img class="fl" src="%s%s" />
'''
LEADERBOARD_CAPTION_TABLE = '''