Changeset - cfddee9d3693
[Not reviewed]
default
0 3 0
Marcin Kuzminski - 16 years ago 2010-05-03 18:31:00
marcin@python-works.com
Updated summary page
3 files changed with 34 insertions and 8 deletions:
0 comments (0 inline, 0 general)
pylons_app/config/routing.py
Show inline comments
 
@@ -25,20 +25,20 @@ def make_map(config):
 
    #REST controllers
 
    map.resource('repo', 'repos', path_prefix='/_admin')
 
    map.resource('user', 'users', path_prefix='/_admin')
 
    
 
    #ADMIN
 
    with map.submapper(path_prefix='/_admin', controller='admin') as m:
 
        m.connect('admin_home', '/', action='index')#main page
 
        m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', action='add_repo')
 
    
 
    
 
    map.connect('changeset_home', '/{repo_name}/changeset/{revision}', controller='changeset', revision='tip')
 
    map.connect('summary_home', '/{repo_name}/summary', controller='summary')
 
    map.connect('changelog_home', '/{repo_name}/changelog', controller='changelog')
 
    map.connect('changelog_home', '/{repo_name}/changelog/{revision}', controller='changelog', revision='tip')
 
    map.connect('branches_home', '/{repo_name}/branches', controller='branches')
 
    map.connect('tags_home', '/{repo_name}/tags', controller='tags')
 
    map.connect('graph_home', '/{repo_name}/graph/{revision}', controller='graph', revision='tip')    
 
    map.connect('files_home', '/{repo_name}/files/{revision}/{f_path:.*}', controller='files', revision='tip', f_path='')
 
    
 

	
 
    return map
pylons_app/controllers/summary.py
Show inline comments
 
@@ -18,15 +18,15 @@ class SummaryController(BaseController):
 
        hg_model = HgModel()
 
        c.repo_info = hg_model.get_repo(c.repo_name)
 
        c.repo_changesets = c.repo_info.get_changesets(10)
 
        
 
        e = request.environ
 
        uri = r'%(protocol)s://%(user)s@%(host)s/%(repo_name)s' % {
 
                                                'protocol': e.get('wsgi.url_scheme'),
 
                                                'user':e.get('REMOTE_USER'),
 
                                                'host':e.get('HTTP_HOST'),
 
                                                'repo_name':c.repo_name,
 
                                                }
 
        c.clone_repo_url = url(uri)
 
        c.repo_tags = []#c.repo_info.get_tags(limit=10)
 
        c.repo_branches = []#c.repo_info.get_branches(limit=10)
 
        c.repo_tags = c.repo_info.tags[:10]
 
        c.repo_branches = c.repo_info.branches[:10]
 
        return render('/summary.html')
pylons_app/templates/summary.html
Show inline comments
 
@@ -26,25 +26,25 @@ from pylons_app.lib import filters
 

	
 
    <h2 class="no-link no-border">${_('Mercurial Repository Overview')}</h2>
 
    <dl class="overview">
 
        <dt>${_('name')}</dt>
 
        <dd>${c.repo_info.name}</dd>
 
        <dt>${_('description')}</dt>
 
        <dd>${c.repo_info.description}</dd>
 
        <dt>${_('contact')}</dt>
 
        <dd>${c.repo_info.contact}</dd>
 
        <dt>${_('last change')}</dt>
 
        <dd>${c.repo_info.last_change|n,filters.rfc822date} - ${c.repo_info.last_change|n,filters.age}</dd>
 
        <dt>${_('url')}</dt>
 
        <dd><pre>$ hg clone <a href="${c.clone_repo_url}">${c.clone_repo_url}</a></pre></dd>
 
        <dd><pre>hg clone <a href="${c.clone_repo_url}">${c.clone_repo_url}</a></pre></dd>
 
        <dt>${_('Download')}</dt>
 
        <dd>
 
       	%for archive in c.repo_info._get_archives():
 
				| <a href="/${c.repo_info.name}/archive/${archive['node']}${archive['extension']}">
 
				${c.repo_info.name}.${archive['type']}
 
				</a>
 
		%endfor
 
		| 
 
        </dd>
 
    </dl>
 

	
 
    <h2>${h.link_to(_('Changes'),h.url('changelog_home',repo_name=c.repo_name))}</h2>
 
@@ -65,25 +65,51 @@ from pylons_app.lib import filters
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs._short))}
 
			</td>
 
		</tr>
 
	%endfor
 
    </table>
 

	
 
    <h2>${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</h2>
 
    <table>
 
		%for tag in c.repo_tags:
 
			${tag}
 
		%for cnt,tag in enumerate(c.repo_tags):
 
		<tr class="parity${cnt%2}">
 
			<td>${tag._ctx.date()|n,filters.age}</td>
 
			<td></td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span>
 
				</span>
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 

	
 
    <h2>${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</h2>
 
    <table>
 
		%for branch in c.repo_branches:
 
			${branch}
 
		%for cnt,branch in enumerate(c.repo_branches):
 
		<tr class="parity${cnt%2}">
 
			<td>${branch._ctx.date()|n,filters.age}</td>
 
			<td></td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span>
 
				</span>			
 
			</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 

	
 
</%def>    
 
\ No newline at end of file
0 comments (0 inline, 0 general)