Commit b68e6ce882f2120205ed04a96210a6e62d3373d9
1 parent
40b7e25c
Exists in
master
and in
39 other branches
Moving preview message to the right place
Showing
2 changed files
with
20 additions
and
16 deletions
Show diff stats
src/templates/search/preview-search.html
| 1 | {% load i18n %} | 1 | {% load i18n %} |
| 2 | {% load highlight %} | 2 | {% load highlight %} |
| 3 | 3 | ||
| 4 | +<li class="preview-message"> | ||
| 4 | <span class="glyphicon glyphicon-{{ result.icon_name }}" title="{{ result.type }}"></span> | 5 | <span class="glyphicon glyphicon-{{ result.icon_name }}" title="{{ result.type }}"></span> |
| 5 | 6 | ||
| 6 | {% if result.mailinglist_url %} | 7 | {% if result.mailinglist_url %} |
| @@ -29,3 +30,21 @@ | @@ -29,3 +30,21 @@ | ||
| 29 | <!-- a striptags filter was raising an error here because using with highlight --> | 30 | <!-- a striptags filter was raising an error here because using with highlight --> |
| 30 | <span class="quiet">- {% highlight result.description with query max_length "150" %}</span> | 31 | <span class="quiet">- {% highlight result.description with query max_length "150" %}</span> |
| 31 | {% endif %} | 32 | {% endif %} |
| 33 | + | ||
| 34 | +{% if result.author or result.modified %} | ||
| 35 | + <div class="quiet"> | ||
| 36 | + {% if result.author %} | ||
| 37 | + <span class="pull-left">{% trans "by" %} | ||
| 38 | + {% if result.author and result.author_url %} | ||
| 39 | + <a href="{{ result.author_url }}">{% highlight result.author with query %}</a> | ||
| 40 | + {% else %} | ||
| 41 | + <span>{{ result.author }}</span> | ||
| 42 | + {% endif %} | ||
| 43 | + </span> | ||
| 44 | + {% endif %} | ||
| 45 | + {% if result.modified %} | ||
| 46 | + <span class="pull-right">{{ result.modified|timesince }} {% trans "ago" %}</span> | ||
| 47 | + {% endif %} | ||
| 48 | + </div> | ||
| 49 | +{% endif %} | ||
| 50 | +</li> |
src/templates/search/search.html
| @@ -48,22 +48,7 @@ | @@ -48,22 +48,7 @@ | ||
| 48 | <div class="col-lg-10"> | 48 | <div class="col-lg-10"> |
| 49 | <ul class="none indent list-unstyled"> | 49 | <ul class="none indent list-unstyled"> |
| 50 | {% for result in page.object_list %} | 50 | {% for result in page.object_list %} |
| 51 | - <li class="preview-message"> | ||
| 52 | - {% include "search/preview-search.html" %} | ||
| 53 | - | ||
| 54 | - {% if result.author %} | ||
| 55 | - <div class="quiet"> | ||
| 56 | - <span class="pull-left">{% trans "by" %} | ||
| 57 | - {% if result.author and result.author_url %} | ||
| 58 | - <a href="{{ result.author_url }}">{% highlight result.author with query %}</a> | ||
| 59 | - {% else %} | ||
| 60 | - <span>{{ result.author }}</span> | ||
| 61 | - {% endif %} | ||
| 62 | - </span> | ||
| 63 | - <span class="pull-right">{{ result.modified|timesince }} {% trans "ago" %}</span> | ||
| 64 | - </div> | ||
| 65 | - {% endif %} | ||
| 66 | - </li> | 51 | + {% include "search/preview-search.html" %} |
| 67 | {% empty %} | 52 | {% empty %} |
| 68 | <li class="text-center"> | 53 | <li class="text-center"> |
| 69 | {% trans "No results for your search." %} | 54 | {% trans "No results for your search." %} |