From 9353a3d5dbb51c2e736133b3ccd2fd238d2279f3 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Wed, 15 Jan 2020 15:52:42 +0100 Subject: [PATCH] Change corpus analyse ui --- app/corpora/forms.py | 4 +- app/templates/corpora/analyse_corpus.html.j2 | 116 ++++++++++--------- docker-compose.yml | 2 +- 3 files changed, 66 insertions(+), 56 deletions(-) diff --git a/app/corpora/forms.py b/app/corpora/forms.py index c06e3833..2612cf9f 100644 --- a/app/corpora/forms.py +++ b/app/corpora/forms.py @@ -50,8 +50,8 @@ class EditCorpusFileForm(FlaskForm): class QueryForm(FlaskForm): - query = TextAreaField('CQP Query', validators=[DataRequired(), - (Length(1, 1024))]) + query = StringField('CQP Query', + validators=[DataRequired(), Length(1, 1024)]) hits_per_page = SelectField('Hits per page', choices=[('', 'Nr. of hits per page'), ('10', '10'), diff --git a/app/templates/corpora/analyse_corpus.html.j2 b/app/templates/corpora/analyse_corpus.html.j2 index c1f20bc2..2325013c 100644 --- a/app/templates/corpora/analyse_corpus.html.j2 +++ b/app/templates/corpora/analyse_corpus.html.j2 @@ -36,57 +36,69 @@ } -
-
-
-
- {{ query_form.hidden_tag() }} - Query and analysis -
- {{ query_form.query(class='materialize-textarea') }} - {{ query_form.query.label }} - {% for error in query_form.query.errors %} - {{ error }} - {% endfor %} + +
+
+
+
+
+
+ search + {{ query_form.query() }} + {{ query_form.query.label }} + help CQP query language tutorial + {% for error in query_form.query.errors %} + {{ error }} + {% endfor %} +
+
+
+

 

+ +
- -

 

- Help -

CQP Query Language Tutorial

-

 

- Options -
- format_list_numbered - {{ query_form.hits_per_page() }} - {{ query_form.hits_per_page.label }} - {% for error in query_form.hits_per_page.errors %} - {{ error }} - {% endfor %} -
-
- short_text - {{ query_form.context() }} - {{ query_form.context.label }} - {% for error in query_form.context.errors %} - {{ error }} - {% endfor %} -
-
- -
- +
-
-
- Query Link -
- {{ query_download_form.hidden_tag() }} +
+
+
+
+ Options +
+ format_list_numbered + {{ query_form.hits_per_page() }} + {{ query_form.hits_per_page.label }} + {% for error in query_form.hits_per_page.errors %} + {{ error }} + {% endfor %} +
+
+ short_text + {{ query_form.context() }} + {{ query_form.context.label }} + {% for error in query_form.context.errors %} + {{ error }} + {% endfor %} +
+
+ +
+
+
+
+
+
+ +
+
+
+ Query Link Download Results

Downlaod all results of the current query as csv, excel or json file.

@@ -98,10 +110,9 @@ {% endfor %}
- +
-
@@ -116,11 +127,11 @@
-
+
Query Results - +
@@ -203,12 +214,11 @@ }) var queryFormElement = document.getElementById("query-form"); - var queryFormSubmitElement = document.getElementById("query-form-submit"); var queryResultsElement = document.getElementById("query-results"); var contextResultsElement = document.getElementById("context-results"); var queryLoadingElement = document.getElementById("getting-query-results"); var queryResultsTableElement = document.getElementById("recieved-query-results"); - queryFormSubmitElement.addEventListener("click", function(event) { + queryFormElement.addEventListener("submit", function(event) { event.preventDefault(); let formData = new FormData(queryFormElement); let queryData = {"context": formData.get("context"), diff --git a/docker-compose.yml b/docker-compose.yml index acc3e81e..3a055d3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: constraints: - node.role == manager environment: - - VIRTUAL_HOST=nopaque.localhost + - VIRTUAL_HOST=nopaque.localhost,129.70.216.233 env_file: nopaque.env image: gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:development volumes:
Title