##// END OF EJS Templates
search: show all results for super-admin, and get repo type from index it if exists.
marcink -
r3376:27e2bdc5 default
parent child Browse files
Show More
@@ -736,6 +736,7 b' class _RepoChecker(object):'
736 736 _type = repository
737 737 return _type == self._backend_alias
738 738
739
739 740 is_git = _RepoChecker('git')
740 741 is_hg = _RepoChecker('hg')
741 742 is_svn = _RepoChecker('svn')
@@ -743,7 +744,8 b" is_svn = _RepoChecker('svn')"
743 744
744 745 def get_repo_type_by_name(repo_name):
745 746 repo = Repository.get_by_repo_name(repo_name)
746 return repo.repo_type
747 if repo:
748 return repo.repo_type
747 749
748 750
749 751 def is_svn_without_proxy(repository):
@@ -19,14 +19,15 b''
19 19 </tr>
20 20 %for entry in c.formatted_results:
21 21 ## search results are additionally filtered, and this check is just a safe gate
22 % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results commit check'):
22 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results commit check'):
23 23 <tr class="body">
24 24 <td class="td-componentname">
25 %if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
25 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
26 %if repo_type == 'hg':
26 27 <i class="icon-hg"></i>
27 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
28 %elif repo_type == 'git':
28 29 <i class="icon-git"></i>
29 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
30 %elif repo_type == 'svn':
30 31 <i class="icon-svn"></i>
31 32 %endif
32 33 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
@@ -77,13 +78,13 b''
77 78 var cid = target_expand.data('commit-id');
78 79
79 80 if (target_expand.hasClass('open')){
80 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'})
81 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'})
81 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
82 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
82 83 target_expand.removeClass('open');
83 84 }
84 85 else {
85 $('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'})
86 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'})
86 $('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'});
87 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'});
87 88 target_expand.addClass('open');
88 89 }
89 90 });
@@ -56,15 +56,16 b''
56 56
57 57 %>
58 58 ## search results are additionally filtered, and this check is just a safe gate
59 % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'):
59 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results content check'):
60 60 <div id="codeblock" class="codeblock">
61 61 <div class="codeblock-header">
62 62 <h1>
63 %if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
63 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
64 %if repo_type == 'hg':
64 65 <i class="icon-hg"></i>
65 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
66 %elif repo_type == 'git':
66 67 <i class="icon-git"></i>
67 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
68 %elif repo_type == 'svn':
68 69 <i class="icon-svn"></i>
69 70 %endif
70 71 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
@@ -9,14 +9,15 b''
9 9 </tr>
10 10 %for entry in c.formatted_results:
11 11 ## search results are additionally filtered, and this check is just a safe gate
12 % if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results path check'):
12 % if c.rhodecode_user.is_admin or h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(entry['repository'], 'search results path check'):
13 13 <tr class="body">
14 14 <td class="td-componentname">
15 %if h.get_repo_type_by_name(entry.get('repository')) == 'hg':
15 <% repo_type = entry.get('repo_type') or h.get_repo_type_by_name(entry.get('repository')) %>
16 %if repo_type == 'hg':
16 17 <i class="icon-hg"></i>
17 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
18 %elif repo_type == 'git':
18 19 <i class="icon-git"></i>
19 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
20 %elif repo_type == 'svn':
20 21 <i class="icon-svn"></i>
21 22 %endif
22 23 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
General Comments 0
You need to be logged in to leave comments. Login now