Changeset - e6c802a8dede
[Not reviewed]
default
0 3 0
Marcin Kuzminski - 15 years ago 2010-05-25 19:31:56
marcin@python-works.com
repo edit
3 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/repos.py
Show inline comments
 
@@ -79,16 +79,18 @@ class ReposController(BaseController):
 
        shutil.move(os.path.join(rm_path, '.hg'), os.path.join(rm_path, 'rm__.hg'))
 
        shutil.move(rm_path, os.path.join(path, 'rm__%s-%s' % (datetime.today(), id)))
 
        
 
        #clear our cached list for refresh with new repo
 
        invalidate_cache('cached_repo_list')
 
                    
 
        return redirect(url('repos'))
 
        
 

	
 
    def show(self, id, format='html'):
 
        """GET /repos/id: Show a specific item"""
 
        # url('repo', id=ID)
 
        return render('/repos_show.html')
 
        
 
    def edit(self, id, format='html'):
 
        """GET /repos/id/edit: Form to edit an existing item"""
 
        # url('edit_repo', id=ID)
 
        c.new_repo = id
 
        return render('admin/repos/repo_edit.html')
pylons_app/templates/admin/repos/repo_edit.html
Show inline comments
 
@@ -6,35 +6,35 @@
 
</%def>
 
<%def name="breadcrumbs()">
 
	${h.link_to(u'Admin',h.url('admin_home'))}
 
	 /  
 
</%def>
 
<%def name="page_nav()">
 
	${self.menu('admin')}
 
	${self.submenu('repos')}
 
</%def>
 
<%def name="main()">
 
	<div>
 
        <h2>${_('Repositories')} - ${_('edit')}</h2>
 
        ${h.form(url('repos'))}
 
        ${h.form(url('repo', id=ID),method='put'))}
 
        <table>
 
        	<tr>
 
        		<td>${_('Name')}</td>
 
        		<td>${h.text('name',c.new_repo)}</td>
 
        	</tr>
 
        	<tr>
 
        		<td>${_('Description')}</td>
 
        		<td>${h.textarea('description',cols=23,rows=5)}</td>
 
        	</tr>
 
        	<tr>
 
        		<td>${_('Private')}</td>
 
        		<td>${h.checkbox('private')}</td>
 
        	</tr>
 
        	<tr>
 
        		<td></td>
 
        		<td>${h.submit('add','add')}</td>
 
        		<td>${h.submit('update','update')}</td>
 
        	</tr>
 
        	        	        	
 
        </table>
 
        ${h.end_form()}
 
    </div>
 
</%def>   
pylons_app/templates/admin/repos/repos.html
Show inline comments
 
@@ -14,25 +14,25 @@
 
</%def>
 
<%def name="main()">
 
	<div>
 
        <h2>${_('Repositories administration')}</h2>
 
        <table class="table_disp">
 
        <tr class="header">
 
            <td>${_('name')}</td>
 
            <td>${_('last revision')}</td>
 
            <td>${_('action')}</td>
 
        </tr>
 
	        %for cnt,repo in enumerate(c.repos_list):
 
	 		<tr class="parity${cnt%2}">
 
			    <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td>
 
			    <td>${h.link_to(repo['name'],h.url('edit_repo',id=repo['name']))}</td>
 
		        <td>r${repo['rev']}:${repo['tip']}</td>
 
                <td>
 
                  ${h.form(url('repo', id=repo['name']),method='delete')}
 
                  	${h.submit('remove','delete',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
 
                  ${h.end_form()}
 
     			</td>
 
			</tr>
 
			%endfor
 
		</table>
 
		<span class="add_icon">${h.link_to(u'add repo',h.url('new_repo'))}</span>    
 
    </div>
 
</%def>    
0 comments (0 inline, 0 general)