diff --git a/web/app/query_results/views.py b/web/app/query_results/views.py index 70c879f0..8a2e0176 100644 --- a/web/app/query_results/views.py +++ b/web/app/query_results/views.py @@ -1,7 +1,7 @@ from . import query_results from . import tasks from .. import db -from ..corpora.forms import DisplayOptionsForm +from ..corpora.forms import DisplayOptionsForm, InspectDisplayOptionsForm from ..models import QueryResult from .forms import AddQueryResultForm from flask import (abort, current_app, flash, make_response, redirect, @@ -101,6 +101,9 @@ def inspect_query_result(query_result_id): results_per_page=request.args.get('results_per_page', 30), result_context=request.args.get('context', 20) ) + inspect_display_options_form = InspectDisplayOptionsForm( + prefix='inspect-display-options-form' + ) query_result_file_path = os.path.join( current_app.config['NOPAQUE_STORAGE'], str(current_user.id), @@ -109,10 +112,11 @@ def inspect_query_result(query_result_id): query_result.filename ) with open(query_result_file_path, 'r') as query_result_file: - query_result_content = json.load(query_result_file) - return render_template('query_results/inspect_query_result.html.j2', + query_result_file_content = json.load(query_result_file) + return render_template('query_results/inspect.html.j2', display_options_form=display_options_form, - query_result_content=query_result_content, + inspect_display_options_form=inspect_display_options_form, + query_result_file_content=query_result_file_content, title='Inspect query result') diff --git a/web/app/static/js/nopaque.lists.js b/web/app/static/js/nopaque.lists.js index eaf0f2e7..c7ec8fa8 100644 --- a/web/app/static/js/nopaque.lists.js +++ b/web/app/static/js/nopaque.lists.js @@ -120,6 +120,7 @@ RessourceList.dataMapper = { QueryResult: query_result => ({corpus_name: query_result.query_metadata.corpus_name, description: query_result.description, id: query_result.id, + "inspect-link": `/query_results/${query_result.id}/inspect`, link: `/query_results/${query_result.id}`, query: query_result.query_metadata.query, title: query_result.title}), @@ -261,6 +262,9 @@ RessourceList.options = {