From dcf300cf0d3cad374833f8ae013a2b860adbab81 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 Jul 2022 11:29:54 +0100 Subject: [PATCH] Page number icons --- fitnessFunctions.py | 2 +- webapp_timeline.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/fitnessFunctions.py b/fitnessFunctions.py index bebba2a09..9dedecfda 100644 --- a/fitnessFunctions.py +++ b/fitnessFunctions.py @@ -120,7 +120,7 @@ def html_watch_points_graph(base_dir: str, fitness: {}, fitness_id: str, return html_str -def fitness_thread(base_dir: str, fitness: {}): +def fitness_thread(base_dir: str, fitness: {}) -> None: """Thread used to save fitness function scores """ fitness_filename = base_dir + '/accounts/fitness.json' diff --git a/webapp_timeline.py b/webapp_timeline.py index 515893e1c..94f7437d2 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -432,6 +432,14 @@ def _page_number_buttons(users_path: str, box_name: str, page_number: int) -> str: """Shows selactable page numbers at the bottom of the screen """ + page_number_chars_highlighted = ( + '⓿', '❶', '❷', '❸', '❹', '❺', '❻', '❼', '❽', '❾', + '❿', '⓫', '⓬', '⓭', '⓮', '⓯', '⓰', '⓱', '⓲', '⓳', '⓴' + ) + page_number_chars = ( + '⓪', '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', + '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳' + ) pages_width = 3 min_page_number = page_number - pages_width min_page_number = max(min_page_number, 1) @@ -443,13 +451,13 @@ def _page_number_buttons(users_path: str, box_name: str, '' num_str += html_hide_from_screen_reader(separator_str) aria_page_str = '' - page_str = ' ' + str(page) + ' ' + page_str = ' ' + page_number_chars[page] + ' ' curr_page_str = '' if page == page_number: page_str = \ - html_hide_from_screen_reader('[') + \ - str(page) + \ - html_hide_from_screen_reader(']') + html_hide_from_screen_reader('') + \ + page_number_chars_highlighted[page] + \ + html_hide_from_screen_reader('') aria_page_str = ' aria-current="true"' curr_page_str = 'Current Page, ' num_str += \