results.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. {% extends "simple/base.html" %}
  2. {% from 'simple/macros.html' import icon, icon_small %}
  3. {% block title %}{{ q|e }} - {% endblock %}
  4. {% 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 %}
  5. {% block content %}
  6. <nav id="linkto_preferences"><a href="{{ url_for('preferences') }}">{{ icon('navicon-round') }}</a></nav>
  7. {% include 'simple/search.html' %}
  8. <div id="results">
  9. {% if answers %}
  10. <div id="answers"><h4 class="title">{{ _('Answers') }} : </h4>
  11. {% for answer in answers -%}
  12. <div class="answer">{{ answer }}</div>
  13. {%- endfor %}
  14. </div>
  15. {% endif %}
  16. <div id="sidebar">
  17. {% if number_of_results != '0' -%}
  18. <p id="result_count"><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
  19. {%- endif %}
  20. {% if unresponsive_engines and results|length >= 1 %}
  21. <div class="dialog-error" role="alert">
  22. <p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results') }}:</p>
  23. <p>{% for engine_name, error_type in unresponsive_engines %}
  24. {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
  25. {% endfor %}</p>
  26. </div>
  27. {% endif %}
  28. {% if infoboxes %}
  29. <div id="infoboxes">
  30. {% for infobox in infoboxes %}
  31. {% include 'simple/infobox.html' %}
  32. {% endfor %}
  33. </div>
  34. {% endif %}
  35. {% if suggestions %}
  36. <div id="suggestions">
  37. <h4 class="title">{{ _('Suggestions') }} : </h4>
  38. <div class="wrapper">
  39. {% for suggestion in suggestions %}
  40. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  41. <input type="hidden" name="q" value="{{ suggestion }}">
  42. <input type="hidden" name="language" value="{{ current_language }}">
  43. <input type="hidden" name="safesearch" value="{{ safesearch }}">
  44. <input type="hidden" name="theme" value="{{ theme }}">
  45. <input type="submit" class="suggestion" value="&bull; {{ suggestion }}">
  46. </form>
  47. {% endfor %}
  48. </div>
  49. </div>
  50. {% endif %}
  51. <div id="search_url">
  52. <h4 class="title">{{ _('Search URL') }} :</h4>
  53. <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>
  54. </div>
  55. <div id="apis">
  56. <h4 class="title">{{ _('Download results') }}</h4>
  57. {% for output_type in ('csv', 'json', 'rss') %}
  58. <div class="left">
  59. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  60. <input type="hidden" name="q" value="{{ q|e }}">
  61. {% for category in selected_categories %}
  62. <input type="hidden" name="category_{{ category }}" value="1">
  63. {% endfor %}
  64. <input type="hidden" name="pageno" value="{{ pageno }}">
  65. <input type="hidden" name="time_range" value="{{ time_range }}">
  66. <input type="hidden" name="language" value="{{ current_language }}">
  67. <input type="hidden" name="safesearch" value="{{ safesearch }}">
  68. <input type="hidden" name="format" value="{{ output_type }}">
  69. <input type="submit" value="{{ output_type }}">
  70. </form>
  71. </div>
  72. {% endfor %}
  73. </div>
  74. </div>
  75. {% if corrections %}
  76. <div id="corrections">
  77. <h4>{{ _('Try searching for:') }}</h4>
  78. {% for correction in corrections %}
  79. <div class="left">
  80. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation">
  81. <input type="hidden" name="q" value="{{ correction }}">
  82. <input type="hidden" name="time_range" value="{{ time_range }}">
  83. <input type="hidden" name="language" value="{{ current_language }}">
  84. <input type="hidden" name="safesearch" value="{{ safesearch }}">
  85. <input type="hidden" name="theme" value="{{ theme }}">
  86. <input type="submit" value="{{ correction }}">
  87. </form>
  88. </div>
  89. {% endfor %}
  90. </div>
  91. {% endif %}
  92. <div id="urls">
  93. {% for result in results %}
  94. {% set index = loop.index %}
  95. {% if result['template'] %}
  96. {% include get_result_template('simple', result['template']) %}
  97. {% else %}
  98. {% include 'simple/result_templates/default.html' %}
  99. {% endif %}
  100. {% endfor %}
  101. {% if not results and not answers %}
  102. {% include 'simple/messages/no_results.html' %}
  103. {% endif %}
  104. </div>
  105. <div id="backToTop">
  106. <a href="#">{{ icon_small('chevron-up') }}</a>
  107. </div>
  108. {% if paging %}
  109. <nav id="pagination">
  110. {% if pageno > 1 %}
  111. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  112. <div class="{% if rtl %}right{% else %}left{% endif %}">
  113. <input type="hidden" name="q" value="{{ q|e }}" >
  114. {% for category in selected_categories %}
  115. <input type="hidden" name="category_{{ category }}" value="1" >
  116. {% endfor %}
  117. <input type="hidden" name="pageno" value="{{ pageno-1 }}" >
  118. <input type="hidden" name="time_range" value="{{ time_range }}" >
  119. <input type="hidden" name="language" value="{{ current_language }}" >
  120. <input type="hidden" name="safesearch" value="{{ safesearch }}" >
  121. <input type="hidden" name="theme" value="{{ theme }}" >
  122. <button type="submit">{{ icon_small('chevron-left') }} {{ _('previous page') }}</button>
  123. </div>
  124. </form>
  125. {% endif %}
  126. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  127. <div class="{% if rtl %}left{% else %}right{% endif %}">
  128. <input type="hidden" name="q" value="{{ q|e }}" >
  129. {% for category in selected_categories %}
  130. <input type="hidden" name="category_{{ category }}" value="1" >
  131. {% endfor %}
  132. <input type="hidden" name="pageno" value="{{ pageno+1 }}" >
  133. <input type="hidden" name="time_range" value="{{ time_range }}" >
  134. <input type="hidden" name="language" value="{{ current_language }}" >
  135. <input type="hidden" name="safesearch" value="{{ safesearch }}" >
  136. <input type="hidden" name="theme" value="{{ theme }}" >
  137. <button type="submit">{{ _('next page') }} {{ icon_small('chevron-right') }}</button>
  138. </div>
  139. </form>
  140. </nav>
  141. {% endif %}
  142. </div>
  143. {% endblock %}