From a18697d0fa343c40e8b8a89d2f6b9305b9fc315b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 12 Feb 2021 15:28:11 +0000 Subject: [PATCH] Show month name in keyboard navigation --- webapp_calendar.py | 3 ++- webapp_timeline.py | 2 +- webapp_utils.py | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webapp_calendar.py b/webapp_calendar.py index 0b54cc36a..025614e79 100644 --- a/webapp_calendar.py +++ b/webapp_calendar.py @@ -415,6 +415,7 @@ def htmlCalendar(cssCache: {}, translate: {}, htmlHideFromScreenReader('←') + ' ' + translate['Previous month'] navLinks[prevMonthStr] = calActor + '/calendar?year=' + str(prevYear) + \ '?month=' + str(prevMonthNumber) - screenReaderCal = htmlKeyboardNavigation(textModeBanner, navLinks) + screenReaderCal = \ + htmlKeyboardNavigation(textModeBanner, navLinks, monthName) return headerStr + screenReaderCal + calendarStr + htmlFooter() diff --git a/webapp_timeline.py b/webapp_timeline.py index f3707b826..0c0407520 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -432,7 +432,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, } if moderator: navLinks[menuModeration] = usersPath + '/moderation#modtimeline' - tlStr += htmlKeyboardNavigation(textModeBanner, navLinks, + tlStr += htmlKeyboardNavigation(textModeBanner, navLinks, None, usersPath, translate, followApprovals) # banner and row of buttons diff --git a/webapp_utils.py b/webapp_utils.py index 1511b1408..9d3e97244 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -887,6 +887,7 @@ def htmlHideFromScreenReader(htmlStr: str) -> str: def htmlKeyboardNavigation(banner: str, links: {}, + subHeading=None, usersPath=None, translate=None, followApprovals=False) -> str: """Given a set of links return the html for keyboard navigation @@ -896,6 +897,10 @@ def htmlKeyboardNavigation(banner: str, links: {}, if banner: htmlStr += '
' + banner + '

' + if subHeading: + htmlStr += '
' + # show new follower approvals if usersPath and translate and followApprovals: htmlStr += '