95 lines
3.6 KiB
HTML
95 lines
3.6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block page-title %}/ search {% if query %}/ “{{ query }}”{% endif %}{% endblock %}
|
|
{% block html-class %}search{% endblock %}
|
|
{% block body-class %}search static{% endblock %}
|
|
|
|
{% block js %}
|
|
{{ block.super }}
|
|
window.detail = false;
|
|
{% endblock %}
|
|
|
|
{% 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 %}
|
|
|
|
{% block content %}
|
|
<section class="snipts" id="snipts"></section>
|
|
<div class="static-box {% if page.object_list|length > 0 %}has-snipts{% endif %}">
|
|
<form method="get" class="form-search" action=".">
|
|
<input type="text" class="search-query" name="q" value="{% if form.q.value %}{{ form.q.value }}{% endif %}" placeholder="Search snipts" id="id_q">
|
|
<button type="submit" class="btn">Search</button>
|
|
</form>
|
|
</div>
|
|
{% if query %}
|
|
{% if page.object_list|length > 0 %}
|
|
<section class="snipts" id="snipts">
|
|
{% endif %}
|
|
{% for result in page.object_list %}
|
|
{% with result.object as snipt %}
|
|
{% include "snipts/snipt-list.html" %}
|
|
{% endwith %}
|
|
{% empty %}
|
|
<div class="empty-snipts">
|
|
No snipts found for “{{ query }}”.
|
|
</div>
|
|
{% endfor %}
|
|
{% if page.object_list|length > 0 %}
|
|
</section>
|
|
{% endif %}
|
|
{% 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>
|
|
{% endif %}
|
|
{% endif %}
|
|
<script type="text/javascript" id="disqus">
|
|
var disqus_shortname = 'snipt-net';
|
|
{% if debug %}
|
|
var disqus_developer = 1;
|
|
{% endif %}
|
|
|
|
(function () {
|
|
var s = document.createElement('script'); s.async = true;
|
|
s.type = 'text/javascript';
|
|
s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';
|
|
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
|
}());
|
|
</script>
|
|
<script type="text/html" id="disqus-template">
|
|
var disqus_shortname = 'snipt-net';
|
|
{% if debug %}
|
|
var disqus_developer = 1;
|
|
{% endif %}
|
|
|
|
(function () {
|
|
var s = document.createElement('script'); s.async = true;
|
|
s.type = 'text/javascript';
|
|
s.src = 'https://' + disqus_shortname + '.disqus.com/count.js';
|
|
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
|
}());
|
|
</script>
|
|
{% endblock %}
|