Improved look

This commit is contained in:
2023-04-02 02:12:11 -07:00
parent 29a085d789
commit 39b844b698
4 changed files with 53 additions and 15 deletions
+8 -4
View File
@@ -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 = "<!DOCTYPE html>"
result += "<style>" + cached["css_collapsible"] + "</style>"
result += "<h3>1828 Webster Definitions</h3>"
result += "<h3>1828 Webster Definitions</h3> Click on the word to get the definition."
split_query = query.replace(",", " ").split(" ")
if len(split_query) > 20:
return "Your Query is too long. 20 Words or less."
@@ -407,6 +409,7 @@ def response_single(scripture):
return (
cached["html_navbar"].format(
query=request.args.get("kw", ""),
current_chapter_name=l_r_nav["current_chapter_name"],
next_chapter_name=l_r_nav["next_chapter_name"],
next_chapter_link=l_r_nav["next_chapter_link"],
prev_chapter_name=l_r_nav["prev_chapter_name"],
@@ -437,6 +440,7 @@ def response_multi(scriptures):
response.append(
cached["html_navbar"].format(
query=request.args.get("kw", ""),
current_chapter_name=l_r_nav["current_chapter_name"],
next_chapter_name=l_r_nav["next_chapter_name"],
next_chapter_link=l_r_nav["next_chapter_link"],
prev_chapter_name=l_r_nav["prev_chapter_name"],
+13 -7
View File
@@ -1,14 +1,20 @@
<div class="topbar" align="center">
<a href="/">Home</a> | <a href="/find">Quick Search</a> |
<a href="/random?view=rich">Random Verse</a> |
<a href="/votd?view=rich">Verse of the Day</a>
</div>
<div class="header" id="NavHeader">
<header>
<a href="{prev_chapter_link}">{prev_chapter_name}</a> |
<a href="{next_chapter_link}">{next_chapter_name}</a>
<header align="center">
<form action="/find">
<input type="text" name="kw" value="{query}">
<input type="text" name="kw" value="{query}" id="searchBar">
<input type="hidden" name="view" value="rich"">
<input type="submit" value="Search">
</form>
<a href="/">Home</a> | <a href="/find">Quick Search</a> |
<a href="/random?view=rich">Random Verse</a> |
<a href="/votd?view=rich">Verse of the Day</a>
<
<a href="{prev_chapter_link}">{prev_chapter_name}</a> |
{current_chapter_name} |
<a href="{next_chapter_link}">{next_chapter_name}</a>
>
</header>
</div>
+1 -1
View File
@@ -1 +1 @@
<p><b><a href="/find?kw={chapter}&view=rich">{passage}</a></b><br>{text}</p>
<b><a href="/find?kw={chapter}&view=rich">{passage}</a></b><br>{text}<br>
+31 -3
View File
@@ -1,11 +1,39 @@
<style>
/* Style the header */
.topbar{
padding: 10px;
}
a {
text-align: center;
}
.header {
padding: 10px 16px;
background: #555;
color: #f1f1f1;
background: #dbd5d5;
color: #1a1919;
}
input[type=text] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
text-align: center;
font-size: 14pt;
}
input[type=button], input[type=submit], input[type=reset] {
background-color: #afcdc2;
border: none;
color: rgb(0, 0, 0);
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
}
/* Page content */
.content {
padding: 16px;
@@ -15,7 +43,7 @@
.sticky {
position: fixed;
top: 0;
width: 100%
width: 768px;
}
/* Add some top padding to the page content to prevent sudden quick movement (as the header gets a new position at the top of the page (position:fixed and top:0) */