fix display

This commit is contained in:
Sarah 2022-07-01 15:26:16 +01:00
parent 6600d7ffb7
commit 87a44997d7
1 changed files with 9 additions and 2 deletions

View File

@ -69,8 +69,15 @@ def build_page(hidden_themes):
row_data.append(str(date)) row_data.append(str(date))
row_data.append(VCinemaUtils.get_film_list(data['viewings'])) row_data.append(VCinemaUtils.get_film_list(data['viewings']))
if 'hidden_themes' in data and data['hidden_themes'] != {}: if 'hidden_themes' in data and data['hidden_themes'] != {}:
row_data.append(("<br>".join( hidden_theme_labels = []
"{} ({}%)".format(k, data['hidden_themes'][k] * 100) for k in sorted(data['hidden_themes']))))
for hidden_theme in sorted(data['hidden_themes'].keys()):
if data['hidden_themes'][hidden_theme] == 1:
hidden_theme_labels.append(hidden_theme)
else:
hidden_theme_labels.append("<i>{} ({}%)</i>".format(hidden_theme, round(data['hidden_themes'][hidden_theme] * 100)))
row_data.append("<br>".join(hidden_theme_labels))
else: else:
row_data.append("N/A") row_data.append("N/A")