Akron | ca9bd98 | 2016-12-06 16:59:57 +0100 | [diff] [blame] | 1 | {% extends "base.html" %} |
| 2 | |
| 3 | {% block content %} |
| 4 | |
| 5 | <h2>Query Analysis</h2> |
| 6 | <form id="form-inline" action="{{ url_for ('search') }}" method="GET"> |
| 7 | <div class="form-group"> |
| 8 | <input type="text" class="form-control" name="q" required="" |
| 9 | placeholder="Query ..." |
| 10 | value="{% if q %} {{ q }} {% endif %}"> |
| 11 | </div> |
| 12 | <div class="form-group"> |
| 13 | <select name="ql" id="queryLanguage" style="margin:auto 5pt;"> |
| 14 | {% for key, value in lang.iteritems() %} |
| 15 | <option value="{{ key }}" |
| 16 | {% if ql== key %}selected="selected" {% endif %}>{{ value }} |
| 17 | </option> |
| 18 | {% endfor %} |
| 19 | </select> |
| 20 | </div> |
| 21 | <button type="submit" id="search" class="btn btn-primary">Search |
| 22 | </button> |
| 23 | |
| 24 | </form> |
| 25 | {% include 'flash_messages.html' %} |
| 26 | {% if result %} |
| 27 | <p id="notification"> |
| 28 | <a href="#" id="show" style="font-weight:bold;" |
| 29 | title="Display raw JSON">Found {{ result.totalResults | default("0") }} matches</a> |
| 30 | </p> |
| 31 | {% autoescape off %} |
| 32 | <pre id="message" class="i-layout" style="display:none;"> |
| 33 | {{ result_string | safe }} |
| 34 | </pre> |
| 35 | {% for entry in result.matches %} |
| 36 | <div class="matches"> |
| 37 | {{ entry.snippet }} |
| 38 | </div> |
| 39 | {% endfor %} |
| 40 | {% endautoescape %} |
| 41 | {% endif %} |
| 42 | {% endblock %} |