search_path.mako
38 lines
| 1.5 KiB
| application/x-mako
|
MakoHtmlLexer
r3319 | % if c.formatted_results: | |||
r1282 | <table class="rctable search-results"> | |||
<tr> | ||||
<th>${_('Repository')}</th> | ||||
<th>${_('File')}</th> | ||||
##TODO: add 'Last Change' and 'Author' here | ||||
</tr> | ||||
%for entry in c.formatted_results: | ||||
## search results are additionally filtered, and this check is just a safe gate | ||||
% if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results path check'): | ||||
<tr class="body"> | ||||
<td class="td-componentname"> | ||||
%if h.get_repo_type_by_name(entry.get('repository')) == 'hg': | ||||
<i class="icon-hg"></i> | ||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'git': | ||||
<i class="icon-git"></i> | ||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'svn': | ||||
<i class="icon-svn"></i> | ||||
%endif | ||||
r1785 | ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))} | |||
r1282 | </td> | |||
<td class="td-componentname"> | ||||
${h.link_to(h.literal(entry['f_path']), | ||||
r1927 | h.route_path('repo_files',repo_name=entry['repository'],commit_id='tip',f_path=entry['f_path']))} | |||
r1282 | </td> | |||
</tr> | ||||
% endif | ||||
%endfor | ||||
</table> | ||||
r3319 | %if c.cur_query: | |||
r1282 | <div class="pagination-wh pagination-left"> | |||
${c.formatted_results.pager('$link_previous ~2~ $link_next')} | ||||
</div> | ||||
r3319 | %endif | |||
% endif | ||||