From c904ec2a826f1a55adff51d8db90f224008ca350 Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 30 Dec 2019 00:06:11 +0100 Subject: Support for absolute URLs for team flags --- jfr_playoff/generator.py | 10 +++++++++- jfr_playoff/template.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'jfr_playoff') 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 = ''' - + ''' LEADERBOARD_CAPTION_TABLE = ''' -- cgit v1.2.3