# HG changeset patch # User Marcin Kuzminski # Date 2019-06-12 19:27:38 # Node ID 41ddf1f64786ff2e4360aab83161e92336a71438 # Parent de1152299fb0698a2cd4dcb4ad9b54793061c081 search: fixed UI of search items after redesign. diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -221,7 +221,8 @@ tooltip = _ToolTip() files_icon = icon = '' -def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None, limit_items=False): + +def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None, limit_items=False, linkify_last_item=False): if isinstance(file_path, str): file_path = safe_unicode(file_path) @@ -247,7 +248,12 @@ def files_breadcrumbs(repo_name, commit_ continue segment_html = escape(segment) - if cnt != last_cnt: + last_item = cnt == last_cnt + + if last_item and linkify_last_item is False: + # plain version + url_segments.append(segment_html) + else: url_segments.append( link_to( segment_html, @@ -257,9 +263,7 @@ def files_breadcrumbs(repo_name, commit_ commit_id=commit_id, f_path='/'.join(path_segments[:cnt + 1]), _query=route_qry), - )) - else: - url_segments.append(segment_html) + )) limited_url_segments = url_segments[:1] + ['...'] + url_segments[-5:] if limit_items and len(limited_url_segments) < len(url_segments): diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -2360,7 +2360,7 @@ div.search-code-body { } .code-body { - border: @border-thickness solid @border-default-color; + border: @border-thickness solid @grey6; .border-radius(@border-radius); } @@ -2380,6 +2380,11 @@ div.search-code-body { .break { background-color: #DDE7EF; width: 100%; color: #747474; display: block; } } + .path { + border-bottom: none !important; + border-left: 1px solid @grey6 !important; + border-right: 1px solid @grey6 !important; + } } table.rctable td.td-search-results div { diff --git a/rhodecode/templates/search/search_content.mako b/rhodecode/templates/search/search_content.mako --- a/rhodecode/templates/search/search_content.mako +++ b/rhodecode/templates/search/search_content.mako @@ -58,65 +58,50 @@ %> ## search results are additionally filtered, and this check is just a safe gate % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'): -
-
-

- <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %> - ${search.repo_icon(repo_type)} - ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))} -

- ## level 1 -
+
+

+ <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %> + ${search.repo_icon(repo_type)} + ${h.link_to(entry['repository'], h.route_path('repo_summary', repo_name=entry['repository']))} +

-
- - - - ${h.link_to(h.literal(entry['f_path']), h.route_path('repo_files',repo_name=entry['repository'],commit_id=entry.get('commit_id', 'tip'),f_path=entry['f_path']))} - - - - - +
+ +
+ ${entry['f_path'].split('/')[-1]}
-
-
- - ${_('Show Full History')} - - | ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))} - | ${h.link_to(_('Raw'), h.route_path('repo_file_raw', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))} - | ${h.link_to(_('Download'), h.route_path('repo_file_download',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))} -
+
+
+ + ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))} + (${len(matching_lines)} ${_ungettext('matched', 'matched', len(matching_lines))}) + + + % if entry.get('size'): + | ${h.format_byte_size_binary(entry['size'])} + % endif + + + % if entry.get('mimetype'): + | ${entry.get('mimetype', "unknown mimetype")} + % endif + +
+
+
+ +
+
+ ${h.files_breadcrumbs(entry['repository'],entry.get('commit_id', 'tip'),entry['f_path'], linkify_last_item=True)}
-
- ## level 2 -
- -
- - %if entry.get('lines'): - ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))} - (${len(matching_lines)} ${_ungettext('matched', 'matched', len(matching_lines))}) - %endif - - - - %if entry.get('size'): - | ${h.format_byte_size_binary(entry['size'])} - %endif - - - - %if entry.get('mimetype'): - | ${entry.get('mimetype', "unknown mimetype")} - %endif - -
- -
+
+## +## ${_('Show Full History')} +## +## | ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))} +## | ${h.link_to(_('Raw'), h.route_path('repo_file_raw', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
<% repo_group = entry.get('repository_group')%> @@ -135,13 +120,13 @@ % endif
-
- -
+
+
-
+ +
${highlight_text_file( has_matched_content=has_matched_content, file_content=file_content,