2012-04-22 18:47:49 -07:00
|
|
|
{% extends "base.html" %}
|
2012-04-16 21:42:01 -07:00
|
|
|
|
2012-04-22 18:47:49 -07:00
|
|
|
{% block page-title %}/ search {% if query %}/ {{ query }}{% endif %}{% endblock %}
|
|
|
|
{% block html-class %}search{% endblock %}
|
|
|
|
{% block body-class %}search static{% endblock %}
|
2012-04-16 21:42:01 -07:00
|
|
|
|
2012-04-22 18:47:49 -07:00
|
|
|
{% block breadcrumb %}
|
|
|
|
<li><a href="/search/">search</a></li>
|
|
|
|
{% if query %}
|
|
|
|
<li><span class="prompt">/</span> <a href="/search?q={{ query|urlencode }}">{{ query }}</a></li>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
2012-04-16 21:42:01 -07:00
|
|
|
|
2012-04-22 18:47:49 -07:00
|
|
|
{% block content %}
|
|
|
|
<div class="static-box">
|
|
|
|
<form method="get" class="form-search" action=".">
|
|
|
|
<input type="text" class="search-query" name="q" value="{{ form.q.data }}" id="id_q">
|
|
|
|
<button type="submit" class="btn">Search</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% if query %}
|
|
|
|
{% for result in page.object_list %}
|
|
|
|
<a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a><br />
|
|
|
|
{% empty %}
|
|
|
|
<div class="empty-snipts">
|
|
|
|
No snipts found for “{{ query }}”.
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% if page.has_previous or page.has_next %}
|
|
|
|
<div class="pagination">
|
|
|
|
<ul>
|
|
|
|
{% if page.has_previous %}
|
|
|
|
<li class="prev">
|
|
|
|
<a id="prev-page" href="?q={{ query }}&page={{ page.previous_page_number }}">←</a>
|
|
|
|
</li>
|
|
|
|
{% else %}
|
|
|
|
<li class="disabled prev">
|
|
|
|
<a href="#">←</a>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
{% if page.has_next %}
|
|
|
|
<li class="next">
|
|
|
|
<a id="next-page" href="?q={{ query }}&page={{ page.next_page_number }}">→</a>
|
|
|
|
</li>
|
|
|
|
{% else %}
|
|
|
|
<li class="disabled next">
|
|
|
|
<a href="#">→</a>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2012-04-16 21:42:01 -07:00
|
|
|
{% endif %}
|
2012-04-22 18:47:49 -07:00
|
|
|
{% else %}
|
|
|
|
{# Show some example queries to run, maybe query syntax, something else? #}
|
|
|
|
{% endif %}
|
2012-04-16 21:42:01 -07:00
|
|
|
{% endblock %}
|