results.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 %}
  27. {% include 'oscar/messages/no_results.html' %}
  28. {% endif %}
  29. <div class="clearfix"></div>
  30. {% if paging %}
  31. <div id="pagination">
  32. <div class="pull-left">
  33. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  34. <input type="hidden" name="q" value="{{ q }}" />
  35. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
  36. <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
  37. <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
  38. </form>
  39. </div>
  40. <div class="pull-right">
  41. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
  42. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
  43. <input type="hidden" name="q" value="{{ q }}" />
  44. <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
  45. <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
  46. </form>
  47. </div>
  48. </div><!-- /#pagination -->
  49. <div class="clearfix"></div>
  50. {% endif %}
  51. </div><!-- /#main_results -->
  52. <div class="col-sm-4" id="sidebar_results">
  53. {% if infoboxes %}
  54. {% for infobox in infoboxes %}
  55. {% include 'oscar/infobox.html' %}
  56. {% endfor %}
  57. {% endif %}
  58. {% if suggestions %}
  59. <div class="panel panel-default">
  60. <div class="panel-heading">
  61. <h4 class="panel-title">{{ _('Suggestions') }}</h4>
  62. </div>
  63. <div class="panel-body">
  64. {% for suggestion in suggestions %}
  65. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">
  66. <input type="hidden" name="q" value="{{ suggestion }}">
  67. <button type="submit" class="btn btn-default btn-xs">{{ suggestion }}</button>
  68. </form>
  69. {% endfor %}
  70. </div>
  71. </div>
  72. {% endif %}
  73. <div class="panel panel-default">
  74. <div class="panel-heading">
  75. <h4 class="panel-title">{{ _('Links') }}</h4>
  76. </div>
  77. <div class="panel-body">
  78. <form role="form">
  79. <div class="form-group">
  80. <label for="search_url">{{ _('Search URL') }}</label>
  81. <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ base_url }}?q={{ q|urlencode }}&amp;pageno={{ pageno }}{% if selected_categories %}&amp;category_{{ selected_categories|join("&category_")|replace(' ','+') }}{% endif %}" readonly>
  82. </div>
  83. </form>
  84. <label>{{ _('Download results') }}</label>
  85. <div class="clearfix"></div>
  86. {% for output_type in ('csv', 'json', 'rss') %}
  87. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-left result_download">
  88. <input type="hidden" name="q" value="{{ q }}">
  89. <input type="hidden" name="format" value="{{ output_type }}">
  90. {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1">{% endfor %}
  91. <input type="hidden" name="pageno" value="{{ pageno }}">
  92. <button type="submit" class="btn btn-default">{{ output_type }}</button>
  93. </form>
  94. {% endfor %}
  95. <div class="clearfix"></div>
  96. </div>
  97. </div>
  98. </div><!-- /#sidebar_results -->
  99. </div>
  100. {% endblock %}