##// 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 files_icon = icon = '<i class="file-breadcrumb-copy tooltip icon-clipboard clipboard-action" data-clipboard-text="{}" title="Copy the full path"></i>'
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 if isinstance(file_path, str):
226 if isinstance(file_path, str):
226 file_path = safe_unicode(file_path)
227 file_path = safe_unicode(file_path)
227
228
@@ -247,7 +248,12 b' def files_breadcrumbs(repo_name, commit_'
247 continue
248 continue
248 segment_html = escape(segment)
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 url_segments.append(
257 url_segments.append(
252 link_to(
258 link_to(
253 segment_html,
259 segment_html,
@@ -257,9 +263,7 b' def files_breadcrumbs(repo_name, commit_'
257 commit_id=commit_id,
263 commit_id=commit_id,
258 f_path='/'.join(path_segments[:cnt + 1]),
264 f_path='/'.join(path_segments[:cnt + 1]),
259 _query=route_qry),
265 _query=route_qry),
260 ))
266 ))
261 else:
262 url_segments.append(segment_html)
263
267
264 limited_url_segments = url_segments[:1] + ['...'] + url_segments[-5:]
268 limited_url_segments = url_segments[:1] + ['...'] + url_segments[-5:]
265 if limit_items and len(limited_url_segments) < len(url_segments):
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 .code-body {
2362 .code-body {
2363 border: @border-thickness solid @border-default-color;
2363 border: @border-thickness solid @grey6;
2364 .border-radius(@border-radius);
2364 .border-radius(@border-radius);
2365 }
2365 }
2366
2366
@@ -2380,6 +2380,11 b' div.search-code-body {'
2380 .break { background-color: #DDE7EF; width: 100%; color: #747474; display: block; }
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 table.rctable td.td-search-results div {
2390 table.rctable td.td-search-results div {
@@ -58,65 +58,50 b''
58 %>
58 %>
59 ## search results are additionally filtered, and this check is just a safe gate
59 ## search results are additionally filtered, and this check is just a safe gate
60 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'):
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">
61 <div class="codeblock">
62 <div class="codeblock-header">
62 <h1>
63 <h1>
63 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 ${search.repo_icon(repo_type)}
65 ${search.repo_icon(repo_type)}
65 ${h.link_to(entry['repository'], h.route_path('repo_summary', repo_name=entry['repository']))}
66 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
66 </h1>
67 </h1>
68 ## level 1
69 <div class="file-container">
70
67
71 <div class="pull-left">
68 <div class="codeblock-header">
72 <span class="stats-filename">
69
73 <strong>
70 <div class="file-filename">
74 <i class="icon-file-text"></i>
71 <i class="icon-file"></i> ${entry['f_path'].split('/')[-1]}
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>
81 </div>
72 </div>
82
73
83 <div class="pull-right">
74 <div class="file-stats">
84 <div class="buttons">
75 <div class="stats-info">
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',''))}">
76 <span class="stats-first-item">
86 ${_('Show Full History')}
77 ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
87 </a>
78 (${len(matching_lines)} ${_ungettext('matched', 'matched', len(matching_lines))})
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','')))}
79 </span>
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','')))}
80 <span>
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','')))}
81 % if entry.get('size'):
91 </div>
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 </div>
97 </div>
93
98
94 </div>
99 <div class="pull-right stats">
95 ## level 2
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',''))}">
96 <div class="file-container">
101 ## ${_('Show Full History')}
97
102 ## </a>
98 <div class="pull-left">
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','')))}
99 <span class="stats-first-item">
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','')))}
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">
120 <div class="search-tags">
105 <div class="search-tags">
121
106
122 <% repo_group = entry.get('repository_group')%>
107 <% repo_group = entry.get('repository_group')%>
@@ -135,13 +120,13 b''
135 </span>
120 </span>
136 % endif
121 % endif
137 </div>
122 </div>
138 </div>
139
140 </div>
141
123
124 </div>
125 <div class="clear-fix"></div>
142 </div>
126 </div>
143 <div class="code-body search-code-body">
127
144
128
129 <div class="code-body search-code-body clear-fix">
145 ${highlight_text_file(
130 ${highlight_text_file(
146 has_matched_content=has_matched_content,
131 has_matched_content=has_matched_content,
147 file_content=file_content,
132 file_content=file_content,
General Comments 0
You need to be logged in to leave comments. Login now