logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

results.html (8214B)


  1. {% extends "oscar/base.html" %}
  2. {% macro search_form_attrs(pageno) -%}
  3. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
  4. <input type="hidden" name="q" value="{{ q|e }}" />
  5. <input type="hidden" name="pageno" value="{{ pageno }}" />
  6. <input type="hidden" name="time_range" value="{{ time_range }}" />
  7. <input type="hidden" name="language" value="{{ current_language }}" />
  8. {%- endmacro %}
  9. {%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if time_range %}&amp;time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&amp;language={{ current_language }}{% endif %}{% endmacro -%}
  10. {% block title %}{{ q|e }} - {% endblock %}
  11. {% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q|e }}" href="{{ search_url() }}&amp;format=rss">{% endblock %}
  12. {% block content %}
  13. {% include 'oscar/search.html' %}
  14. <div class="row">
  15. <div class="col-sm-8" id="main_results">
  16. <h1 class="sr-only">{{ _('Search results') }}</h1>
  17. {% if corrections %}
  18. <div class="result">
  19. <span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
  20. {% for correction in corrections %}
  21. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">
  22. <input type="hidden" name="q" value="{{ correction }}">
  23. <button type="submit" class="btn btn-default btn-xs">{{ correction }}</button>
  24. </form>
  25. {% endfor %}
  26. </div>
  27. {% endif %}
  28. {% if answers %}
  29. {% for answer in answers %}
  30. <div class="result well">
  31. <span>{{ answer }}</span>
  32. </div>
  33. {% endfor %}
  34. {% endif %}
  35. {% for result in results %}
  36. <div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
  37. {% set index = loop.index %}
  38. {% if result.template %}
  39. {% include get_result_template('oscar', result['template']) %}
  40. {% else %}
  41. {% include 'oscar/result_templates/default.html' %}
  42. {% endif %}
  43. </div>
  44. {% endfor %}
  45. {% if not results and not answers %}
  46. {% include 'oscar/messages/no_results.html' %}
  47. {% endif %}
  48. <div class="clearfix"></div>
  49. {% if paging %}
  50. {% if rtl %}
  51. <div id="pagination">
  52. <div class="pull-left">
  53. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  54. {{ search_form_attrs(pageno+1) }}
  55. <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
  56. </form>
  57. </div>
  58. <div class="pull-right">
  59. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  60. {{ search_form_attrs(pageno-1) }}
  61. <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
  62. </form>
  63. </div>
  64. </div><!-- /#pagination -->
  65. <div class="clearfix"></div>
  66. {% else %}
  67. <div id="pagination">
  68. <div class="pull-left">
  69. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  70. {{ search_form_attrs(pageno-1) }}
  71. <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
  72. </form>
  73. </div>
  74. <div class="pull-right">
  75. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  76. {{ search_form_attrs(pageno+1) }}
  77. <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
  78. </form>
  79. </div>
  80. </div><!-- /#pagination -->
  81. <div class="clearfix"></div>
  82. {% endif %}
  83. {% endif %}
  84. </div><!-- /#main_results -->
  85. <div class="col-sm-4" id="sidebar_results">
  86. {% if number_of_results != '0' %}
  87. <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
  88. {% endif %}
  89. {% if unresponsive_engines and results|length >= 1 %}
  90. <div class="alert alert-danger fade in" role="alert">
  91. <p>{{ _('Engines cannot retrieve results') }}:</p>
  92. {% for engine_name, error_type in unresponsive_engines %}
  93. {{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
  94. {% endfor %}
  95. </div>
  96. {% endif %}
  97. {% if infoboxes %}
  98. {% for infobox in infoboxes %}
  99. {% include 'oscar/infobox.html' %}
  100. {% endfor %}
  101. {% endif %}
  102. {% if suggestions %}
  103. <div class="panel panel-default">
  104. <div class="panel-heading">
  105. <h4 class="panel-title">{{ _('Suggestions') }}</h4>
  106. </div>
  107. <div class="panel-body">
  108. {% for suggestion in suggestions %}
  109. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
  110. <input type="hidden" name="q" value="{{ suggestion }}">
  111. <button type="submit" class="btn btn-default btn-xs">{{ suggestion }}</button>
  112. </form>
  113. {% endfor %}
  114. </div>
  115. </div>
  116. {% endif %}
  117. <div class="panel panel-default">
  118. <div class="panel-heading">
  119. <h4 class="panel-title">{{ _('Links') }}</h4>
  120. </div>
  121. <div class="panel-body">
  122. <form role="form">
  123. <div class="form-group">
  124. <label for="search_url">{{ _('Search URL') }}</label>
  125. <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>
  126. </div>
  127. </form>
  128. <label>{{ _('Download results') }}</label>
  129. <div class="clearfix"></div>
  130. {% for output_type in ('csv', 'json', 'rss') %}
  131. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
  132. {{ search_form_attrs(pageno) }}
  133. <input type="hidden" name="format" value="{{ output_type }}">
  134. <button type="submit" class="btn btn-default">{{ output_type }}</button>
  135. </form>
  136. {% endfor %}
  137. <div class="clearfix"></div>
  138. </div>
  139. </div>
  140. </div><!-- /#sidebar_results -->
  141. </div>
  142. {% endblock %}