From 9f1941958c54ba6f5144dcda0dfc43e7d74ed1fd Mon Sep 17 00:00:00 2001 From: b4-sharp <Bradley2.Sharp@live.uwe.ac.uk> Date: Fri, 14 Apr 2023 04:39:43 +0100 Subject: [PATCH] Update search to use items page --- store/routes.py | 2 +- store/templates/search.html | 53 ------------------------------------- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 store/templates/search.html diff --git a/store/routes.py b/store/routes.py index 87e95fc..35dda03 100644 --- a/store/routes.py +++ b/store/routes.py @@ -652,4 +652,4 @@ def search(): form = SearchForm() if form.validate_on_submit(): items = get_by_keyword(form.query.data) - return render_template("search.html", form=form, items=items) + return render_template("items.html", items=items) diff --git a/store/templates/search.html b/store/templates/search.html deleted file mode 100644 index d14da50..0000000 --- a/store/templates/search.html +++ /dev/null @@ -1,53 +0,0 @@ -{%extends 'base.html' %} -{% block title %} Search | Antiques Online {% endblock %} -{% block content %} -Searching for {{form.query.data}} -<style> - .grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); - grid-gap: 10px; - grid-auto-rows: minmax(100px, auto); - } - - .grid-item { - grid-row: span 1; - grid-column: span 1; - padding: 10px; - } - - .grid-item img { - max-width: 100%; - height: auto; - } - - .grid-item h2 { - margin: 10px 0; - font-size: 18px; - - } - - .grid-item p { - margin: 5px 0; - font-size: 14px; - } -</style> - -<div class="grid"> - {% if items %} - {% for item in items %} - <div class="grid-item"> - - <img src="static\image_placeholder.png" alt="{{ item.description }}"> - <h2>{{ item.description }}</h2> - <p>£{{ item.price }}</p> - <a href="{{url_for('item_page', item_id = item.id)}}">View - Details</a> - - </div> - {% endfor %} - {% else %} - <p>No items available</p> - {% endif %} -</div> -{% endblock %} \ No newline at end of file -- GitLab