/core/templates/search.html

http://github.com/plushcms/PlushCMS · 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. {% if result.text|safe|wordcount > 50 %}
  13. {{ result.text|safe|truncatewords_html:"50" }}
  14. <p class="right"><a href="/{{ result.url }}">More...</a></p><br /><br />
  15. {% else %}
  16. {{ result.text|safe }}
  17. {% endif %}
  18. <p>
  19. <strong>Categories:</strong>
  20. {% if result.category.all|length %}
  21. {% for category in result.category.all %}
  22. <a href="/category/{{ category.url }}/"><img src="/img/{{ category.icon }}" alt="{{ category.title }}" /> {{ category.title }}</a>{% if not forloop.last %},{% endif %}
  23. {% endfor %}
  24. {% else %}
  25. No category
  26. {% endif %}
  27. | <strong>Author: </strong>{{ result.author }}
  28. <span class="infocomments">
  29. <strong>Comments:</strong> (<a href="/{{ result.url }}">{{ result.comments_set.count }}</a>)
  30. </span>
  31. </p>
  32. {% endif %}
  33. {% if result.verbose_name = "Subpage" %}
  34. <h1><a href="/subpage/{{ result.url }}/">{{ result.title }}</a></h1>
  35. {% if result.text|safe|wordcount > 50 %}
  36. {{ result.text|safe|truncatewords_html:"50" }}
  37. <p class="right"><a href="/subpage/{{ result.url }}/">More...</a></p><br /><br />
  38. {% else %}
  39. {{ result.text|safe }}
  40. {% endif %}
  41. {% endif %}
  42. {% endfor %}
  43. {% endif %}
  44. {% if posts.has_previous %}
  45. <div class="prev"><a href="/search/{{ posts.previous_page_number }}/?{{ request.GET.urlencode }}"><< Previous results</a></div>
  46. {% endif %}
  47. {% if posts.has_next %}
  48. <div class="next"><a href="/search/{{ posts.next_page_number }}/?{{ request.GET.urlencode }}">Next results >></a></div>
  49. {% endif %}
  50. {% endblock %}