Commit 8c305094 authored by felix.herrmann's avatar felix.herrmann
Browse files

fix(search): fix mirrored typing for search fields and switch search to intercooler Ajax calls

parent 44d52484
......@@ -39,12 +39,9 @@ function tagTypeahead(tagType, urlString){
* Mirrored typing for searching
*/
$(".search-top").keyup(function() {
$(".search-top").on("keyup change", function() {
$(".search-middle").val( this.value );
$(".queryfield").val( this.value );
});
$(".search-middle").keyup(function() {
$(".search-middle").on("keyup change", function() {
$(".search-top").val( this.value );
$(".queryfield").val( this.value );
});
\ No newline at end of file
......@@ -11,15 +11,15 @@
<h2>{% trans "Data Sets" %}</h2>
{# big search field #}
<div class="input-group mb-3 search-field-main">
<input class="form-control search-field-main search-middle"{% if query %}value="{{ query }}"{% else %}placeholder="Search"{% endif %} name="q" aria-label="Search">
<input class="form-control search-field-main search-middle search-data"{% if query %}value="{{ query }}"{% else %}placeholder="Search"{% endif %} name="q" aria-label="Search">
<div class="input-group-append">
<button class="input-group-text" type="button" ic-action="click" ic-action-target="#searchsubmit"><i class="fas fa-search"></i></button>
<button class="input-group-text" type="button" ic-include=".search-data" ic-get-from="{% url 'dddatasets:search' %}" ic-target="#content" ic-push-url="true" ic-push-params="q,countries,categories"><i class="fas fa-search"></i></button>
</div>
</div>
{# search object list #}
{% if object_list %}
<p>{{ object_list.paginator.count }} {% trans "Datasets found" %}</p>
<p>{% if object_list.paginator %}{{ object_list.paginator.count }}{% else %}{{ object_list.count }}{% endif %} {% trans "Datasets found" %}</p>
{% for object in object_list %}
{% include "dddatasets/_user_dataset.html" with dataset=object prep=False %}
{% endfor %}
......@@ -36,22 +36,17 @@
{# filters #}
<div class="col-md-3">
<form action="{% url 'dddatasets:search' %}">
{# hidden queryfield #}
<input class="queryfield" hidden {% if query %}value="{{ query }}"{% else %}placeholder="Search"{% endif %} name="q">
<input id="searchsubmit" type="submit" hidden />
<form class="search-data" action="{% url 'dddatasets:search' %}">
<h2>{% trans "Filters" %}</h2>
{# countries #}
{% include 'ddusers/_search_filter.html' with filters=countries filters_all=countries_all filtertype="countries" %}
{% include 'core/_search_filter.html' with filters=countries filters_all=countries_all filtertype="countries" %}
{# categories #}
{% include 'ddusers/_search_filter.html' with filters=categories filters_all=categories_all filtertype="categories" %}
{% include 'core/_search_filter.html' with filters=categories filters_all=categories_all filtertype="categories" %}
{# search_objects #}
{% include 'ddusers/_search_filter.html' with filters=search_index filters_all=search_index_all filtertype="search_index" %}
{# search_index #}
{% include 'core/_search_index.html' with filters=search_index filters_all=search_index_all filter_applied="dataset_index" %}
</form>
</div>
......
......@@ -25,15 +25,16 @@
<h2>{% trans "People on Discuss Data" %}</h2>
{# big search field #}
<div class="input-group mb-3 search-field-main">
<input class="form-control search-field-main search-middle"{% if query %}value="{{ query }}"{% else %}placeholder="Search"{% endif %} name="q" aria-label="Search">
<input class="form-control search-field-main search-middle search-data"{% if query %}value="{{ query }}"{% else %}placeholder="Search"{% endif %} name="q" aria-label="Search">
<div class="input-group-append">
<button class="input-group-text" type="button" ic-action="click" ic-action-target="#searchsubmit"><i class="fas fa-search"></i></button>
<button class="input-group-text" type="button" ic-include=".search-data" ic-get-from="{% url 'ddusers:search' %}" ic-target="#content" ic-push-url="true" ic-push-params="q,countries,categories"><i class="fas fa-search"></i></button>
</div>
</div>
{# search object list #}
{% if object_list %}
<p>{{ object_list.paginator.count }} {% trans "Discuss Data Users found" %}</p>
<p>{% if object_list.paginator %}{{ object_list.paginator.count }}{% else %}{{ object_list.count }}{% endif %} {% trans "Discuss Data Users found" %}</p>
{% for object in object_list %}
{% if search_type %}
{% include 'ddusers/_user_detail_card.html' with object=object image_url=objectimage.url dsid=ds.uuid cardtype=search_type %}
......@@ -54,23 +55,18 @@
{# filters #}
<div class="col-md-3">
<form action="{% url 'ddusers:search' %}">
{# hidden queryfield #}
<input class="queryfield" hidden {% if query %}value="{{ query }}"{% else %}placeholder="Search"{% endif %} name="q">
<input id="searchsubmit" type="submit" hidden />
<form class="search-data">
<h2>{% trans "Filters" %}</h2>
{# countries #}
{% include 'ddusers/_search_filter.html' with filters=countries filters_all=countries_all filtertype="countries" %}
{% include 'core/_search_filter.html' with filters=countries filters_all=countries_all filtertype="countries" %}
{# categories #}
{% include 'ddusers/_search_filter.html' with filters=categories filters_all=categories_all filtertype="categories" %}
{# search_objects #}
{% include 'ddusers/_search_filter.html' with filters=search_index filters_all=search_index_all filtertype="search_index" %}
{% include 'core/_search_filter.html' with filters=categories filters_all=categories_all filtertype="categories" %}
{# search_index #}
{% include 'core/_search_index.html' with filters=search_index filters_all=search_index_all filter_applied="user_index" %}
</form>
</div>
</div>
......
......@@ -9,9 +9,9 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="input-group w-25 mx-auto">
<input class="form-control search-top" type="text" {% if query %}value="{{ query }}" {% else %}placeholder="Search"{% endif %} name="q" aria-label="Search">
<input class="form-control search-top search-data" type="text" {% if query %}value="{{ query }}" {% else %}placeholder="Search"{% endif %} name="q" aria-label="Search">
<div class="input-group-append">
<button class="input-group-text" type="button" ic-action="click" ic-action-target="#searchsubmit" ic-include=".search-top" ic-push-url="true" ic-push-params="q" ic-get-from="{% url 'ddusers:search' %}" ic-target="#content"><i class="fas fa-search"></i></button>
<button class="input-group-text" type="button" ic-include=".search-data" ic-push-url="true" ic-push-params="q,countries,categories" ic-get-from="{% url 'ddusers:search' %}" ic-target="#content"><i class="fas fa-search"></i></button>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment