quick-search-bar: fixes #5634

This commit is contained in:
Marcin Kuzminski 2020-10-08 18:19:14 +02:00
parent 8627996783
commit 274d09cad8
2 changed files with 8 additions and 7 deletions

View file

@ -32,7 +32,7 @@ from rhodecode.lib.auth import (
HasRepoGroupPermissionAny, AuthUser)
from rhodecode.lib.codeblocks import filenode_as_lines_tokens
from rhodecode.lib.index import searcher_from_config
from rhodecode.lib.utils2 import safe_unicode, str2bool, safe_int
from rhodecode.lib.utils2 import safe_unicode, str2bool, safe_int, safe_str
from rhodecode.lib.vcs.nodes import FileNode
from rhodecode.model.db import (
func, true, or_, case, cast, in_filter_generator, String, Session,
@ -331,7 +331,8 @@ class HomeView(BaseAppView, DataGridAppView):
{
'id': obj.pull_request_id,
'value': org_query,
'value_display': 'pull request: `!{} - {}`'.format(obj.pull_request_id, obj.title[:50]),
'value_display': 'pull request: `!{} - {}`'.format(
obj.pull_request_id, safe_str(obj.title[:50])),
'type': 'pull_request',
'url': h.route_path('pull_requests_global', pull_request_id=obj.pull_request_id)
}

View file

@ -785,15 +785,15 @@
- Prefix query to allow special search:
user:admin, to search for usernames, always global
<strong>user:</strong>admin, to search for usernames, always global
user_group:devops, to search for user groups, always global
<strong>user_group:</strong>devops, to search for user groups, always global
pr:303, to search for pull request number, title, or description, always global
<strong>pr:</strong>303, to search for pull request number, title, or description, always global
commit:efced4, to search for commits, scoped to repositories or groups
<strong>commit:</strong>efced4, to search for commits, scoped to repositories or groups
file:models.py, to search for file paths, scoped to repositories or groups
<strong>file:</strong>models.py, to search for file paths, scoped to repositories or groups
% if c.template_context['search_context']['repo_id']:
For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a>