##// END OF EJS Templates
search: in path search add lines/size information similar like in content matches since we have those information in ES.
dan -
r3322:186655dc default
parent child Browse files
Show More
@@ -1,38 +1,49 b''
1 % if c.formatted_results:
1 % if c.formatted_results:
2
2
3 <table class="rctable search-results">
3 <table class="rctable search-results">
4 <tr>
4 <tr>
5 <th>${_('Repository')}</th>
5 <th>${_('Repository')}</th>
6 <th>${_('File')}</th>
6 <th>${_('File')}</th>
7 ##TODO: add 'Last Change' and 'Author' here
7 <th>${_('Size')}</th>
8 <th>${_('Lines')}</th>
8 </tr>
9 </tr>
9 %for entry in c.formatted_results:
10 %for entry in c.formatted_results:
10 ## search results are additionally filtered, and this check is just a safe gate
11 ## search results are additionally filtered, and this check is just a safe gate
11 % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results path check'):
12 % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results path check'):
12 <tr class="body">
13 <tr class="body">
13 <td class="td-componentname">
14 <td class="td-componentname">
14 %if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
15 %if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
15 <i class="icon-hg"></i>
16 <i class="icon-hg"></i>
16 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
17 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
17 <i class="icon-git"></i>
18 <i class="icon-git"></i>
18 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
19 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
19 <i class="icon-svn"></i>
20 <i class="icon-svn"></i>
20 %endif
21 %endif
21 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
22 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
22 </td>
23 </td>
23 <td class="td-componentname">
24 <td class="td-componentname">
24 ${h.link_to(h.literal(entry['f_path']),
25 ${h.link_to(h.literal(entry['f_path']),
25 h.route_path('repo_files',repo_name=entry['repository'],commit_id='tip',f_path=entry['f_path']))}
26 h.route_path('repo_files',repo_name=entry['repository'],commit_id='tip',f_path=entry['f_path']))}
26 </td>
27 </td>
28 <td>
29 %if entry.get('size'):
30 ${h.format_byte_size_binary(entry['size'])}
31 %endif
32 </td>
33 <td>
34 %if entry.get('lines'):
35 ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
36 %endif
37 </td>
27 </tr>
38 </tr>
28 % endif
39 % endif
29 %endfor
40 %endfor
30 </table>
41 </table>
31
42
32 %if c.cur_query:
43 %if c.cur_query:
33 <div class="pagination-wh pagination-left">
44 <div class="pagination-wh pagination-left">
34 ${c.formatted_results.pager('$link_previous ~2~ $link_next')}
45 ${c.formatted_results.pager('$link_previous ~2~ $link_next')}
35 </div>
46 </div>
36 %endif
47 %endif
37
48
38 % endif
49 % endif
General Comments 0
You need to be logged in to leave comments. Login now