results.html 8.4 KB

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