Created
April 25, 2016 09:24
-
-
Save jirfag/d3183cf9736b759eadf54d62a1ece90f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #search/templates/search/search.html | |
| {% extends 'app/base.html' %} | |
| {% block content %} | |
| <div class="row"> | |
| <div class="col-md-12"> | |
| <form method="get" action="."> | |
| <table> | |
| {{ form.as_table }} | |
| <tr> | |
| <td> </td> | |
| <td> | |
| <input type="submit" value="Search"> | |
| </td> | |
| </tr> | |
| </table> | |
| </form> | |
| </div> | |
| </div> | |
| {% if query %} | |
| <div class="row"> | |
| <div class="col-md-12"> | |
| <h3>Результаты поиска</h3> | |
| {% for q in page.object_list %} | |
| <div class="panel panel-default"> | |
| <div class="panel-body"> | |
| <a href="{{ q.object.get_absolute_url }}">{{ q.object.title }} (rating: {{ q.object.likes_rating }})</a> | |
| </div> | |
| <div class="panel-footer">{{ q.object.text|truncatechars:50 }}</div> | |
| </div> | |
| {% empty %} | |
| <p>Ничего не найдено.</p> | |
| {% endfor %} | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col-md-12"> | |
| {% 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 %} | |
| </div> | |
| </div> | |
| {% endif %} | |
| {% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment