From b3f82bb3dfde5fddf8010b7d6b1f02802dbf9bf1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 26 Nov 2025 11:11:18 -0500 Subject: [PATCH] Reorder search dropdown categories and add resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move verses to end of dropdown results (after topics, resources, stories, plans) - Add resources search (theological studies, biblical figures, tools) - Include: Trinity, Christology, Soteriology, angels, prophets, parables, covenants, apostles, timeline, family tree, interlinear, concordance, etc. - Update all search dropdowns: sidebar, homepage, search page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/routes/api.py | 47 ++++++++++++++++++++++++++++++ kjvstudy_org/templates/base.html | 9 ++++-- kjvstudy_org/templates/index.html | 3 +- kjvstudy_org/templates/search.html | 35 ++++++++++++++-------- 4 files changed, 78 insertions(+), 16 deletions(-) diff --git a/kjvstudy_org/routes/api.py b/kjvstudy_org/routes/api.py index 441252b..5404c77 100644 --- a/kjvstudy_org/routes/api.py +++ b/kjvstudy_org/routes/api.py @@ -172,6 +172,53 @@ def universal_search_api( if matching_plans: results["plans"] = matching_plans + # Search resources (theological studies, biblical figures, etc.) + resources_to_search = [ + ("trinity", "/trinity", "The Trinity"), + ("christology", "/christology", "Christology"), + ("soteriology", "/soteriology", "Soteriology"), + ("pneumatology", "/pneumatology", "Pneumatology"), + ("eschatology", "/eschatology", "Eschatology"), + ("ecclesiology", "/ecclesiology", "Ecclesiology"), + ("types_and_shadows", "/types-and-shadows", "Types and Shadows"), + ("messianic_prophecies", "/messianic-prophecies", "Messianic Prophecies"), + ("blood_in_scripture", "/blood-in-scripture", "The Blood in Scripture"), + ("kingdom_of_god", "/kingdom-of-god", "The Kingdom of God"), + ("names_of_christ", "/names-of-christ", "Names of Christ"), + ("spirits_and_demons", "/spirits-and-demons", "Spirits and Demons"), + ("personifications", "/personifications", "Personifications"), + ("angels", "/biblical-angels", "Biblical Angels"), + ("prophets", "/biblical-prophets", "Biblical Prophets"), + ("names", "/names-of-god", "Names of God"), + ("parables", "/parables", "Parables of Jesus"), + ("covenants", "/biblical-covenants", "Biblical Covenants"), + ("apostles", "/the-twelve-apostles", "The Twelve Apostles"), + ("women", "/women-of-the-bible", "Women of the Bible"), + ("festivals", "/biblical-festivals", "Biblical Festivals"), + ("fruits", "/fruits-of-the-spirit", "Fruits of the Spirit"), + ("miracles", "/miracles-of-jesus", "Miracles of Jesus"), + ("prayers", "/prayers-of-the-bible", "Prayers of the Bible"), + ("beatitudes", "/beatitudes", "The Beatitudes"), + ("ten_commandments", "/ten-commandments", "Ten Commandments"), + ("armor_of_god", "/armor-of-god", "Armor of God"), + ("i_am_statements", "/i-am-statements", "I Am Statements"), + ("tetragrammaton", "/tetragrammaton", "The Tetragrammaton"), + ("timeline", "/biblical-timeline", "Biblical Timeline"), + ("family_tree", "/family-tree", "Biblical Genealogies"), + ("genealogy", "/family-tree", "Biblical Genealogies"), + ("interlinear", "/interlinear", "Interlinear Bible"), + ("concordance", "/concordance", "Concordance"), + ("study_guides", "/study-guides", "Study Guides"), + ("maps", "/maps", "Bible Maps"), + ] + matching_resources = [ + {"name": name, "url": url} + for key, url, name in resources_to_search + if query in key.lower() or query in name.lower() + ][:limit] + if matching_resources: + results["resources"] = matching_resources + return {"query": q, "results": results} diff --git a/kjvstudy_org/templates/base.html b/kjvstudy_org/templates/base.html index 93b8135..eaef0ef 100644 --- a/kjvstudy_org/templates/base.html +++ b/kjvstudy_org/templates/base.html @@ -1419,6 +1419,7 @@ books: 'Books', verses: 'Verses', topics: 'Topics', + resources: 'Resources', stories: 'Stories', plans: 'Reading Plans' }; @@ -1445,8 +1446,10 @@ if (Object.keys(results).length === 0 && !verseUrl) { html = '
No results found
'; } else { - for (var category in results) { - if (results[category].length > 0) { + // Render categories in specific order: books, topics, resources, stories, plans, verses + var categoryOrder = ['books', 'topics', 'resources', 'stories', 'plans', 'verses']; + categoryOrder.forEach(function(category) { + if (results[category] && results[category].length > 0) { html += '
'; html += '
' + (categoryLabels[category] || category) + '
'; @@ -1465,7 +1468,7 @@ html += '
'; } - } + }); // Add "View all results" link html += 'View all verse results →'; diff --git a/kjvstudy_org/templates/index.html b/kjvstudy_org/templates/index.html index 21480dd..80fc598 100644 --- a/kjvstudy_org/templates/index.html +++ b/kjvstudy_org/templates/index.html @@ -558,6 +558,7 @@ var categoryLabels = { books: 'Books', verses: 'Verses', topics: 'Topics', + resources: 'Resources', stories: 'Stories', plans: 'Reading Plans' }; @@ -651,7 +652,7 @@ function renderResults(data, query) { } // Render each category - var categories = ['books', 'verses', 'topics', 'stories', 'plans']; + var categories = ['books', 'topics', 'resources', 'stories', 'plans', 'verses']; categories.forEach(function(cat) { if (results[cat] && results[cat].length > 0) { html += '
' + categoryLabels[cat] + '
'; diff --git a/kjvstudy_org/templates/search.html b/kjvstudy_org/templates/search.html index 13e842f..47c786d 100644 --- a/kjvstudy_org/templates/search.html +++ b/kjvstudy_org/templates/search.html @@ -324,18 +324,6 @@ document.addEventListener('DOMContentLoaded', function() { }); } - // Verses - if (results.verses && results.verses.length > 0) { - html += '
Verses
'; - results.verses.forEach(function(verse) { - currentResults.push(verse.url); - html += ''; - html += '
' + verse.reference + '
'; - html += '
' + verse.text + '
'; - html += '
'; - }); - } - // Topics if (results.topics && results.topics.length > 0) { html += '
Topics
'; @@ -347,6 +335,17 @@ document.addEventListener('DOMContentLoaded', function() { }); } + // Resources + if (results.resources && results.resources.length > 0) { + html += '
Resources
'; + results.resources.forEach(function(resource) { + currentResults.push(resource.url); + html += ''; + html += '
' + resource.name + '
'; + html += '
'; + }); + } + // Stories if (results.stories && results.stories.length > 0) { html += '
Stories
'; @@ -357,6 +356,18 @@ document.addEventListener('DOMContentLoaded', function() { html += ''; }); } + + // Verses (at the end) + if (results.verses && results.verses.length > 0) { + html += '
Verses
'; + results.verses.forEach(function(verse) { + currentResults.push(verse.url); + html += ''; + html += '
' + verse.reference + '
'; + html += '
' + verse.text + '
'; + html += '
'; + }); + } } if (html) {