results.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {% extends "default/base.html" %}
  2. {% block title %}{{ q }} - {% endblock %}
  3. {% block content %}
  4. <div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div>
  5. <div class="small search center">
  6. {% include 'default/search.html' %}
  7. </div>
  8. <div id="results">
  9. <div id="sidebar">
  10. <div id="search_url">
  11. {{ _('Search URL') }}:
  12. <input type="text" value="{{ base_url }}?q={{ q|urlencode }}&pageno={{ pageno }}{% if selected_categories %}&category_{{ selected_categories|join("&category_") }}{% endif %}" readonly="" />
  13. </div>
  14. <div id="apis">
  15. {{ _('Download results') }}
  16. {% for output_type in ('csv', 'json', 'rss') %}
  17. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  18. <div class="left">
  19. <input type="hidden" name="q" value="{{ q }}" />
  20. <input type="hidden" name="format" value="{{ output_type }}" />
  21. {% for category in selected_categories %}
  22. <input type="hidden" name="category_{{ category }}" value="1"/>
  23. {% endfor %}
  24. <input type="hidden" name="pageno" value="{{ pageno }}" />
  25. <input type="submit" value="{{ output_type }}" />
  26. </div>
  27. </form>
  28. {% endfor %}
  29. </div>
  30. </div>
  31. {% if answers %}
  32. <div id="answers"><span>{{ _('Answers') }}</span>
  33. {% for answer in answers %}
  34. <span>{{ answer }}</span>
  35. {% endfor %}
  36. </div>
  37. {% endif %}
  38. {% if suggestions %}
  39. <div id="suggestions"><span>{{ _('Suggestions') }}</span>
  40. {% for suggestion in suggestions %}
  41. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  42. <input type="hidden" name="q" value="{{ suggestion }}">
  43. <input type="submit" value="{{ suggestion }}" />
  44. </form>
  45. {% endfor %}
  46. </div>
  47. {% endif %}
  48. {% if infoboxes %}
  49. <div id="infoboxes">
  50. {% for infobox in infoboxes %}
  51. {% include 'default/infobox.html' %}
  52. {% endfor %}
  53. </div>
  54. {% endif %}
  55. {% for result in results %}
  56. {% if result['template'] %}
  57. {% include 'default/result_templates/'+result['template'] %}
  58. {% else %}
  59. {% include 'default/result_templates/default.html' %}
  60. {% endif %}
  61. {% endfor %}
  62. {% if paging %}
  63. <div id="pagination">
  64. {% if pageno > 1 %}
  65. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  66. <div class="left">
  67. <input type="hidden" name="q" value="{{ q }}" />
  68. {% for category in selected_categories %}
  69. <input type="hidden" name="category_{{ category }}" value="1"/>
  70. {% endfor %}
  71. <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
  72. <input type="submit" value="<< {{ _('previous page') }}" />
  73. </div>
  74. </form>
  75. {% endif %}
  76. <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
  77. <div class="right">
  78. {% for category in selected_categories %}
  79. <input type="hidden" name="category_{{ category }}" value="1"/>
  80. {% endfor %}
  81. <input type="hidden" name="q" value="{{ q }}" />
  82. <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
  83. <input type="submit" value="{{ _('next page') }} >>" />
  84. </div>
  85. </form>
  86. <br />
  87. </div>
  88. {% endif %}
  89. </div>
  90. {% endblock %}