Commit 2483ff9d601a227582c8fd3aef9ff3290724d068
1 parent
9275eaff
Exists in
colab_search
Added search ordering by type
Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com> Signed-off-by: Simião Carvalho <simiaosimis@gmail.com>
Showing
2 changed files
with
6 additions
and
4 deletions
Show diff stats
colab/settings.py
| @@ -131,7 +131,7 @@ ATTACHMENTS_FOLDER_PATH = '/mnt/trac/attachments/' | @@ -131,7 +131,7 @@ ATTACHMENTS_FOLDER_PATH = '/mnt/trac/attachments/' | ||
| 131 | # the indexes | 131 | # the indexes |
| 132 | 132 | ||
| 133 | ORDERING_DATA = { | 133 | ORDERING_DATA = { |
| 134 | - 'latest': { | 134 | + 'latest': { |
| 135 | 'name': _(u'Recent activity'), | 135 | 'name': _(u'Recent activity'), |
| 136 | 'fields': ('-modified', '-created'), | 136 | 'fields': ('-modified', '-created'), |
| 137 | }, | 137 | }, |
| @@ -139,6 +139,10 @@ ORDERING_DATA = { | @@ -139,6 +139,10 @@ ORDERING_DATA = { | ||
| 139 | 'name': _(u'Relevance'), | 139 | 'name': _(u'Relevance'), |
| 140 | 'fields': None, | 140 | 'fields': None, |
| 141 | }, | 141 | }, |
| 142 | + 'type': { | ||
| 143 | + 'name': _(u'Type'), | ||
| 144 | + 'fields': ('type',), | ||
| 145 | + } | ||
| 142 | } | 146 | } |
| 143 | 147 | ||
| 144 | 148 |
colab/super_archives/templates/search/thread_search_preview.html
| @@ -4,9 +4,7 @@ | @@ -4,9 +4,7 @@ | ||
| 4 | <div class="col-md-12"> | 4 | <div class="col-md-12"> |
| 5 | <small>{% datetime_format result.modified %} - <a href="{{result.modified_by_url}}">{{ result.modified_by }}</a></small><br> | 5 | <small>{% datetime_format result.modified %} - <a href="{{result.modified_by_url}}">{{ result.modified_by }}</a></small><br> |
| 6 | <h4><a href="{{result.url}}">{{ result.title }}</a></h4> | 6 | <h4><a href="{{result.url}}">{{ result.title }}</a></h4> |
| 7 | - {% with description as result.latest_description|truncatewords:"85" %} | ||
| 8 | - {{description | default_if_none:"a"}}<br> | ||
| 9 | - {% endwith %} | 7 | + <p>{{result.latest_description|default_if_none:" "|truncatewords:"85"}}</p> |
| 10 | <small>{% trans "Registred in" %}: <strong>{% trans "Discussion" %}</strong></small> | 8 | <small>{% trans "Registred in" %}: <strong>{% trans "Discussion" %}</strong></small> |
| 11 | </div> | 9 | </div> |
| 12 | <hr> | 10 | <hr> |