results.html 3.1KB

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