ui: use more distinctive icons for search hints

This commit is contained in:
Marcin Kuzminski 2019-11-25 11:18:47 +01:00
parent de152053d4
commit 77ace245eb
2 changed files with 13 additions and 1 deletions

View file

@ -449,6 +449,7 @@ class HomeView(BaseAppView):
'id': -10,
'value': query,
'value_display': label,
'value_icon': '<i class="icon-code"></i>',
'type': 'search',
'subtype': 'repo',
'url': h.route_path('search_repo',
@ -466,6 +467,7 @@ class HomeView(BaseAppView):
'id': -20,
'value': query,
'value_display': label,
'value_icon': '<i class="icon-history"></i>',
'type': 'search',
'subtype': 'repo',
'url': h.route_path('search_repo',
@ -491,6 +493,7 @@ class HomeView(BaseAppView):
'id': -30,
'value': query,
'value_display': label,
'value_icon': '<i class="icon-code"></i>',
'type': 'search',
'subtype': 'repo_group',
'url': h.route_path('search_repo_group',
@ -508,6 +511,7 @@ class HomeView(BaseAppView):
'id': -40,
'value': query,
'value_display': label,
'value_icon': '<i class="icon-history"></i>',
'type': 'search',
'subtype': 'repo_group',
'url': h.route_path('search_repo_group',
@ -529,6 +533,7 @@ class HomeView(BaseAppView):
'id': -1,
'value': query,
'value_display': u'File search for: `{}`'.format(query),
'value_icon': '<i class="icon-code"></i>',
'type': 'search',
'subtype': 'global',
'url': h.route_path('search',
@ -539,6 +544,7 @@ class HomeView(BaseAppView):
'id': -2,
'value': query,
'value_display': u'Commit search for: `{}`'.format(query),
'value_icon': '<i class="icon-history"></i>',
'type': 'search',
'subtype': 'global',
'url': h.route_path('search',

View file

@ -889,6 +889,7 @@
var searchType = data['type'];
var searchSubType = data['subtype'];
var valueDisplay = data['value_display'];
var valueIcon = data['value_icon'];
var pattern = '(' + escapeRegExChars(value) + ')';
@ -906,7 +907,12 @@
}
// full text search/hints
else if (searchType === 'search') {
icon += '<i class="icon-more"></i> ';
if (valueIcon === undefined) {
icon += '<i class="icon-more"></i> ';
} else {
icon += valueIcon + ' ';
}
if (searchSubType !== undefined && searchSubType == 'repo') {
valueDisplay += '<div class="pull-right tag">repository</div>';
}