results.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 }}">{% 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. <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
  40. </form>
  41. </div>
  42. <div class="pull-right">
  43. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  44. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
  45. <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
  46. <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
  47. </form>
  48. </div>
  49. </div><!-- /#pagination -->
  50. <div class="clearfix"></div>
  51. {% else %}
  52. <div id="pagination">
  53. <div class="pull-left">
  54. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  55. <input type="hidden" name="q" value="{{ q }}" />
  56. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
  57. <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
  58. <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
  59. </form>
  60. </div>
  61. <div class="pull-right">
  62. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  63. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
  64. <input type="hidden" name="q" value="{{ q }}" />
  65. <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
  66. <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
  67. </form>
  68. </div>
  69. </div><!-- /#pagination -->
  70. <div class="clearfix"></div>
  71. {% endif %}
  72. {% endif %}
  73. </div><!-- /#main_results -->
  74. <div class="col-sm-4" id="sidebar_results">
  75. {% if infoboxes %}
  76. {% for infobox in infoboxes %}
  77. {% include 'oscar/infobox.html' %}
  78. {% endfor %}
  79. {% endif %}
  80. {% if suggestions %}
  81. <div class="panel panel-default">
  82. <div class="panel-heading">
  83. <h4 class="panel-title">{{ _('Suggestions') }}</h4>
  84. </div>
  85. <div class="panel-body">
  86. {% for suggestion in suggestions %}
  87. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
  88. <input type="hidden" name="q" value="{{ suggestion }}">
  89. <button type="submit" class="btn btn-default btn-xs">{{ suggestion }}</button>
  90. </form>
  91. {% endfor %}
  92. </div>
  93. </div>
  94. {% endif %}
  95. <div class="panel panel-default">
  96. <div class="panel-heading">
  97. <h4 class="panel-title">{{ _('Links') }}</h4>
  98. </div>
  99. <div class="panel-body">
  100. <form role="form">
  101. <div class="form-group">
  102. <label for="search_url">{{ _('Search URL') }}</label>
  103. <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 %}" readonly>
  104. </div>
  105. </form>
  106. <label>{{ _('Download results') }}</label>
  107. <div class="clearfix"></div>
  108. {% for output_type in ('csv', 'json', 'rss') %}
  109. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
  110. <input type="hidden" name="q" value="{{ q }}">
  111. <input type="hidden" name="format" value="{{ output_type }}">
  112. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1">{% endfor %}
  113. <input type="hidden" name="pageno" value="{{ pageno }}">
  114. <button type="submit" class="btn btn-default">{{ output_type }}</button>
  115. </form>
  116. {% endfor %}
  117. <div class="clearfix"></div>
  118. </div>
  119. </div>
  120. </div><!-- /#sidebar_results -->
  121. </div>
  122. {% endblock %}