From 4ea5d71575cd03631a209d3b5a316261bec850cc Mon Sep 17 00:00:00 2001 From: Krzysztof D Date: Sat, 23 Apr 2022 14:19:00 +0200 Subject: [PATCH] =?UTF-8?q?Dodanie=20kolumny=20z=20ilo=C5=9Bci=C4=85=20wys?= =?UTF-8?q?tapie=C5=84=20danej=20komendy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 4 +- templates/index.html | 252 ++++++++++++++++++++++--------------------- 2 files changed, 135 insertions(+), 121 deletions(-) diff --git a/app.py b/app.py index 8a264fe..21e9125 100644 --- a/app.py +++ b/app.py @@ -39,7 +39,7 @@ def sort_by_rank(commands_list): def get_file_data_lines(fn): file_path = os.path.join(classic_data_folder, fn) - with open(file_path, 'r', encoding="utf-8" as f: + with open(file_path, 'r', encoding="utf-8") as f: text_lines = f.readlines() text_lines = [l.encode('utf-8').decode().strip() for l in text_lines if '#' in l] return text_lines @@ -77,6 +77,7 @@ def load_classic_data(): command = {} command['name'] = None command['rank'] = None + command['rank_number'] = None command['rank_list'] = [] command['description'] = [] @@ -105,6 +106,7 @@ def load_classic_data(): rank = 33 - rank command['rank_list'].append(rank) command['rank'] = sum(command['rank_list']) + command['rank_number'] = len(command['rank_list']) # Description: description = text_lines[idx+1] diff --git a/templates/index.html b/templates/index.html index 9e53b8d..9a1e52c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,6 @@ + LinuxHot16Challenge @@ -8,136 +9,147 @@ + - - -
-

Linux hot 16 challenge

-
- -
- -
+ +
+

Linux hot 16 challenge

+
+ +
+ +
-
-
-
Szukaj komendy:
-
- - -
+
+
+
Szukaj komendy:
+
+ + +
+
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for position in ranking[3:] %} - - - - - {% if position.description[3]|length > 2 %} - - {% else %} - - {% endif %} - - {% endfor %} - - - -
PozycjaIlość punktówKomendaOpis
{{ranking[0].nr}}{{ranking[0].rank}}{{ranking[0].name}}{{ranking[0].description[3]}}
{{ranking[1].nr}}{{ranking[1].rank}}{{ranking[1].name}}{{ranking[1].description[3]}}
{{ranking[2].nr}}{{ranking[2].rank}}{{ranking[2].name}}{{ranking[2].description[3]}}
{{position.nr}}{{position.rank}}{{position.name}}{{position.description[3]}}{{position.description[0]}}
-
- -
- -
- -
- -
© 2022
-
+
© 2022
+
- + + \ No newline at end of file