diff --git a/app.py b/app.py index 77fcc4f..527592b 100644 --- a/app.py +++ b/app.py @@ -26,11 +26,10 @@ TODO: Replace send_file with something that loads headers and nav templates Search phrase alias dictionary Response Bible book reading -*Forward and Backward Navigation ** add to rich responses +Pretty navigation bar Search highlighting Styles Bible Reading Plan -Bible Reader /seq Going backwards (works but is buggy, disabled for now) /seq Wrap back to Gen 1:1 when you reach the end of Rev /seq Querying what your UID's next verse is going to be @@ -56,7 +55,6 @@ cached = { } # Fill the chapter list with unique chapters for seeking back and forward by index. -#TODO Fix string-based..? sorting problem [ cached["chapter_list"].append(int(str(chap)[:-3])) for chap in cached.get("verse_ids") @@ -131,6 +129,9 @@ def get_next_prev_chapter(verseid): next_chapter_id = str(cached["chapter_list"][(current_chapter_index + 1) % len(cached["chapter_list"])]) #prev_chapter_id = str(cached["chapter_list"][current_chapter_index - 1]) prev_chapter_id = str(cached["chapter_list"][(current_chapter_index - 1) % len(cached["chapter_list"])]) + current_chapter_name = " ".join( + (lookup_bookname(current_chapter[:-3]), str(current_chapter[-3:]).lstrip("0")) + ) next_chapter_name = " ".join( (lookup_bookname(next_chapter_id[:-3]), str(next_chapter_id[-3:]).lstrip("0")) ) @@ -140,6 +141,7 @@ def get_next_prev_chapter(verseid): next_chapter_link = f"/show?kw={next_chapter_name}&view=rich" prev_chapter_link = f"/show?kw={prev_chapter_name}&view=rich" result = { + "current_chapter_name": current_chapter_name, "prev_chapter_name": prev_chapter_name, "prev_chapter_link": prev_chapter_link, "next_chapter_name": next_chapter_name, @@ -220,7 +222,7 @@ def parse_query(): return result result = "" result += "" - result += "
{passage}
{text}