##// 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 _type = repository
736 _type = repository
737 return _type == self._backend_alias
737 return _type == self._backend_alias
738
738
739
739 is_git = _RepoChecker('git')
740 is_git = _RepoChecker('git')
740 is_hg = _RepoChecker('hg')
741 is_hg = _RepoChecker('hg')
741 is_svn = _RepoChecker('svn')
742 is_svn = _RepoChecker('svn')
@@ -743,6 +744,7 b" is_svn = _RepoChecker('svn')"
743
744
744 def get_repo_type_by_name(repo_name):
745 def get_repo_type_by_name(repo_name):
745 repo = Repository.get_by_repo_name(repo_name)
746 repo = Repository.get_by_repo_name(repo_name)
747 if repo:
746 return repo.repo_type
748 return repo.repo_type
747
749
748
750
@@ -19,14 +19,15 b''
19 </tr>
19 </tr>
20 %for entry in c.formatted_results:
20 %for entry in c.formatted_results:
21 ## search results are additionally filtered, and this check is just a safe gate
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 <tr class="body">
23 <tr class="body">
24 <td class="td-componentname">
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 <i class="icon-hg"></i>
27 <i class="icon-hg"></i>
27 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
28 %elif repo_type == 'git':
28 <i class="icon-git"></i>
29 <i class="icon-git"></i>
29 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
30 %elif repo_type == 'svn':
30 <i class="icon-svn"></i>
31 <i class="icon-svn"></i>
31 %endif
32 %endif
32 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
33 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
@@ -77,13 +78,13 b''
77 var cid = target_expand.data('commit-id');
78 var cid = target_expand.data('commit-id');
78
79
79 if (target_expand.hasClass('open')){
80 if (target_expand.hasClass('open')){
80 $('#c-'+cid).css({'height': '1.5em', 'white-space': 'nowrap', 'text-overflow': 'ellipsis', 'overflow':'hidden'})
81 $('#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'})
82 $('#t-'+cid).css({'height': 'auto', 'line-height': '.9em', 'text-overflow': 'ellipsis', 'overflow':'hidden'});
82 target_expand.removeClass('open');
83 target_expand.removeClass('open');
83 }
84 }
84 else {
85 else {
85 $('#c-'+cid).css({'height': 'auto', 'white-space': 'normal', 'text-overflow': 'initial', 'overflow':'visible'})
86 $('#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'})
87 $('#t-'+cid).css({'height': 'auto', 'max-height': 'none', 'text-overflow': 'initial', 'overflow':'visible'});
87 target_expand.addClass('open');
88 target_expand.addClass('open');
88 }
89 }
89 });
90 });
@@ -56,15 +56,16 b''
56
56
57 %>
57 %>
58 ## search results are additionally filtered, and this check is just a safe gate
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 <div id="codeblock" class="codeblock">
60 <div id="codeblock" class="codeblock">
61 <div class="codeblock-header">
61 <div class="codeblock-header">
62 <h1>
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 <i class="icon-hg"></i>
65 <i class="icon-hg"></i>
65 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
66 %elif repo_type == 'git':
66 <i class="icon-git"></i>
67 <i class="icon-git"></i>
67 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
68 %elif repo_type == 'svn':
68 <i class="icon-svn"></i>
69 <i class="icon-svn"></i>
69 %endif
70 %endif
70 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
71 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
@@ -9,14 +9,15 b''
9 </tr>
9 </tr>
10 %for entry in c.formatted_results:
10 %for entry in c.formatted_results:
11 ## 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
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 <tr class="body">
13 <tr class="body">
14 <td class="td-componentname">
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 <i class="icon-hg"></i>
17 <i class="icon-hg"></i>
17 %elif h.get_repo_type_by_name(entry.get('repository')) == 'git':
18 %elif repo_type == 'git':
18 <i class="icon-git"></i>
19 <i class="icon-git"></i>
19 %elif h.get_repo_type_by_name(entry.get('repository')) == 'svn':
20 %elif repo_type == 'svn':
20 <i class="icon-svn"></i>
21 <i class="icon-svn"></i>
21 %endif
22 %endif
22 ${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
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