From 4d783492c00b4034a65483c83f0163ab517c7db7 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Tue, 3 Nov 2020 09:53:37 +0100
Subject: [PATCH] Add breadcrumbs to query_results package
---
web/app/corpora/views.py | 1 +
.../corpora/query_results/_breadcrumbs.html.j2 | 13 +++++++++++++
.../corpora/query_results/add_query_result.html.j2 | 4 ++++
.../templates/corpora/query_results/inspect.html.j2 | 4 ++++
.../corpora/query_results/query_result.html.j2 | 4 ++++
5 files changed, 26 insertions(+)
create mode 100644 web/app/templates/corpora/query_results/_breadcrumbs.html.j2
diff --git a/web/app/corpora/views.py b/web/app/corpora/views.py
index 44ba6a69..a6bef316 100644
--- a/web/app/corpora/views.py
+++ b/web/app/corpora/views.py
@@ -437,6 +437,7 @@ def inspect_query_result(query_result_id):
with open(query_result_file_path, 'r') as query_result_file:
query_result_file_content = json.load(query_result_file)
return render_template('corpora/query_results/inspect.html.j2',
+ query_result=query_result,
display_options_form=display_options_form,
inspect_display_options_form=inspect_display_options_form, # noqa
query_result_file_content=query_result_file_content,
diff --git a/web/app/templates/corpora/query_results/_breadcrumbs.html.j2 b/web/app/templates/corpora/query_results/_breadcrumbs.html.j2
new file mode 100644
index 00000000..77cfd57d
--- /dev/null
+++ b/web/app/templates/corpora/query_results/_breadcrumbs.html.j2
@@ -0,0 +1,13 @@
+
+ - home
+ - navigate_next
+ - My query results
+ - navigate_next
+ {% if request.path == url_for('.add_query_result') %}
+ - {{ title }}
+ {% elif request.path == url_for('.query_result', query_result_id=query_result.id) %}
+ - {{ query_result.title }}
+ {% elif request.path == url_for('.inspect_query_result', query_result_id=query_result.id) %}
+ - {{ title }}
+ {% endif %}
+
diff --git a/web/app/templates/corpora/query_results/add_query_result.html.j2 b/web/app/templates/corpora/query_results/add_query_result.html.j2
index 8765b5a2..97a83983 100644
--- a/web/app/templates/corpora/query_results/add_query_result.html.j2
+++ b/web/app/templates/corpora/query_results/add_query_result.html.j2
@@ -5,6 +5,10 @@
{% set scheme_primary_color = colors.corpus_analysis_darken %}
{% set scheme_secondary_color = colors.corpus_analysis %}
+{% block nav_content %}
+{% include 'corpora/query_results/_breadcrumbs.html.j2' %}
+{% endblock nav_content %}
+
{% block main_attribs %} class="corpus-analysis-color lighten"{% endblock main_attribs %}
{% block page_content %}
diff --git a/web/app/templates/corpora/query_results/inspect.html.j2 b/web/app/templates/corpora/query_results/inspect.html.j2
index 4bcf078b..252dd974 100644
--- a/web/app/templates/corpora/query_results/inspect.html.j2
+++ b/web/app/templates/corpora/query_results/inspect.html.j2
@@ -4,6 +4,10 @@
{% set scheme_primary_color = colors.corpus_analysis_darken %}
{% set scheme_secondary_color = colors.corpus_analysis %}
+{% block nav_content %}
+{% include 'corpora/query_results/_breadcrumbs.html.j2' %}
+{% endblock nav_content %}
+
{% block main_attribs %} class="corpus-analysis-color lighten"{% endblock main_attribs %}
{% block page_content %}
diff --git a/web/app/templates/corpora/query_results/query_result.html.j2 b/web/app/templates/corpora/query_results/query_result.html.j2
index 5936d9a4..24ce8978 100644
--- a/web/app/templates/corpora/query_results/query_result.html.j2
+++ b/web/app/templates/corpora/query_results/query_result.html.j2
@@ -4,6 +4,10 @@
{% set scheme_primary_color = colors.corpus_analysis_darken %}
{% set scheme_secondary_color = colors.corpus_analysis %}
+{% block nav_content %}
+{% include 'corpora/query_results/_breadcrumbs.html.j2' %}
+{% endblock nav_content %}
+
{% block main_attribs %} class="corpus-analysis-color lighten"{% endblock main_attribs %}
{% block page_content %}