mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Reorder search dropdown categories and add resources
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
|
||||
@@ -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 = '<div class="search-no-results">No results found</div>';
|
||||
} 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 += '<div class="search-results-category">';
|
||||
html += '<div class="search-results-category-title">' + (categoryLabels[category] || category) + '</div>';
|
||||
|
||||
@@ -1465,7 +1468,7 @@
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add "View all results" link
|
||||
html += '<a href="/search?q=' + encodeURIComponent(data.query) + '" class="search-view-all">View all verse results →</a>';
|
||||
|
||||
@@ -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 += '<div class="lookup-result-category">' + categoryLabels[cat] + '</div>';
|
||||
|
||||
@@ -324,18 +324,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
}
|
||||
|
||||
// Verses
|
||||
if (results.verses && results.verses.length > 0) {
|
||||
html += '<div class="search-result-category">Verses</div>';
|
||||
results.verses.forEach(function(verse) {
|
||||
currentResults.push(verse.url);
|
||||
html += '<a href="' + verse.url + '" class="search-result-item">';
|
||||
html += '<div class="search-result-title">' + verse.reference + '</div>';
|
||||
html += '<div class="search-result-subtitle">' + verse.text + '</div>';
|
||||
html += '</a>';
|
||||
});
|
||||
}
|
||||
|
||||
// Topics
|
||||
if (results.topics && results.topics.length > 0) {
|
||||
html += '<div class="search-result-category">Topics</div>';
|
||||
@@ -347,6 +335,17 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
}
|
||||
|
||||
// Resources
|
||||
if (results.resources && results.resources.length > 0) {
|
||||
html += '<div class="search-result-category">Resources</div>';
|
||||
results.resources.forEach(function(resource) {
|
||||
currentResults.push(resource.url);
|
||||
html += '<a href="' + resource.url + '" class="search-result-item">';
|
||||
html += '<div class="search-result-title">' + resource.name + '</div>';
|
||||
html += '</a>';
|
||||
});
|
||||
}
|
||||
|
||||
// Stories
|
||||
if (results.stories && results.stories.length > 0) {
|
||||
html += '<div class="search-result-category">Stories</div>';
|
||||
@@ -357,6 +356,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
html += '</a>';
|
||||
});
|
||||
}
|
||||
|
||||
// Verses (at the end)
|
||||
if (results.verses && results.verses.length > 0) {
|
||||
html += '<div class="search-result-category">Verses</div>';
|
||||
results.verses.forEach(function(verse) {
|
||||
currentResults.push(verse.url);
|
||||
html += '<a href="' + verse.url + '" class="search-result-item">';
|
||||
html += '<div class="search-result-title">' + verse.reference + '</div>';
|
||||
html += '<div class="search-result-subtitle">' + verse.text + '</div>';
|
||||
html += '</a>';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (html) {
|
||||
|
||||
Reference in New Issue
Block a user