diff options
author | emkael <emkael@tlen.pl> | 2019-01-25 18:17:02 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-01-25 18:17:02 +0100 |
commit | 6e090383ea1b561af29e696f3f56950d5c4e9ad5 (patch) | |
tree | 9ad0974269f192fd06da9f94d6aabaed093b8fe0 /jfr_playoff/generator.py | |
parent | 7a654d9a863a6982089bad3c5fc672b3255a20d6 (diff) |
Finishing position captions in tooltips
Diffstat (limited to 'jfr_playoff/generator.py')
-rw-r--r-- | jfr_playoff/generator.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py index 8bdb2d8..f1e2829 100644 --- a/jfr_playoff/generator.py +++ b/jfr_playoff/generator.py @@ -269,6 +269,7 @@ class PlayoffGenerator(object): boxes = '' order = 0 for place in sorted(positions): + caption = self.get_caption_for_finishing_position(place) boxes += self.p_temp.get( 'FINISHING_POSITION_BOX', self.page['margin'] / 2 + int(float(order) / float(len(positions)) * dimensions[1]), @@ -276,7 +277,7 @@ class PlayoffGenerator(object): place, ' '.join([str(p) for p in position_info[place]['winner']]), ' '.join([str(p) for p in position_info[place]['loser']]), - self.p_temp.get('POSITION_BOX', place)) + self.p_temp.get('CAPTIONED_POSITION_BOX', caption, place) if caption else self.p_temp.get('POSITION_BOX', place)) order += 1 return boxes @@ -356,6 +357,12 @@ class PlayoffGenerator(object): ) ) + def get_caption_for_finishing_position(self, position): + for style in self.leaderboard_classes: + if position in style['positions']: + return style['caption'] + return None + def get_leaderboard_row_class(self, position): classes = [] for style in self.leaderboard_classes: |