diff --git a/web/app/corpora/views.py b/web/app/corpora/views.py index 3f1bb8d8..7b0355e1 100644 --- a/web/app/corpora/views.py +++ b/web/app/corpora/views.py @@ -76,6 +76,7 @@ def analyse_corpus(corpus_id): prefix='inspect-display-options-form') return render_template( 'corpora/analyse_corpus.html.j2', + corpus=corpus, corpus_id=corpus_id, display_options_form=display_options_form, query_form=query_form, diff --git a/web/app/templates/corpora/analyse_corpus.html.j2 b/web/app/templates/corpora/analyse_corpus.html.j2 index c3d98d1f..7623331e 100644 --- a/web/app/templates/corpora/analyse_corpus.html.j2 +++ b/web/app/templates/corpora/analyse_corpus.html.j2 @@ -41,173 +41,202 @@
-
-
-
-
-
Infos
-
-
-

- - of - - matches loaded. -
- Matches occured in - - corpus files: -
- -

-

- help - The Server is still sending your results. - Functions like "Export Results" and "Match Inspect" will be - available after all matches have been loaded. -

-
-
-
-
+
+
+
Infos
+
+
+
+
-
-
-
-
-
Export
-
-
-
- - -
-
- - -
-
-
-
-
Create
-
-
-
-
- Sub-Results creation: - -
-
-
-
-

matches marked - for Sub-Results:

- -
-
-
-
-
-
Display
-
-
-
-
- {{ M.render_field(display_options_form.results_per_page, - material_icon='format_list_numbered') }} - {{ M.render_field(display_options_form.result_context, - material_icon='short_text') }} - {{ M.render_field(display_options_form.expert_mode) }} -
-
-
-
-
-
Analysis
-
-
-
- -
-
- -
-
+
+

+ + of + + matches loaded. +
+ Matches occured in + + corpus files: +
+ +

+

+ help + The Server is still sending your results. + Functions like "Export Results" and "Match Inspect" will be + available after all matches have been loaded. +

+
+
- -
-
    - - - - - - - - - - - - - -
    Nr.TitleLeft contextMatchActionsRight Context
    -
      +
      +
      Export
      +
      +
      +
      + + +
      +
      + + +
      +
      +
      +
      Create
      +
      +
      +
      +
      + Sub-Results creation: + +
      +
      +
      +
      +

      matches marked + for Sub-Results:

      + +
      +
      +
      +
      +
      +
      Display
      +
      +
      +
      +
      + {{ M.render_field(display_options_form.results_per_page, + material_icon='format_list_numbered') }} + {{ M.render_field(display_options_form.result_context, + material_icon='short_text') }} + {{ M.render_field(display_options_form.expert_mode) }} +
      +
      +
      +
      +
      +
      Analysis
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
      +
      Cite Nopaque
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
        + + + + + + + + + + + + + +
        Nr.TitleLeft contextMatchActionsRight Context
        +
          @@ -391,6 +420,7 @@ var textLookupCountElement // Nr of texts the matches occured in will be shown in this element var textTitlesElement; // matched text titles var nrMarkedMatches; // count of matches marked for subresults + var showMetadataButton; // Button to show corpus metadata // ###### Defining local scope variables ###### let contextPerItemElement; // Form Element for display option @@ -439,6 +469,7 @@ textLookupCountElement = document.getElementById("text-lookup-count"); textTitlesElement = document.getElementById("text-titles"); nrMarkedMatches = document.getElementById("nr-marked-matches"); + showMetadataButton = document.getElementById("show-metadata"); // ###### js list options and intialization ###### displayOptionsData = ResultsList.getDisplayOptions(displayOptionsFormElement); @@ -588,8 +619,12 @@ }); - // ### Download events and sub-results creation ### + // ### Show corpus Metadata + showMetadataButton.onclick = () => { + console.log("click"); + } + // ### Download events and sub-results creation ### var loadingSpinnerHTML = `
          diff --git a/web/app/templates/macros/query_result_macro.html.j2 b/web/app/templates/macros/query_result_macro.html.j2 new file mode 100644 index 00000000..fce05db3 --- /dev/null +++ b/web/app/templates/macros/query_result_macro.html.j2 @@ -0,0 +1,109 @@ +{% macro show_metadata(query_metadata) %} +
          +

          Below the metadata for the results from the Corpus + {{ query_metadata.corpus_name }} generated with the query + {{ query_metadata.query }} are shown. +

          + +
          + +
          +
          +
          + + + + + + + + + {% for pair in query_metadata|dictsort %} + + + {% if pair[0] == 'corpus_all_texts' + or pair[0] == 'text_lookup' %} + + {% else %} + + {% endif %} + + {% endfor %} + +
          Metadata DescriptionValue
          {{ pair[0] }} + + {% for key, value in pair[1].items() %} + + + + {% endfor %} +
          + {{ value['title'] }} written + by {{ value['author'] }} + in {{ value['publishing_year'] }} + More + + info_outline + + +
          +
          {{ pair[1] }}
          +
          +
          +
          + + + + + \ No newline at end of file