##// END OF EJS Templates
fixed deletion of repository on filesystem, works based on scm type for git and hg....
marcink -
r668:dff6d5cb beta
parent child Browse files
Show More
@@ -94,7 +94,7 b' class _ToolTip(object):'
94 var tts = YAHOO.util.Dom.getElementsByClassName('tooltip');
94 var tts = YAHOO.util.Dom.getElementsByClassName('tooltip');
95
95
96 for (var i = 0; i < tts.length; i++) {
96 for (var i = 0; i < tts.length; i++) {
97 //if element doesn not have and id autgenerate one for tooltip
97 //if element doesn't not have and id autgenerate one for tooltip
98
98
99 if (!tts[i].id){
99 if (!tts[i].id){
100 tts[i].id='tt'+i*100;
100 tts[i].id='tt'+i*100;
@@ -112,7 +112,7 b' class _ToolTip(object):'
112 showdelay:20,
112 showdelay:20,
113 });
113 });
114
114
115 //Mouse Over event disabled for new repositories since they dont
115 //Mouse Over event disabled for new repositories since they don't
116 //have last commit message
116 //have last commit message
117 myToolTips.contextMouseOverEvent.subscribe(
117 myToolTips.contextMouseOverEvent.subscribe(
118 function(type, args) {
118 function(type, args) {
@@ -347,9 +347,11 b' def _age(curdate):'
347 for scale in agescales:
347 for scale in agescales:
348 if scale[1] <= age_seconds:
348 if scale[1] <= age_seconds:
349 if pos == 6:pos = 5
349 if pos == 6:pos = 5
350 return time_ago_in_words(curdate, agescales[pos][0])
350 return time_ago_in_words(curdate, agescales[pos][0]) + ' ' + _('ago')
351 pos += 1
351 pos += 1
352
352
353 return _('just now')
354
353 age = lambda x:_age(x)
355 age = lambda x:_age(x)
354 capitalize = lambda x: x.capitalize()
356 capitalize = lambda x: x.capitalize()
355 email = util.email
357 email = util.email
@@ -164,8 +164,8 b' class RepoModel(object):'
164 def delete(self, repo):
164 def delete(self, repo):
165 try:
165 try:
166 self.sa.delete(repo)
166 self.sa.delete(repo)
167 self.__delete_repo(repo)
167 self.sa.commit()
168 self.sa.commit()
168 self.__delete_repo(repo.repo_name)
169 except:
169 except:
170 log.error(traceback.format_exc())
170 log.error(traceback.format_exc())
171 self.sa.rollback()
171 self.sa.rollback()
@@ -200,11 +200,13 b' class RepoModel(object):'
200 new_path)
200 new_path)
201 shutil.move(old_path, new_path)
201 shutil.move(old_path, new_path)
202
202
203 def __delete_repo(self, name):
203 def __delete_repo(self, repo):
204 rm_path = os.path.join(g.base_path, name)
204 rm_path = os.path.join(g.base_path, repo.repo_name)
205 log.info("Removing %s", rm_path)
205 log.info("Removing %s", rm_path)
206 #disable hg
206 #disable hg/git
207 shutil.move(os.path.join(rm_path, '.hg'), os.path.join(rm_path, 'rm__.hg'))
207 alias = repo.repo_type
208 shutil.move(os.path.join(rm_path, '.%s' % alias),
209 os.path.join(rm_path, 'rm__.%s' % alias))
208 #disable repo
210 #disable repo
209 shutil.move(rm_path, os.path.join(g.base_path, 'rm__%s__%s' \
211 shutil.move(rm_path, os.path.join(g.base_path, 'rm__%s__%s' \
210 % (datetime.today(), name)))
212 % (datetime.today(), repo.repo_name)))
@@ -259,7 +259,6 b' background-position:0 -40px;'
259 #header #header-inner #logo h1 {
259 #header #header-inner #logo h1 {
260 color:#FFF;
260 color:#FFF;
261 font-size:14px;
261 font-size:14px;
262 text-transform:uppercase;
263 margin:13px 0 0 13px;
262 margin:13px 0 0 13px;
264 padding:0;
263 padding:0;
265 }
264 }
@@ -419,7 +418,7 b' padding:12px 9px 7px 24px;'
419 }
418 }
420
419
421 #header #header-inner #quick li ul li a.repos,#header #header-inner #quick li ul li a.repos:hover {
420 #header #header-inner #quick li ul li a.repos,#header #header-inner #quick li ul li a.repos:hover {
422 background:url("../images/icons/folder_edit.png") no-repeat scroll 4px 9px #FFF;
421 background:url("../images/icons/database_edit.png") no-repeat scroll 4px 9px #FFF;
423 width:167px;
422 width:167px;
424 margin:0;
423 margin:0;
425 padding:12px 9px 7px 24px;
424 padding:12px 9px 7px 24px;
@@ -1393,7 +1392,6 b' background-color:#003367;'
1393 color:#FFF;
1392 color:#FFF;
1394 display:block;
1393 display:block;
1395 min-width:20px;
1394 min-width:20px;
1396 max-width:400px;
1397 text-decoration:none;
1395 text-decoration:none;
1398 height:12px;
1396 height:12px;
1399 margin-bottom:4px;
1397 margin-bottom:4px;
@@ -65,7 +65,7 b''
65 </td>
65 </td>
66 <td>
66 <td>
67 %if node.is_file():
67 %if node.is_file():
68 ${node.last_changeset.date} - ${h.age(node.last_changeset.date)} ${_('ago')}
68 ${node.last_changeset.date} - ${h.age(node.last_changeset.date)}
69 %endif
69 %endif
70 </td>
70 </td>
71 <td>
71 <td>
@@ -54,9 +54,9 b''
54 </thead>
54 </thead>
55 <tbody>
55 <tbody>
56 %for cnt,repo in enumerate(c.repos_list):
56 %for cnt,repo in enumerate(c.repos_list):
57 %if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(repo['name'],'main page check'):
58 <tr class="parity${cnt%2}">
57 <tr class="parity${cnt%2}">
59 <td>
58 <td>
59 <div style="white-space: nowrap">
60 ## TYPE OF REPO
60 ## TYPE OF REPO
61 %if repo['repo'].dbrepo.repo_type =='hg':
61 %if repo['repo'].dbrepo.repo_type =='hg':
62 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
62 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
@@ -82,6 +82,7 b''
82 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
82 title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}"
83 src="/images/icons/arrow_divide.png"/></a>
83 src="/images/icons/arrow_divide.png"/></a>
84 %endif
84 %endif
85 </div>
85 </td>
86 </td>
86 ##DESCRIPTION
87 ##DESCRIPTION
87 <td><span class="tooltip" tooltip_title="${repo['description']}">
88 <td><span class="tooltip" tooltip_title="${repo['description']}">
@@ -89,7 +90,8 b''
89 </td>
90 </td>
90 ##LAST CHANGE
91 ##LAST CHANGE
91 <td>
92 <td>
92 <span>${repo['last_change']} - ${h.age(repo['last_change'])} </span>
93 <span class="tooltip" tooltip_title="${h.age(repo['last_change'])}">
94 ${repo['last_change']}</span>
93 </td>
95 </td>
94 <td>
96 <td>
95 %if repo['rev']>=0:
97 %if repo['rev']>=0:
@@ -109,7 +111,6 b''
109 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
111 <a title="${_('Subscribe to %s atom feed')%repo['name']}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=repo['name'])}"></a>
110 </td>
112 </td>
111 </tr>
113 </tr>
112 %endif
113 %endfor
114 %endfor
114 </tbody>
115 </tbody>
115 </table>
116 </table>
@@ -136,10 +137,10 b''
136 F.filterTimeout = null;
137 F.filterTimeout = null;
137
138
138 var obsolete = [];
139 var obsolete = [];
139 var nodes = S.query('div.table tr td a.repo_name');
140 var nodes = S.query('div.table tr td div a.repo_name');
140 var req = D.get('q_filter').value;
141 var req = D.get('q_filter').value;
141 for (n in nodes){
142 for (n in nodes){
142 D.setStyle(nodes[n].parentNode.parentNode,'display','')
143 D.setStyle(nodes[n].parentNode.parentNode.parentNode,'display','')
143 }
144 }
144 if (req){
145 if (req){
145 for (n in nodes){
146 for (n in nodes){
@@ -149,7 +150,7 b''
149 }
150 }
150 if(obsolete){
151 if(obsolete){
151 for (n in obsolete){
152 for (n in obsolete){
152 D.setStyle(obsolete[n].parentNode.parentNode,'display','none');
153 D.setStyle(obsolete[n].parentNode.parentNode.parentNode,'display','none');
153 }
154 }
154 }
155 }
155 }
156 }
General Comments 0
You need to be logged in to leave comments. Login now