# HG changeset patch # User Marcin Kuzminski # Date 2019-11-25 10:18:47 # Node ID cb3daaa518a6a9d38bd4d1c78562c89ef2202117 # Parent e030f9fa28e2386f3d947575a08bf8f639b62f65 ui: use more distinctive icons for search hints diff --git a/rhodecode/apps/home/views.py b/rhodecode/apps/home/views.py --- a/rhodecode/apps/home/views.py +++ b/rhodecode/apps/home/views.py @@ -449,6 +449,7 @@ class HomeView(BaseAppView): 'id': -10, 'value': query, 'value_display': label, + 'value_icon': '', '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': '', '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': '', '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': '', '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': '', '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': '', 'type': 'search', 'subtype': 'global', 'url': h.route_path('search', diff --git a/rhodecode/templates/base/base.mako b/rhodecode/templates/base/base.mako --- a/rhodecode/templates/base/base.mako +++ b/rhodecode/templates/base/base.mako @@ -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 += ' '; + if (valueIcon === undefined) { + icon += ' '; + } else { + icon += valueIcon + ' '; + } + if (searchSubType !== undefined && searchSubType == 'repo') { valueDisplay += '
repository
'; }