Show original description when there isn't highlight
<div class="module-list-wrapper">
<ul>
+ {% with "100" as MAX_SUBSTRING_LIMIT %}
{% for result in results %}
<li class="module-item search-result-item">
...{{ fragment|safe }}...
</p>
{% empty %}
+ {% if result.description %}
+ <p>{{ result.description|slice:MAX_SUBSTRING_LIMIT }}</p>
+ {% else %}
<p><em>No description for project.</em></p>
+ {% endif %}
{% endfor %}
{% elif 'page' in result.meta.index %}
- {% with "100" as MAX_SUBSTRING_LIMIT %}
<a href="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }}">
{{ result.project }} - {% if result.meta.highlight.title %} {{ result.meta.highlight.title.0|safe }} {% else %} {{ result.title }} {% endif %}
</a>
{% endif %}
{% endif %}
{% endfor %}
- {% endwith %}
{% endif %}
</p>
</li>
{% empty %}
<li class="module-item"><span class="quiet">{% trans "No results found." %}</span></li>
{% endfor %}
+ {% endwith %}
</ul>
</div>
</div>
