diff options
Diffstat (limited to 'jfr_playoff')
-rw-r--r-- | jfr_playoff/generator.py | 27 | ||||
-rw-r--r-- | jfr_playoff/template.py | 2 |
2 files changed, 22 insertions, 7 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py index a42130a..9b7f31e 100644 --- a/jfr_playoff/generator.py +++ b/jfr_playoff/generator.py @@ -106,16 +106,31 @@ class PlayoffGenerator(object): def get_match_box(self, match, position): if match is not None: + winner_link = [ + str(m) for m in match.winner_matches + ] if match.winner_matches is not None else [] + loser_link = [ + str(m) for m in match.loser_matches + ] if match.loser_matches is not None else [] + place_loser_link = [] + place_winner_link = [] + if 'starting_position_indicators' in self.page \ + and self.page['starting_position_indicators']: + for team in match.teams: + if len(team.place) > 0: + place_link = ['place-' + str(pl) for pl in team.place] + if len(team.place) > 1: + place_loser_link += place_link + else: + place_winner_link += place_link return self.p_temp.get( 'MATCH_BOX', position[0], position[1], match.id, - ' '.join([ - str(m) for m in match.winner_matches - ]) if match.winner_matches is not None else '', - ' '.join([ - str(m) for m in match.loser_matches - ]) if match.loser_matches is not None else '', + ' '.join(winner_link), + ' '.join(loser_link), + ' '.join(place_winner_link), + ' '.join(place_loser_link), self.get_match_table(match)) return '' diff --git a/jfr_playoff/template.py b/jfr_playoff/template.py index 3473530..7b91b3b 100644 --- a/jfr_playoff/template.py +++ b/jfr_playoff/template.py @@ -92,7 +92,7 @@ class PlayoffTemplateStrings(object): ''' MATCH_BOX = ''' - <div style="text-align: center; position: absolute; left: %dpx; top: %dpx" data-id="%d" data-winner="%s" data-loser="%s" class="playoff_matchbox"> + <div style="text-align: center; position: absolute; left: %dpx; top: %dpx" data-id="%d" data-winner="%s" data-loser="%s" data-place-winner="%s" data-place-loser="%s" class="playoff_matchbox"> %s </div> ''' |