ZuluPro/myblog

View on GitHub
myblog/myapp/templates/zinnia/entry_search.html

Summary

Maintainability
Test Coverage
{% extends "zinnia/entry_list.html" %}
{% load i18n zinnia %}

{% block title %}{% trans "Search results for" %} '{{ pattern }}'{% endblock title %}

{% block meta-description %}{% trans "Search results for" %} '{{ pattern }}'{% endblock meta-description %}

{% block link %}
  {{ block.super }}
  <link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed of search result of" %} '{{ pattern }}'" href="{% url 'zinnia:entry_search_feed' %}?pattern={{ pattern }}" />
{% endblock link %}

{% block body-class %}{{ block.super }} search {% if object_list %}search-results{% else %}search-no-results{% endif %}{% endblock body-class %}

{% block content-title %}
<section>
<div class="content">
<h1>{% trans "Search results for" %} '{{ pattern }}'</h1>

{% if error %}
  <div data-alert class="alert-box alert">
    {{ error }}
  </div>
{% endif %}

{% if object_list %}
  <div data-alert class="alert-box success">
    {% blocktrans count entry_count=paginator.count %}{{ entry_count }} entry found{% plural %}{{ entry_count }} entries found{% endblocktrans %}
  </div>
{% endif %}
</div>
</section>
{% endblock content-title %}

{% block content-loop %}
{% if not error %}
{% for object in object_list %}
  {% include object.content_template with object_content=object.html_preview continue_reading=1 %}
{% empty %}
  <div data-alert class="alert-box warning">
    {% trans "Nothing found." %}
  </div>
{% endfor %}
{% endif %}
{% endblock content-loop %}

{% block content-related %}
<section>
<div class="content">
<div class="search">
  {% include "zinnia/tags/search_form.html" %}
</div>
</div>
</section>
{% endblock content-related %}