1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

Default to old search results view for advanced search

Use old results view if matchType or filter params are present in query
string.
This commit is contained in:
Tessa Walsh 2022-10-19 16:05:06 -04:00
parent 2ad7eaee4b
commit 373eca641c
2 changed files with 1119 additions and 4 deletions

1086
pywb/static/query.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,19 @@
{% block head %} {% block head %}
{{ super() }} {{ super() }}
{% if "filter=" in env['QUERY_STRING'] or "matchType=" in env['QUERY_STRING'] %}
<link rel="stylesheet" href="{{ static_prefix }}/css/query.css">
<script src="{{ static_prefix }}/js/url-polyfill.min.js"></script>
<script src="{{ static_prefix }}/query.js"></script>
{% else %}
<script src="{{ static_prefix }}/loading-spinner/loading-spinner.js"></script> <script src="{{ static_prefix }}/loading-spinner/loading-spinner.js"></script>
<script src="{{ static_prefix }}/vue/vueui.js"></script> <script src="{{ static_prefix }}/vue/vueui.js"></script>
{% endif %}
{% include 'vue_loc.html' %} {% include 'vue_loc.html' %}
{% endblock %} {% endblock %}
@ -17,8 +27,17 @@
{% block body %} {% block body %}
<div id="app" style="width: 100%; height: 100%"></div> {% if "filter=" in env['QUERY_STRING'] or "matchType=" in env['QUERY_STRING'] %}
<div class="container-fluid">
<div class="row justify-content-center">
<h4 class="display-4 text-center text-sm-left p-0">{{ _('Search Results') }}</h4>
</div>
</div>
<div class="container">
<div class="row justify-content-center text-center text-sm-left mt-1" id="display-query-type-info"></div>
</div>
<div class="container mt-3 q-display" id="captures"></div>
<script> <script>
var text = { var text = {
months: { months: {
@ -52,9 +71,19 @@
}, },
}; };
VueUI.main("{{ static_prefix }}", "{{ url }}", "{{ prefix }}", undefined, "{{ ui.logo }}", "{{ ui.navbar_background_hex | default('f8f9fa') }}", "{{ ui.navbar_color_hex | default('212529') }}", "{{ ui.navbar_light_buttons }}", "{{ env.pywb_lang | default('en') }}", var renderCal = new RenderCalendar({ prefix: "{{ prefix }}", staticPrefix: "{{ static_prefix }}", text: text });
allLocales, i18nStrings); renderCal.init();
</script> </script>
{% else %}
<div id="app" style="width: 100%; height: 100%"></div>
<script>
VueUI.main("{{ static_prefix }}", "{{ url }}", "{{ prefix }}", undefined, "{{ ui.logo }}", "{{ ui.navbar_background_hex | default('f8f9fa') }}", "{{ ui.navbar_color_hex | default('212529') }}", "{{ ui.navbar_light_buttons }}", "{{ env.pywb_lang | default('en') }}",
allLocales, i18nStrings);
</script>
{% endif %}
{% endblock %} {% endblock %}