Commit da2b4afd3ccaceb4af167f905734f752de219a9f

Authored by Luan
1 parent a70d626b

Adding custom search type previews templates

src/templates/search/search-message-preview.html
1 1 {% load i18n %}
2 2  
3   -<li class="preview-message">
4   - {% if result.Type %}
5   - <img alt="{{ result.Type }}" title="{{ result.Type }}"
6   - src="{{ STATIC_URL }}img/{{ result.Type }}.png" />
7   - {% else %}
8   - <span class="glyphicon glyphicon-envelope"></span>
9   - {% endif %}
  3 +<span class="glyphicon glyphicon-envelope" title="{{ result.type }}"></span>
10 4  
11   - {% if result.mailinglist %}
12   - <a href="{% url 'super_archives.views.list_messages' %}?list={{ result.mailinglist }}">
13   - <span class="label label-primary">{{ result.mailinglist }}</span>
14   - </a>
15   - {% endif %}
  5 +{% if result.mailinglist %}
  6 + <a href="{% url 'super_archives.views.list_messages' %}?list={{ result.mailinglist }}">
  7 + <span class="label label-primary">{{ result.mailinglist }}</span>
  8 + </a>
  9 +{% endif %}
16 10  
17   - <span class="subject">
18   - <a href="{{ result.url }}#msg-{{ result.pk }}"
19   - title="{% filter striptags|truncatewords:50 %}{{ result.description|escape }}{% endfilter %}">
20   - {{ result.title }}
21   - </a>
22   - </span>
  11 +<span class="subject">
  12 + <a href="{{ result.url }}#msg-{{ result.pk }}"
  13 + title="{% filter striptags|truncatewords:50 %}{{ result.description|escape }}{% endfilter %}">
  14 + {{ result.title }}
  15 + </a>
  16 +</span>
23 17  
24   - <span class="quiet">- {{ result.description|striptags }}</span>
25   -
26   - <div class="quiet">
27   - <span class="pull-left">
28   - {% if result.from_address_user_url or result.from_address_full_name or result.last_author or result.Creator %}
29   - {% trans "by" %}
30   - {% endif %}
31   -
32   - {% if result.from_address_user_url %}
33   - <a href="{{ result.from_address_user_url }}">{{ result.from_address_user_full_name }}</a>
34   - {% elif result.from_address_full_name %}
35   - <span>{{ result.from_address_full_name }}</span>
36   - {% else %}
37   - {% firstof result.last_author result.Creator "" %}
38   - {% endif %}
39   - </span>
40   -
41   - <span class="pull-right">{{ result.modified|timesince }} {% trans "ago" %}</span>
42   - </div>
43   -</li>
  18 +<span class="quiet">- {{ result.description|striptags }}</span>
... ...
src/templates/search/search-revision-preview.html 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +{% load i18n %}
  2 +
  3 +<span class="glyphicon glyphicon-align-right" title="{{ result.type }}"></span>
  4 +
  5 +<span class="subject">
  6 + <a href="{{ result.url }}">{{ result.repository_name }} [{{ result.revision }}]</a>
  7 +</span>
  8 +
  9 +<span class="quiet">{% if result.message %}- {{ result.message }}{% endif %}</span>
... ...
src/templates/search/search-ticket-preview.html 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +{% load i18n %}
  2 +
  3 +<span class="glyphicon glyphicon-tag" title="{{ result.type }}"></span>
  4 +
  5 +<a href="{{ result.url }}" title="{{ result.description|escape }}">
  6 +{% if result.status %}
  7 + <span class="label label-primary">{{ result.status }}</span>
  8 +{% endif %}
  9 +
  10 +<span class="subject">
  11 + #{{ result.pk }} - {% filter striptags|truncatewords:50 %}{{ result.summary|escape }}{% endfilter %}
  12 + </a>
  13 +</span>
  14 +
  15 +<span class="quiet">- {{ result.description|striptags|truncatechars:150 }}</span>
... ...
src/templates/search/search-user-preview.html
1 1 {% load i18n %}
2 2  
3   -<li class="preview-message">
4   - <span class="glyphicon glyphicon-user"></span>
  3 +<span class="glyphicon glyphicon-user" title="{{ result.type }}"></span>
5 4  
6   - <span class="subject">
7   - <a href="{% url 'user_profile' result.username %}">{{ result.name }}</a>
8   - </span>
  5 +<span class="subject">
  6 + <a href="{% url 'user_profile' result.username %}">{{ result.name }}</a>
  7 +</span>
9 8  
10   - <span class="quiet">{% if result.institution %}- {{ result.institution }}{% endif %}{% if result.role %} - {{ result.role }}{% endif %}</span>
11   -</li>
  9 +<span class="quiet">{% if result.institution %}- {{ result.institution }}{% endif %}{% if result.role %} - {{ result.role }}{% endif %}</span>
... ...
src/templates/search/search-wiki-preview.html
1 1 {% load i18n %}
2 2  
3   -<li class="preview-message">
4   - <span class="glyphicon glyphicon-file"></span>
  3 +<span class="glyphicon glyphicon-file" title="{{ result.type }}"></span>
5 4  
6   - <span class="subject">
7   - <a href="{{ result.url }}">{{ result.name }}</a>
8   - </span>
  5 +<span class="subject">
  6 + <a href="{{ result.url }}">{{ result.name }}</a>
  7 +</span>
9 8  
10   - <span class="quiet">{% if result.text %}- {{ result.text|truncatechars:150 }} {% endif %}{% if result.comment|truncatechars:150 %}- {{ result.comment }}{% endif %}</span>
11   -
12   - <div class="quiet">
13   - <span class="pull-left">
14   - {% if result.author %}
15   - {% trans "by" %}
16   - {% endif %}
17   -
18   - {% if result.author %}
19   - <a href="{{ result.author_username }}">{{ result.author }}</a>
20   - {% endif %}
21   - </span>
22   -
23   - <span class="pull-right">{{ result.time }} {% trans "ago" %}</span>
24   - </div>
25   -</li>
  9 +<span class="quiet">{% if result.wiki_text %}- {{ result.wiki_text|truncatechars:150 }}{% elif result.comment %}- {{ result.comment|truncatechars:150 }}{% endif %}</span>
... ...