diff options
author | emkael <emkael@tlen.pl> | 2018-02-20 22:59:46 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-02-20 22:59:46 +0100 |
commit | 95270b1f32ff946879cc9d8d7d4fe5f33b3a2868 (patch) | |
tree | 662e5126f2b97394b90e72cd15d1c7e97dd48943 | |
parent | 7baf404cfb4733c6512978dc011090fc0230744b (diff) |
If swiss is still not finished, display a running link
-rw-r--r-- | jfr_playoff/data.py | 3 | ||||
-rw-r--r-- | jfr_playoff/generator.py | 2 | ||||
-rw-r--r-- | jfr_playoff/template.py | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/jfr_playoff/data.py b/jfr_playoff/data.py index 83f5d6c..7f29bb2 100644 --- a/jfr_playoff/data.py +++ b/jfr_playoff/data.py @@ -138,7 +138,8 @@ class PlayoffData(object): return [{ 'link': self.get_swiss_link(event), 'position': event['position'], - 'label': event['label'] if 'label' in event else None + 'label': event['label'] if 'label' in event else None, + 'finished': TournamentInfo(event, self.database).is_finished() } for event in self.swiss] def get_dimensions(self): diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py index bb18bb9..49ae3a4 100644 --- a/jfr_playoff/generator.py +++ b/jfr_playoff/generator.py @@ -129,7 +129,7 @@ class PlayoffGenerator(object): event_label = p_temp.SWISS_DEFAULT_LABEL % (event['position']) if 'label' in event and event['label'] is not None: event_label = event['label'] - info.append(p_temp.SWISS_LINK % ( + info.append((p_temp.SWISS_LINK if event['finished'] else p_temp.SWISS_RUNNING_LINK) % ( event['link'], event_label )) return '\n'.join(info) diff --git a/jfr_playoff/template.py b/jfr_playoff/template.py index 3296461..b814026 100644 --- a/jfr_playoff/template.py +++ b/jfr_playoff/template.py @@ -134,4 +134,8 @@ SWISS_LINK = ''' [<a href="%s" class="zb" target="_top"> %s </a>]<br /><br /> ''' +SWISS_RUNNING_LINK = ''' +[<a href="%s" class="zb" target="_top"> <img src="images/A.gif" /> %s <img src="images/A.gif" /> </a>]<br /><br /> +''' + SWISS_DEFAULT_LABEL = 'Turniej o %d. miejsce' |