summaryrefslogtreecommitdiff
path: root/searx/templates/simple/results.html
blob: 081118eaffbdaaaf5c7edfd5557d98db5919d909 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{% extends "simple/base.html" %}
{% from 'simple/macros.html' import icon, icon_small %}
{% block title %}{{ q|e }} - {% endblock %}
{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}&amp;pageno={{ pageno }}&amp;time_range={{ time_range }}&amp;language={{ current_language }}&amp;safesearch={{ safesearch }}&amp;format=rss">{% endblock %}
{% block content %}
<nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav>
{% include 'simple/search.html' %}
<div id="results">
    {% if answers %}
    <div id="answers"><h4 class="title">{{ _('Answers') }} : </h4>
        {% for answer in answers -%}
        <div class="answer">{{ answer }}</div>
        {%- endfor %}
    </div>
    {% endif %}

    <div id="sidebar">

        {% if number_of_results != '0' -%}
        <p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
        {%- endif %}

        {% if unresponsive_engines and results|length >= 1 %}
	<div class="dialog-error" role="alert">
	  <p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results') }}:</p>
	  <p>{% for engine_name, error_type in unresponsive_engines %}
	  {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
	  {% endfor %}</p>
	</div>
	{% endif %}

        {% if infoboxes %}
        <div id="infoboxes">
	         {% for infobox in infoboxes %}
               {% include 'simple/infobox.html' %}
	         {% endfor %}
        </div>
        {% endif %}

        {% if suggestions %}
        <div id="suggestions">
	  <h4 class="title">{{ _('Suggestions') }} : </h4>
	  <div class="wrapper">
            {% for suggestion in suggestions %}
            <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
              <input type="hidden" name="q" value="{{ suggestion }}">
              <input type="hidden" name="language" value="{{ current_language }}">
              <input type="hidden" name="safesearch" value="{{ safesearch }}">
              <input type="hidden" name="theme" value="{{ theme }}">
              <input type="submit" class="suggestion" value="&bull; {{ suggestion }}">
            </form>
            {% endfor %}
	  </div>
        </div>
        {% endif %}

        <div id="search_url">
            <h4 class="title">{{ _('Search URL') }} :</h4>
            <div><pre>{{ base_url }}?q={{ q|urlencode }}&amp;language={{ current_language }}&amp;time_range={{ time_range }}&amp;safesearch={{ safesearch }}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}</pre></div>
        </div>
        <div id="apis">
          <h4 class="title">{{ _('Download results') }}</h4>
          {% for output_type in ('csv', 'json', 'rss') %}
	  <div class="left">
            <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
              <input type="hidden" name="q" value="{{ q|e }}">
              {% for category in selected_categories %}
              <input type="hidden" name="category_{{ category }}" value="1">
              {% endfor %}
              <input type="hidden" name="pageno" value="{{ pageno }}">
              <input type="hidden" name="time_range" value="{{ time_range }}">
              <input type="hidden" name="language" value="{{ current_language }}">
              <input type="hidden" name="safesearch" value="{{ safesearch }}">
              <input type="hidden" name="format" value="{{ output_type }}">
              <input type="submit" value="{{ output_type }}">
            </form>
	  </div>
          {% endfor %}
        </div>
    </div>

    {% if corrections %}
    <div id="corrections">
      <h4>{{ _('Try searching for:') }}</h4>
      {% for correction in corrections %}
      <div class="left">
	<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation">
          <input type="hidden" name="q" value="{{ correction }}">
          <input type="hidden" name="time_range" value="{{ time_range }}">
          <input type="hidden" name="language" value="{{ current_language }}">
          <input type="hidden" name="safesearch" value="{{ safesearch }}">
          <input type="hidden" name="theme" value="{{ theme }}">
          <input type="submit" value="{{ correction }}">
	</form>
      </div>
      {% endfor %}
    </div>
    {% endif %}

    <div id="urls">
    {% for result in results %}
        {% set index = loop.index %}
        {% if result['template'] %}
            {% include get_result_template('simple', result['template']) %}
        {% else %}
            {% include 'simple/result_templates/default.html' %}
        {% endif %}
    {% endfor %}
    {% if not results and not answers %}
        {% include 'simple/messages/no_results.html' %}
    {% endif %}
    </div>
    <div id="backToTop">
      <a href="#">{{ icon_small('chevron-up') }}</a>
    </div>
    {% if paging %}
    <nav id="pagination">
        {% if pageno > 1 %}
            <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
                <div class="{% if rtl %}right{% else %}left{% endif %}">
                  <input type="hidden" name="q" value="{{ q|e }}" >
                  {% for category in selected_categories %}
                  <input type="hidden" name="category_{{ category }}" value="1" >
                  {% endfor %}
                  <input type="hidden" name="pageno" value="{{ pageno-1 }}" >
                  <input type="hidden" name="time_range" value="{{ time_range }}" >
                  <input type="hidden" name="language" value="{{ current_language }}" >
                  <input type="hidden" name="safesearch" value="{{ safesearch }}" >
                  <input type="hidden" name="theme" value="{{ theme }}" >
		  <button type="submit">{{ icon_small('chevron-left') }} {{ _('previous page') }}</button>
                </div>
            </form>
        {% endif %}
        <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
            <div class="{% if rtl %}left{% else %}right{% endif %}">
              <input type="hidden" name="q" value="{{ q|e }}" >
              {% for category in selected_categories %}
              <input type="hidden" name="category_{{ category }}" value="1" >
              {% endfor %}
              <input type="hidden" name="pageno" value="{{ pageno+1 }}" >
              <input type="hidden" name="time_range" value="{{ time_range }}" >
              <input type="hidden" name="language" value="{{ current_language }}" >
              <input type="hidden" name="safesearch" value="{{ safesearch }}" >
              <input type="hidden" name="theme" value="{{ theme }}" >
	       <button type="submit">{{ _('next page') }} {{ icon_small('chevron-right') }}</button>
            </div>
        </form>
    </nav>
    {% endif %}
</div>
{% endblock %}