Created
February 11, 2012 00:09
-
-
Save ikks/1794276 to your computer and use it in GitHub Desktop.
Sample for a search template using gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layout/base.html" %} | |
<div class="entry"> | |
{% block body %} | |
<div class="register_init"> | |
<div class="add_new"> | |
<a href="/recolecta/nuevo">Nueva Solicitud de Inscripción en el Registro</a> | |
</div> | |
<form method="get" action="."> | |
{{ form.as_p }} | |
<input type="submit" value="Buscar"> | |
</form> | |
{% if query %} | |
<h3>Resultados</h3> | |
{% for result in page.object_list %} | |
<p> | |
<a href="/recolecta/1/{{ result.object.id }}">{{ result.object.assignednumber }}</a>: {{ result.object }} | |
</p> | |
{% empty %} | |
<p>No se encontraron resultados.</p> | |
{% endfor %} | |
{% if page.has_previous or page.has_next %} | |
<div> | |
{% if page.has_previous %}<a href="?q={{ query }}&page={{ page.previous_page_number }}">{% endif %}« Previous{% if page.has_previous %}</a>{% endif %} | |
| | |
{% if page.has_next %}<a href="?q={{ query }}&page={{ page.next_page_number }}">{% endif %}Next »{% if page.has_next %}</a>{% endif %} | |
</div> | |
{% endif %} | |
{% else %} | |
{# Show some example queries to run, maybe query syntax, something else? #} | |
{% endif %} | |
</div> | |
{% endblock %} | |
</div> | |
{% block search %} | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment