/core/templates/search.html
HTML | 57 lines | 50 code | 7 blank | 0 comment | 0 complexity | 7539d694359ae5f8b22ab68755b3be45 MD5 | raw file
1{% extends "base.html" %} 2 {% block content %} 3 <h1>Resaults for: "{{ phrase }}"</h1><br /> 4 {% if not posts.object_list %} 5 No results found. 6 <p style="text-align: center; padding: 35px 0 0 0;">Return to <a href="/">homepage</a></p> 7 {% else %} 8 {% for result in posts.object_list %} 9 {% if result.verbose_name == "News" %} 10 <h1><a href="/{{ result.url }}">{{ result.title }}</a></h1> 11 <h5><img src="/img/images/ico.png" alt="" /> Date: {{ result.datetime|date:"Y.m.d" }}</h5> 12 13 {% if result.text|safe|wordcount > 50 %} 14 {{ result.text|safe|truncatewords_html:"50" }} 15 <p class="right"><a href="/{{ result.url }}">More...</a></p><br /><br /> 16 {% else %} 17 {{ result.text|safe }} 18 {% endif %} 19 20 <p> 21 <strong>Categories:</strong> 22 {% if result.category.all|length %} 23 {% for category in result.category.all %} 24 <a href="/category/{{ category.url }}/"><img src="/img/{{ category.icon }}" alt="{{ category.title }}" /> {{ category.title }}</a>{% if not forloop.last %},{% endif %} 25 {% endfor %} 26 {% else %} 27 No category 28 {% endif %} 29 | <strong>Author: </strong>{{ result.author }} 30 31 <span class="infocomments"> 32 <strong>Comments:</strong> (<a href="/{{ result.url }}">{{ result.comments_set.count }}</a>) 33 </span> 34 </p> 35 {% endif %} 36 37 {% if result.verbose_name = "Subpage" %} 38 <h1><a href="/subpage/{{ result.url }}/">{{ result.title }}</a></h1> 39 40 {% if result.text|safe|wordcount > 50 %} 41 {{ result.text|safe|truncatewords_html:"50" }} 42 <p class="right"><a href="/subpage/{{ result.url }}/">More...</a></p><br /><br /> 43 {% else %} 44 {{ result.text|safe }} 45 {% endif %} 46 {% endif %} 47 {% endfor %} 48 {% endif %} 49 50 {% if posts.has_previous %} 51 <div class="prev"><a href="/search/{{ posts.previous_page_number }}/?{{ request.GET.urlencode }}"><< Previous results</a></div> 52 {% endif %} 53 54 {% if posts.has_next %} 55 <div class="next"><a href="/search/{{ posts.next_page_number }}/?{{ request.GET.urlencode }}">Next results >></a></div> 56 {% endif %} 57 {% endblock %}