From d9d66fd94d194de30b0b22aac4971f8d21489391 Mon Sep 17 00:00:00 2001 From: Pishoy Girgis Date: Sun, 11 Aug 2024 16:35:38 +0200 Subject: [PATCH] [#122][Crum/Flashcards] Pass Active Dialects in the Next and Prev Links. --- flashcards/constants.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flashcards/constants.py b/flashcards/constants.py index 7072bac8c0..351217f4f4 100644 --- a/flashcards/constants.py +++ b/flashcards/constants.py @@ -206,6 +206,13 @@ def dialect(col: str) -> field.Field: el.classList.add('very-light'); } }); + navigateQuery = "?d=" + dialects.filter((d) => { + return dialectStyle.get(d) == 'bold'; }).join(','); + document.querySelectorAll('.navigate').forEach((el) => { + let url = new URL(el.getAttribute('href')); + url.searchParams.delete('d'); + el.setAttribute('href', url.toString() + navigateQuery); + }); } Array.prototype.forEach.call(els, (btn) => { btn.classList.add('hover-link'); @@ -389,7 +396,7 @@ def dialect(col: str) -> field.Field: # TODO: Update the home page, it will no longer be the repo. f"""
Home """, field.aon( - f'prev', ), @@ -401,7 +408,7 @@ def dialect(col: str) -> field.Field: }, ), field.aon( - f'next', ),