Commit 3cbe25978e30ab031a316dfd405fb90550561587
1 parent
60ce7036
Exists in
search_block
Adding templates for account and thread search
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com> Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com> Signed-off-by: Lucas Moura <lucas.moura128@gmail.com>
Showing
3 changed files
with
27 additions
and
62 deletions
Show diff stats
colab/accounts/templates/accounts/user_search_preview.html
0 → 100644
colab/super_archives/templates/message-preview.html
| 1 | {% load i18n tz highlight %} | 1 | {% load i18n tz highlight %} |
| 2 | 2 | ||
| 3 | -<li class="preview-message"> | ||
| 4 | -<span class="glyphicon glyphicon-{{ result.icon_name }}" title="{{ result.type }}"></span> | ||
| 5 | - | ||
| 6 | -{% if result.tag %} | ||
| 7 | -<a href="{% firstof result.mailinglist_url result.mailinglist.get_absolute_url result.url %}"> | ||
| 8 | - <span class="label label-primary">{{ result.tag }}</span> | ||
| 9 | -</a> | 3 | +{% if result.type in "user" %} |
| 4 | + {% include "accounts/user_search_preview.html" with user=result %} | ||
| 10 | {% endif %} | 5 | {% endif %} |
| 11 | 6 | ||
| 12 | -{% if result.title %} | ||
| 13 | - <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 %}> | ||
| 14 | - <span class="subject"> | ||
| 15 | - <!-- a striptags filter was raising an error here because using with highlight --> | ||
| 16 | - {% if query %} | ||
| 17 | - {% highlight result.title with query max_length "1000" %} | ||
| 18 | - {% else %} | ||
| 19 | - {{ result.title }} | ||
| 20 | - {% endif %} | ||
| 21 | - </span> | ||
| 22 | - </a> | ||
| 23 | -{% endif %} | 7 | +{% if result.type in "thread" %} |
| 8 | + {% include "superarchives/thread_search_preview.html" with thread=result %} | ||
| 9 | +{% endif%} | ||
| 24 | 10 | ||
| 25 | -{% if result.description %} | ||
| 26 | - <!-- a striptags filter was raising an error here because using with highlight --> | ||
| 27 | - <span class="quiet">- {% if query %} | ||
| 28 | - {% highlight result.description with query max_length "150" %} | ||
| 29 | - {% else %} | ||
| 30 | - {% if result.latest_description %} | ||
| 31 | - {{ result.latest_description|striptags|escape|truncatechars:150 }} | ||
| 32 | - {% elif result.description %} | ||
| 33 | - {{ result.description|striptags|escape|truncatechars:150 }} | ||
| 34 | - {% endif %} | ||
| 35 | - {% endif %} | ||
| 36 | - </span> | ||
| 37 | -{% endif %} | 11 | +{% if result.type in "noosfero_community"%} |
| 12 | + {% include "noosfero/community_search_preview.html" with community=result %} | ||
| 13 | +{% endif%} | ||
| 38 | 14 | ||
| 39 | -{% if result.fullname or result.modified or result.modified_by %} | ||
| 40 | - <div class="quiet"> | ||
| 41 | - {% if result.modified_by %} | ||
| 42 | - <span class="pull-left">{% trans "by" %} | ||
| 43 | - {% if result.modified_by_url %} | ||
| 44 | - <a href="{{ result.modified_by_url }}"> | ||
| 45 | - {% else %} | ||
| 46 | - <span> | ||
| 47 | - {% endif %} | 15 | +{% if result.type in "noosfero_article"%} |
| 16 | + {% include "noosfero/article_search_preview.html" with article=result %} | ||
| 17 | +{% endif%} | ||
| 48 | 18 | ||
| 49 | - {% if query %} | ||
| 50 | - {% highlight result.modified_by with query %} | ||
| 51 | - {% else %} | ||
| 52 | - {{ result.modified_by }} | ||
| 53 | - {% endif %} | ||
| 54 | - | ||
| 55 | - {% if result.modified_by_url %} | ||
| 56 | - </a> | ||
| 57 | - {% else %} | ||
| 58 | - </span> | ||
| 59 | - {% endif %} | ||
| 60 | - </span> | ||
| 61 | - {% else %} | ||
| 62 | - <span class="pull-left">{% trans "by" %} {% trans "Anonymous" %}</span> | ||
| 63 | - {% endif %} | ||
| 64 | - {% if result.modified %} | ||
| 65 | - <span class="pull-right">{{ result.modified|localtime|timesince }} {% trans "ago" %}</span> | ||
| 66 | - {% endif %} | ||
| 67 | - </div> | ||
| 68 | -{% endif %} | ||
| 69 | -</li> |
colab/super_archives/templates/superarchives/thread_search_preview.html
0 → 100644