diff --git a/app/corpora/forms.py b/app/corpora/forms.py index 939f491c..82745e76 100644 --- a/app/corpora/forms.py +++ b/app/corpora/forms.py @@ -85,6 +85,24 @@ class DisplayOptionsForm(FlaskForm): ('100', '100')]) +class InspectDisplayOptionsForm(FlaskForm): + expert_mode_inspect = BooleanField('Expert mode') + highlight_sentences = BooleanField('Highlight sentences') + context_sentences = SelectField('Context sentences', + choices=[('', 'Choose your option'), + ('1', '1'), + ('2', '2'), + ('3', '3'), + ('4', '4'), + ('5', '5'), + ('6', '6'), + ('7', '7'), + ('8', '8'), + ('9', '9'), + ('10', '10')], + default=3) + + class QueryDownloadForm(FlaskForm): file_type = SelectField('File type', choices=[('', 'Choose file type'), diff --git a/app/corpora/views.py b/app/corpora/views.py index 6870fec2..1a220499 100644 --- a/app/corpora/views.py +++ b/app/corpora/views.py @@ -7,7 +7,8 @@ from . import corpora from .background_functions import (delete_corpus_, delete_corpus_file_, edit_corpus_file_) from .forms import (AddCorpusFileForm, AddCorpusForm, EditCorpusFileForm, - QueryDownloadForm, QueryForm, DisplayOptionsForm) + QueryDownloadForm, QueryForm, DisplayOptionsForm, + InspectDisplayOptionsForm) from .. import db from ..models import Corpus, CorpusFile import os @@ -62,11 +63,13 @@ def analyse_corpus(corpus_id): query_form = QueryForm(prefix='query-form', query=request.args.get('query')) query_download_form = QueryDownloadForm() + inspect_display_options_form = InspectDisplayOptionsForm() return render_template('corpora/analyse_corpus.html.j2', corpus_id=corpus_id, display_options_form=display_options_form, query_form=query_form, query_download_form=query_download_form, + inspect_display_options_form=inspect_display_options_form, title='Corpus analysis') diff --git a/app/templates/corpora/analyse_corpus.html.j2 b/app/templates/corpora/analyse_corpus.html.j2 index 77ca8874..bbd9fa31 100644 --- a/app/templates/corpora/analyse_corpus.html.j2 +++ b/app/templates/corpora/analyse_corpus.html.j2 @@ -198,9 +198,44 @@