summaryrefslogtreecommitdiffstats
path: root/forum/skins/default/templates/input_bar.html
blob: 5923635022757af9a23bc89c96c52f3234600ccc (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% load i18n %}
{% load smart_if %}
{% if active_tab != "ask" %}
<div id="searchBar">
    {% comment %}url action depends on which tab is active{% endcomment %}
    <form 
        {% if active_tab == "tags" or active_tab == "users" %}
            action="{% url search %}" 
        {% else %}
            action="{% url questions %}" 
        {% endif %}
        method="get">
            {% comment %} class was searchInput {% endcomment %}
            <input 
                {% if query %}
                class="searchInputCancelable"
                {% else %}
                class="searchInput" 
                {% endif %}
                type="text" 
                value="{{ query|default_if_none:"" }}" 
                name="query" 
                id="keywords"/>
            {% if query %}{% comment %}query is only defined by questions view{% endcomment %}
            <input type="button" 
                value="x" 
                name="reset_query" 
                {% comment %}todo - make sure it works on Enter keypress{% endcomment %}
                onclick="window.location.href='{% url questions %}?reset_query=true'" 
                value="true" 
                class="cancelSearchBtn"/>
            {% endif %}
            <input type="submit" value="{% trans "search" %}" name="search" class="searchBtn" default />
            {% if active_tab == "tags" %}
                <input type="hidden" name="t" value="tag"/>
            {% else %}
                {% if active_tab == "users" %}
                    <input type="hidden" name="t" value="user"/>
                {% endif %}
            {% endif %}
    </form>
</div>
{% else %}
    {% include "ask_form.html" %}
{% endif %}