message-preview.html 1.72 KB
{% load i18n %}
{% load highlight %}

<li class="preview-message">
<span class="glyphicon glyphicon-{{ result.icon_name }}" title="{{ result.type }}"></span>

{% if result.tag %}
<a href="{% firstof result.mailinglist_url result.mailinglist.get_absolute_url result.url %}">
  <span class="label label-primary">{{ result.tag }}</span>
</a>
{% endif %}

{% if result.title %}
  <a href="{{ result.url }}" {% if result.description %}title="{{ result.description|escape|truncatechars:200 }}"{% endif %}>
    <span class="subject">
      <!-- a striptags filter was raising an error here because using with highlight -->
      {% if query %}
        {% highlight result.title with query max_length "1000" %}
      {% else %}
        {{ result.title }}
      {% endif %}
    </span>
  </a>
{% endif %}

{% if result.description %}
      <!-- a striptags filter was raising an error here because using with highlight -->
  <span class="quiet">- {% if query %}{% highlight result.description with query max_length "150" %}{% else %}{{ result.description }}{% endif %}</span>
{% endif %}

{% if result.author or result.modified %}
  <div class="quiet">
    {% if result.author %}
      <span class="pull-left">{% trans "by" %}
        {% if result.author and result.author_url %}
          <a href="{{ result.author_url }}">
            {% if query %}
              {% highlight result.author with query %}
            {% else %}
              {{ result.author }}
            {% endif %}
          </a>
        {% else %}
          <span>{{ result.author }}</span>
        {% endif %}
      </span>
    {% endif %}
    {% if result.modified %}
    <span class="pull-right">{{ result.modified|timesince }} {% trans "ago" %}</span>
    {% endif %}
  </div>
{% endif %}
</li>