##// END OF EJS Templates
search: fixed UI of search items after redesign.
marcink -
r3745:41ddf1f6 new-ui
parent child Browse files
Show More
@@ -221,7 +221,8 b' tooltip = _ToolTip()'
221 221
222 222 files_icon = icon = '<i class="file-breadcrumb-copy tooltip icon-clipboard clipboard-action" data-clipboard-text="{}" title="Copy the full path"></i>'
223 223
224 def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None, limit_items=False):
224
225 def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None, limit_items=False, linkify_last_item=False):
225 226 if isinstance(file_path, str):
226 227 file_path = safe_unicode(file_path)
227 228
@@ -247,7 +248,12 b' def files_breadcrumbs(repo_name, commit_'
247 248 continue
248 249 segment_html = escape(segment)
249 250
250 if cnt != last_cnt:
251 last_item = cnt == last_cnt
252
253 if last_item and linkify_last_item is False:
254 # plain version
255 url_segments.append(segment_html)
256 else:
251 257 url_segments.append(
252 258 link_to(
253 259 segment_html,
@@ -257,9 +263,7 b' def files_breadcrumbs(repo_name, commit_'
257 263 commit_id=commit_id,
258 264 f_path='/'.join(path_segments[:cnt + 1]),
259 265 _query=route_qry),
260 ))
261 else:
262 url_segments.append(segment_html)
266 ))
263 267
264 268 limited_url_segments = url_segments[:1] + ['...'] + url_segments[-5:]
265 269 if limit_items and len(limited_url_segments) < len(url_segments):
@@ -2360,7 +2360,7 b' div.search-code-body {'
2360 2360 }
2361 2361
2362 2362 .code-body {
2363 border: @border-thickness solid @border-default-color;
2363 border: @border-thickness solid @grey6;
2364 2364 .border-radius(@border-radius);
2365 2365 }
2366 2366
@@ -2380,6 +2380,11 b' div.search-code-body {'
2380 2380 .break { background-color: #DDE7EF; width: 100%; color: #747474; display: block; }
2381 2381 }
2382 2382
2383 .path {
2384 border-bottom: none !important;
2385 border-left: 1px solid @grey6 !important;
2386 border-right: 1px solid @grey6 !important;
2387 }
2383 2388 }
2384 2389
2385 2390 table.rctable td.td-search-results div {
@@ -58,65 +58,50 b''
58 58 %>
59 59 ## search results are additionally filtered, and this check is just a safe gate
60 60 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'):
61 <div id="codeblock" class="codeblock">
62 <div class="codeblock-header">
63 <h1>
64 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
65 ${search.repo_icon(repo_type)}
66 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
67 </h1>
68 ## level 1
69 <div class="file-container">
61 <div class="codeblock">
62 <h1>
63 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 ${search.repo_icon(repo_type)}
65 ${h.link_to(entry['repository'], h.route_path('repo_summary', repo_name=entry['repository']))}
66 </h1>
70 67
71 <div class="pull-left">
72 <span class="stats-filename">
73 <strong>
74 <i class="icon-file-text"></i>
75 ${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']))}
76 </strong>
77 </span>
78 <span class="item last">
79 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${entry['f_path']}" title="${_('Copy the full path')}"></i>
80 </span>
68 <div class="codeblock-header">
69
70 <div class="file-filename">
71 <i class="icon-file"></i> ${entry['f_path'].split('/')[-1]}
81 72 </div>
82 73
83 <div class="pull-right">
84 <div class="buttons">
85 <a id="file_history_overview_full" href="${h.route_path('repo_commits_file',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
86 ${_('Show Full History')}
87 </a>
88 | ${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','')))}
89 | ${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','')))}
90 | ${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','')))}
91 </div>
74 <div class="file-stats">
75 <div class="stats-info">
76 <span class="stats-first-item">
77 ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
78 (${len(matching_lines)} ${_ungettext('matched', 'matched', len(matching_lines))})
79 </span>
80 <span>
81 % if entry.get('size'):
82 | ${h.format_byte_size_binary(entry['size'])}
83 % endif
84 </span>
85 <span>
86 % if entry.get('mimetype'):
87 | ${entry.get('mimetype', "unknown mimetype")}
88 % endif
89 </span>
90 </div>
91 </div>
92 </div>
93
94 <div class="path clear-fix">
95 <div class="pull-left">
96 ${h.files_breadcrumbs(entry['repository'],entry.get('commit_id', 'tip'),entry['f_path'], linkify_last_item=True)}
92 97 </div>
93 98
94 </div>
95 ## level 2
96 <div class="file-container">
97
98 <div class="pull-left">
99 <span class="stats-first-item">
100 %if entry.get('lines'):
101 ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
102 (${len(matching_lines)} ${_ungettext('matched', 'matched', len(matching_lines))})
103 %endif
104 </span>
105
106 <span>
107 %if entry.get('size'):
108 | ${h.format_byte_size_binary(entry['size'])}
109 %endif
110 </span>
111
112 <span>
113 %if entry.get('mimetype'):
114 | ${entry.get('mimetype', "unknown mimetype")}
115 %endif
116 </span>
117 </div>
118
119 <div class="pull-right">
99 <div class="pull-right stats">
100 ## <a id="file_history_overview_full" href="${h.route_path('repo_commits_file',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
101 ## ${_('Show Full History')}
102 ## </a>
103 ## | ${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','')))}
104 ## | ${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','')))}
120 105 <div class="search-tags">
121 106
122 107 <% repo_group = entry.get('repository_group')%>
@@ -135,13 +120,13 b''
135 120 </span>
136 121 % endif
137 122 </div>
138 </div>
139
140 </div>
141 123
124 </div>
125 <div class="clear-fix"></div>
142 126 </div>
143 <div class="code-body search-code-body">
127
144 128
129 <div class="code-body search-code-body clear-fix">
145 130 ${highlight_text_file(
146 131 has_matched_content=has_matched_content,
147 132 file_content=file_content,
General Comments 0
You need to be logged in to leave comments. Login now