From b6313e2dc4b6a08903185e3af841cff742080a74 Mon Sep 17 00:00:00 2001 From: crunk Date: Sat, 29 Jun 2024 15:41:31 +0200 Subject: [PATCH] clickable link in search results --- verse/search/search.py | 3 ++- verse/search/templates/search/search.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/verse/search/search.py b/verse/search/search.py index 8628da2..d38a0e6 100644 --- a/verse/search/search.py +++ b/verse/search/search.py @@ -15,6 +15,7 @@ searchpages = Blueprint( SCRIPT_DIR = os.path.dirname(__file__) SEARCH_DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "searchdata")) + @searchpages.route("/", methods=["GET", "POST"]) def searchpage(): searchform = SearchForm() @@ -31,7 +32,7 @@ def searchpage(): def search(searchinput): """search and get search result titles and return them as distribusi ids""" - ix = open_dir(SEARCH_DATA_DIRgi) + ix = open_dir(SEARCH_DATA_DIR) with ix.searcher() as searcher: query = QueryParser("content", ix.schema).parse(searchinput) search_results = searcher.search(query) diff --git a/verse/search/templates/search/search.html b/verse/search/templates/search/search.html index a4261cc..709b965 100644 --- a/verse/search/templates/search/search.html +++ b/verse/search/templates/search/search.html @@ -15,8 +15,8 @@
- {% for found_distribusis in found_distribusis %} -

{{found_distribusis}}

+ {% for found_distribusi in found_distribusis %} + {{found_distribusi}} {% endfor %}