Akron | ca9bd98 | 2016-12-06 16:59:57 +0100 | [diff] [blame^] | 1 | {% extends "base.html" %} |
| 2 | |
| 3 | {% block head %} |
| 4 | <script> |
| 5 | $("#prev").bind("click", function() { |
| 6 | elem = document.getElementbyId('prev'); |
| 7 | elem.value = elem.value-1; |
| 8 | console.log("the value"+elem.value); |
| 9 | |
| 10 | }); |
| 11 | |
| 12 | </script> |
| 13 | {% endblock %} |
| 14 | {% block content %} |
| 15 | |
| 16 | <h2>Query Analysis</h2> |
| 17 | <form class="form-inline" id="search_form" action="{{ url_for ('.search') }}" method="GET"> |
| 18 | <div class="form-group" style="width:50%;"> |
| 19 | <input type="text" style="width:100%;" class="form-control" name="q" required="" |
| 20 | placeholder="Query ..." |
| 21 | value="{% if q %} {{ q }} {% endif %}"> |
| 22 | </div> |
| 23 | <div class="form-group"> |
| 24 | <select name="ql" id="queryLanguage" style="margin:auto 5pt;" class="form-control"> |
| 25 | {% for key, value in lang.iteritems() %} |
| 26 | <option value="{{ key }}" |
| 27 | {% if ql== key %}selected="selected" {% endif %}>{{ value }} |
| 28 | </option> |
| 29 | {% endfor %} |
| 30 | </select> |
| 31 | </div> |
| 32 | <input type="hidden" id="page" value="1"> |
| 33 | <button type="submit" id="search" class="btn btn-sm btn-primary">Search |
| 34 | </button> |
| 35 | {% if result.matches %} |
| 36 | <ul class="pager"> |
| 37 | <li class="previous"> |
| 38 | <a id="prev" role="button">← Prev</a> |
| 39 | </li> |
| 40 | <li class="next"> |
| 41 | <a id="next" role="button">Next →</a> |
| 42 | </li> |
| 43 | </ul> |
| 44 | {% endif %} |
| 45 | </form> |
| 46 | {% include 'flash_messages.html' %} |
| 47 | {% if result %} |
| 48 | <p id="notification"> |
| 49 | <a href="#" id="show" style="font-weight:bold;text-align:right;" |
| 50 | title="Display raw JSON">Found {{ result.totalResults | default("0") }} matches</a> |
| 51 | </p> |
| 52 | {% autoescape off %} |
| 53 | <pre id="message" class="i-layout" style="display:none;"> |
| 54 | {{ result_string | safe }} |
| 55 | </pre> |
| 56 | {% for entry in result.matches %} |
| 57 | <div class="matches"> |
| 58 | {{ entry.snippet }} |
| 59 | </div> |
| 60 | {% endfor %} |
| 61 | {% endautoescape %} |
| 62 | {% endif %} |
| 63 | {% endblock %} |