search: show all results for super-admin, and get repo type from index it if exists.
This commit is contained in:
parent
a36dd33b3c
commit
23771fb157
4 changed files with 22 additions and 17 deletions
|
|
@ -736,6 +736,7 @@ class _RepoChecker(object):
|
|||
_type = repository
|
||||
return _type == self._backend_alias
|
||||
|
||||
|
||||
is_git = _RepoChecker('git')
|
||||
is_hg = _RepoChecker('hg')
|
||||
is_svn = _RepoChecker('svn')
|
||||
|
|
@ -743,7 +744,8 @@ is_svn = _RepoChecker('svn')
|
|||
|
||||
def get_repo_type_by_name(repo_name):
|
||||
repo = Repository.get_by_repo_name(repo_name)
|
||||
return repo.repo_type
|
||||
if repo:
|
||||
return repo.repo_type
|
||||
|
||||
|
||||
def is_svn_without_proxy(repository):
|
||||
|
|
|
|||
|
|
@ -19,14 +19,15 @@
|
|||
</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 commit check'):
|
||||
% if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results commit check'):
|
||||
<tr class="body">
|
||||
<td class="td-componentname">
|
||||
%if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
|
||||
<% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
|
||||
%if repo_type == 'hg':
|
||||
<i class="icon-hg"></i>
|
||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
|
||||
%elif repo_type == 'git':
|
||||
<i class="icon-git"></i>
|
||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
|
||||
%elif repo_type == 'svn':
|
||||
<i class="icon-svn"></i>
|
||||
%endif
|
||||
${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
|
||||
|
|
@ -77,13 +78,13 @@
|
|||
var cid = target_expand.data('commit-id');
|
||||
|
||||
if (target_expand.hasClass('open')){
|
||||
$('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'})
|
||||
$('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'})
|
||||
$('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
|
||||
$('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
|
||||
target_expand.removeClass('open');
|
||||
}
|
||||
else {
|
||||
$('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'})
|
||||
$('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'})
|
||||
$('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'});
|
||||
$('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'});
|
||||
target_expand.addClass('open');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,15 +56,16 @@
|
|||
|
||||
%>
|
||||
## 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 content check'):
|
||||
% if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'):
|
||||
<div id="codeblock" class="codeblock">
|
||||
<div class="codeblock-header">
|
||||
<h1>
|
||||
%if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
|
||||
<% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
|
||||
%if repo_type == 'hg':
|
||||
<i class="icon-hg"></i>
|
||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
|
||||
%elif repo_type == 'git':
|
||||
<i class="icon-git"></i>
|
||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
|
||||
%elif repo_type == 'svn':
|
||||
<i class="icon-svn"></i>
|
||||
%endif
|
||||
${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,15 @@
|
|||
</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'):
|
||||
% if c.rhodecode_user.is_admin or 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':
|
||||
<% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
|
||||
%if repo_type == 'hg':
|
||||
<i class="icon-hg"></i>
|
||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
|
||||
%elif repo_type == 'git':
|
||||
<i class="icon-git"></i>
|
||||
%elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
|
||||
%elif repo_type == 'svn':
|
||||
<i class="icon-svn"></i>
|
||||
%endif
|
||||
${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue