##// END OF EJS Templates
added welcome message if no repositories are present in current view
marcink -
r1437:7a46d67c beta
parent child Browse files
Show More
@@ -30,8 +30,7 b' import logging'
30 30 from sqlalchemy.exc import DatabaseError
31 31
32 32 from vcs import get_backend
33 from vcs.utils.helpers import get_scm
34 from vcs.exceptions import RepositoryError, VCSError
33 from vcs.exceptions import RepositoryError
35 34 from vcs.utils.lazy import LazyProperty
36 35 from vcs.nodes import FileNode
37 36
@@ -83,21 +82,18 b' class CachedRepoList(object):'
83 82
84 83 scmr = dbr.scm_instance_cached
85 84
86 #check permission at this level
87 if not HasRepoPermissionAny('repository.read',
88 'repository.write',
85 # check permission at this level
86 if not HasRepoPermissionAny('repository.read', 'repository.write',
89 87 'repository.admin')(dbr.repo_name,
90 88 'get repo check'):
91 89 continue
92 90
93
94 91 if scmr is None:
95 92 log.error('%s this repository is present in database but it '
96 93 'cannot be created as an scm instance',
97 94 dbr.repo_name)
98 95 continue
99 96
100
101 97 last_change = scmr.last_change
102 98 tip = h.get_changeset_safe(scmr, 'tip')
103 99
@@ -40,7 +40,7 b''
40 40 <tr>
41 41 <th class="left"><a href="#">${_('Group name')}</a></th>
42 42 <th class="left"><a href="#">${_('Description')}</a></th>
43 <th class="left"><a href="#">${_('Number of repositories')}</a></th>
43 ##<th class="left"><a href="#">${_('Number of repositories')}</a></th>
44 44 </tr>
45 45 </thead>
46 46
@@ -55,14 +55,17 b''
55 55 </div>
56 56 </td>
57 57 <td>${gr.group_description}</td>
58 <td><b>${gr.repositories.count()}</b></td>
58 ##<td><b>${gr.repositories.count()}</b></td>
59 59 </tr>
60 60 % endfor
61 61
62 62 </table>
63 63 <div style="height: 20px"></div>
64 64 % endif
65 <table>
65 <div id="welcome" style="display:none;text-align:center">
66 <h1><a href="${h.url('home')}">${c.rhodecode_name} ${c.rhodecode_version}</a></h1>
67 </div>
68 <table id="repos_list">
66 69 <thead>
67 70 <tr>
68 71 <th class="left"></th>
@@ -190,9 +193,25 b''
190 193
191 194 F.filterTimeout = null;
192 195
196 function set_count(count){
197
198 if(count == 0){
199 YUD.setStyle('repos_list','display','none');
200 YUD.setStyle('welcome','display','');
201 }
202 else{
203 YUD.setStyle('repos_list','display','');
204 YUD.setStyle('welcome','display','none');
205 }
206 YUD.get('repo_count').innerHTML = count;
207
208 }
209
210
193 211 //set initial count for repos
194 212 var nodes = S.query('div.table tr td div a.repo_name');
195 YUD.get('repo_count').innerHTML = nodes.length;
213
214 set_count(nodes.length)
196 215 F.updateFilter = function() {
197 216 // Reset timeout
198 217 F.filterTimeout = null;
@@ -216,7 +235,7 b''
216 235 }
217 236 }
218 237 // set new count into dashboard
219 YUD.get('repo_count').innerHTML = nodes.length - obsolete.length;
238 set_count(nodes.length - obsolete.length)
220 239 }
221 240
222 241 E.on(q_filter,'keyup',function(e){
General Comments 0
You need to be logged in to leave comments. Login now