Skip to content
Snippets Groups Projects
Commit d167f92d authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Feature: Show hits and registered in GUI. (Redmine issue: #7577)

parent b5602d6e
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,8 @@ class ListView(HTMLMixin, SQLAlchemyMixin, ItemListView):
'createtime.asc': lambda x, y: x.order_by(y.createtime.asc()),
'name.desc': lambda x, y: x.order_by(y.name.desc()),
'name.asc': lambda x, y: x.order_by(y.name.asc()),
'hits.desc': lambda x, y: x.order_by(y.hits.desc()),
'hits.asc': lambda x, y: x.order_by(y.hits.asc()),
'credibility.desc': lambda x, y: x.order_by(y.credibility.desc()),
'credibility.asc': lambda x, y: x.order_by(y.credibility.asc())
}
......
......@@ -175,6 +175,8 @@ class DetectorSearchForm(hawat.forms.BaseSearchForm):
('createtime.asc', lazy_gettext('by creation time ascending')),
('name.desc', lazy_gettext('by name descending')),
('name.asc', lazy_gettext('by name ascending')),
('hits.desc', lazy_gettext('by number of hits descending')),
('hits.asc', lazy_gettext('by number of hits ascending')),
('credibility.asc', lazy_gettext('by credibility ascending')),
('credibility.asc', lazy_gettext('by credibility descending'))
],
......
......@@ -38,6 +38,9 @@
<th>
{{ _('Description') }}
</th>
<th>
{{ _('Hits') }} {{ macros_site.render_sorter(request.endpoint, query_params, 'hits') }}
</th>
<th data-toggle="tooltip" title="{{ _('Contextual item actions') }}">
{{ get_icon('actions') }} {{ _('Actions') }}
</th>
......@@ -58,6 +61,9 @@
<td>
{{ item.description | default(_('<< unknown >>'), True) | truncate(50) }}
</td>
<td>
{{ item.hits }}
</td>
<td class="column-actions">
{{ macros_page.render_menu_context_actions(item) }}
</td>
......
......@@ -67,6 +67,22 @@
{{ item.description | default(_('<< unknown >>'), True) }}
</td>
</tr>
<tr>
<th>
{{ _('Registered') }}:
</th>
<td>
{{ babel_format_datetime(item.registered) | default(_('<< unknown >>'), True) }}
</td>
</tr>
<tr>
<th>
{{ _('Hits') }}:
</th>
<td>
<span class="badge">{{ item.hits }}</span>
</td>
</tr>
<tr>
<th>
{{ _('Credibility') }}:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment