search_path.mako
53 lines
| 1.9 KiB
| application/x-mako
|
MakoHtmlLexer
r3467 | <%namespace name="search" file="/search/search.mako"/> | |||
r3319 | % if c.formatted_results: | |||
r1282 | <table class="rctable search-results"> | |||
<tr> | ||||
<th>${_('Repository')}</th> | ||||
r3963 | <th> | |||
r3968 | <a href="${search.field_sort('file')}">${_('File')}</a> | |||
r3963 | </th> | |||
<th> | ||||
<a href="${search.field_sort('size')}">${_('Size')}</a> | ||||
</th> | ||||
<th> | ||||
<a href="${search.field_sort('lines')}">${_('Lines')}</a> | ||||
</th> | ||||
r1282 | </tr> | |||
%for entry in c.formatted_results: | ||||
## search results are additionally filtered, and this check is just a safe gate | ||||
r3376 | % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results path check'): | |||
r1282 | <tr class="body"> | |||
<td class="td-componentname"> | ||||
r3376 | <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %> | |||
r3467 | ${search.repo_icon(repo_type)} | |||
r1785 | ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))} | |||
r1282 | </td> | |||
<td class="td-componentname"> | ||||
r3963 | <i class="icon-file"></i> | |||
r1282 | ${h.link_to(h.literal(entry['f_path']), | |||
r4372 | h.route_path('repo_files',repo_name=entry['repository'],commit_id=entry.get('commit_id', 'tip'),f_path=entry['f_path']))} | |||
r1282 | </td> | |||
r3322 | <td> | |||
%if entry.get('size'): | ||||
${h.format_byte_size_binary(entry['size'])} | ||||
%endif | ||||
</td> | ||||
<td> | ||||
%if entry.get('lines'): | ||||
r3963 | ${entry.get('lines', 0.)} | |||
r3322 | %endif | |||
</td> | ||||
r1282 | </tr> | |||
% endif | ||||
%endfor | ||||
</table> | ||||
r3319 | %if c.cur_query: | |||
r1282 | <div class="pagination-wh pagination-left"> | |||
r4091 | ${c.formatted_results.render()} | |||
r1282 | </div> | |||
r3319 | %endif | |||
% endif | ||||