summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/widgets/search_input.html
blob: a1e5aa2e420a96db37a2f2575b4d27a42fb25e09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{% load i18n %}<div class="input-group search-widget">
    <span class="input-group-prepend">
      <span class="input-group-text">
         <i class="fa fa-search" aria-hidden="true"></i>
      </span>
    </span>
    <input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget.value|stringformat:'s' }}"{% endif %}{% include "django/forms/widgets/attrs.html" %} />
    <span class="input-group-append">
        <button type="button" class="btn btn-secondary" data-toggle="modal"
                data-target="#modal-advanced-search">
            <i class="fa fa-cogs" aria-hidden="true"></i>
        </button>
    </span>
    <span class="input-group-append">
      <span class="input-group-text clear-search">
        <i class="fa fa-times" aria-hidden="true"></i>
      </span>
    </span>
</div>

<script type="text/javascript">
$(document).ready(function(){
    $(".search-widget input").keypress(function(e) {
        if(e.which == 13) {
            $(".search-widget").parents(
                '.search').find("p > .btn-primary").click();
            $(this).focus();
        }
    });
});
</script>