diff --git a/cce_search/search.py b/cce_search/search.py index cae6273..297ba32 100644 --- a/cce_search/search.py +++ b/cce_search/search.py @@ -12,25 +12,28 @@ bp = Blueprint('search', __name__) @bp.route('/') def index(): results = None - term = None + title = None paging=None search_type = "ft" print("TEST HERE") print(request.args) + print(request.args.get("title")) print(request.method) print("DONE PRINTING") title = request.form.get('title') print(title) print("----------------------------------------------------------") - if request.args: - term = request.args['title'] - response = search(request.args['type'], request.args.get('page'), + if request.args.get("title"): + title = request.args['title'] + response = search(request.args['title'], request.args.get('page'), request.args.get('per_page')) paging = proc_pagination(response['data']['paging'], request.args.get('page')) + results = proc_results(response) + print(results) return render_template('base.html', title=title) @@ -41,7 +44,7 @@ def proc_results(r): def enhance_results(r): - if r.get('type') == 'renewal': + if r.get('title') == 'renewal': return r return {**r, **{'original': strip_tags(r.get('xml')), diff --git a/cce_search/templates/base.html b/cce_search/templates/base.html index 650941a..612b32e 100644 --- a/cce_search/templates/base.html +++ b/cce_search/templates/base.html @@ -52,11 +52,11 @@

Search for copyright registrations and renewals on books from the Catalog of Copyright Entries.

Find a book:

-
-
-
-
-
+
+
+
+
+