Skip to content

Commit

Permalink
chore: show current search
Browse files Browse the repository at this point in the history
  • Loading branch information
leggetter committed Sep 19, 2024
1 parent e910a50 commit 5c882eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def search_post():

app.logger.debug("Formatted search results", results)

return render_template("search.html", results=results)
return render_template("search.html", results=results, query=query)


@app.route("/process", methods=["POST"])
Expand Down Expand Up @@ -118,10 +118,6 @@ def process():

prediction = processor.process(url)

# print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
# print(prediction)
# print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")

client[Config.DB_NAME][Config.COLLECTION_NAME].update_one(
filter={"url": url},
update={
Expand Down
4 changes: 2 additions & 2 deletions templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
{% block content %}
<section>
<form action="/search" method="post" id="submit_form">
<input required type="text" name="query" placeholder="Enter your search query">
<input required type="text" name="query" placeholder="Enter your search query" value="{{ query }}">
<button type="submit">Submit</button>
</form>
</section>

<section>
{% if results %}
<h2>Results:</h2>
<h2>Results {% if query %}for "{{ query }}"{% endif %}:</h2>
<table>
<thead>
<tr>
Expand Down

0 comments on commit 5c882eb

Please sign in to comment.