##// 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 from sqlalchemy.exc import DatabaseError
30 from sqlalchemy.exc import DatabaseError
31
31
32 from vcs import get_backend
32 from vcs import get_backend
33 from vcs.utils.helpers import get_scm
33 from vcs.exceptions import RepositoryError
34 from vcs.exceptions import RepositoryError, VCSError
35 from vcs.utils.lazy import LazyProperty
34 from vcs.utils.lazy import LazyProperty
36 from vcs.nodes import FileNode
35 from vcs.nodes import FileNode
37
36
@@ -83,21 +82,18 b' class CachedRepoList(object):'
83
82
84 scmr = dbr.scm_instance_cached
83 scmr = dbr.scm_instance_cached
85
84
86 #check permission at this level
85 # check permission at this level
87 if not HasRepoPermissionAny('repository.read',
86 if not HasRepoPermissionAny('repository.read', 'repository.write',
88 'repository.write',
89 'repository.admin')(dbr.repo_name,
87 'repository.admin')(dbr.repo_name,
90 'get repo check'):
88 'get repo check'):
91 continue
89 continue
92
90
93
94 if scmr is None:
91 if scmr is None:
95 log.error('%s this repository is present in database but it '
92 log.error('%s this repository is present in database but it '
96 'cannot be created as an scm instance',
93 'cannot be created as an scm instance',
97 dbr.repo_name)
94 dbr.repo_name)
98 continue
95 continue
99
96
100
101 last_change = scmr.last_change
97 last_change = scmr.last_change
102 tip = h.get_changeset_safe(scmr, 'tip')
98 tip = h.get_changeset_safe(scmr, 'tip')
103
99
@@ -40,7 +40,7 b''
40 <tr>
40 <tr>
41 <th class="left"><a href="#">${_('Group name')}</a></th>
41 <th class="left"><a href="#">${_('Group name')}</a></th>
42 <th class="left"><a href="#">${_('Description')}</a></th>
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 </tr>
44 </tr>
45 </thead>
45 </thead>
46
46
@@ -55,14 +55,17 b''
55 </div>
55 </div>
56 </td>
56 </td>
57 <td>${gr.group_description}</td>
57 <td>${gr.group_description}</td>
58 <td><b>${gr.repositories.count()}</b></td>
58 ##<td><b>${gr.repositories.count()}</b></td>
59 </tr>
59 </tr>
60 % endfor
60 % endfor
61
61
62 </table>
62 </table>
63 <div style="height: 20px"></div>
63 <div style="height: 20px"></div>
64 % endif
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 <thead>
69 <thead>
67 <tr>
70 <tr>
68 <th class="left"></th>
71 <th class="left"></th>
@@ -190,9 +193,25 b''
190
193
191 F.filterTimeout = null;
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 //set initial count for repos
211 //set initial count for repos
194 var nodes = S.query('div.table tr td div a.repo_name');
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 F.updateFilter = function() {
215 F.updateFilter = function() {
197 // Reset timeout
216 // Reset timeout
198 F.filterTimeout = null;
217 F.filterTimeout = null;
@@ -216,7 +235,7 b''
216 }
235 }
217 }
236 }
218 // set new count into dashboard
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 E.on(q_filter,'keyup',function(e){
241 E.on(q_filter,'keyup',function(e){
General Comments 0
You need to be logged in to leave comments. Login now