1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{% load i18n tz 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.type == 'thread' and result.latest_message_pk %}#msg-{{ result.latest_message_pk }}{% elif result.type == 'thread' and result.pk %}#msg-{{ result.pk }}{% endif %}" {% if result.latest_description %}title="{{ result.latest_description|escape|truncatechars:150 }}"{% elif result.description %}title="{{ result.description|escape|truncatechars:150 }}"{% 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 %}
{% if result.latest_description %}
{{ result.latest_description|striptags|escape|truncatechars:150 }}
{% elif result.description %}
{{ result.description|striptags|escape|truncatechars:150 }}
{% endif %}
{% endif %}
</span>
{% endif %}
{% if result.fullname or result.modified or result.modified_by %}
<div class="quiet">
{% if result.modified_by %}
<span class="pull-left">{% trans "by" %}
{% if result.modified_by_url %}
<a href="{{ result.modified_by_url }}">
{% else %}
<span>
{% endif %}
{% if query %}
{% highlight result.modified_by with query %}
{% else %}
{{ result.modified_by }}
{% endif %}
{% if result.modified_by_url %}
</a>
{% else %}
</span>
{% endif %}
</span>
{% else %}
<span class="pull-left">{% trans "by" %} {% trans "Anonymous" %}</span>
{% endif %}
{% if result.modified %}
<span class="pull-right">{{ result.modified|localtime|timesince }} {% trans "ago" %}</span>
{% endif %}
</div>
{% endif %}
</li>