Changeset - 20dc7a5eb748
pylons_app/controllers/admin.py
Show inline comments
 
@@ -43,7 +43,7 @@ class AdminController(BaseController):
 
            except formencode.Invalid, error:
 
                c.form_result = error.value
 
                c.form_errors = error.error_dict or {}
 
                html = render('/admin.html')
 
                html = render('admin/admin.html')
 

	
 
                return htmlfill.render(
 
                    html,
 
@@ -57,10 +57,10 @@ class AdminController(BaseController):
 
                .order_by(UserLogs.action_date.desc())
 
            p = int(request.params.get('page', 1))
 
            c.users_log = Page(users_log, page=p, items_per_page=10)
 
            c.log_data = render('admin_log.html')
 
            c.log_data = render('admin/admin_log.html')
 
            if request.params.get('partial'):
 
                return c.log_data
 
        return render('/admin.html')
 
        return render('admin/admin.html')
 

	
 
    def hgrc(self, dirname):
 
        filename = os.path.join(dirname, '.hg', 'hgrc')
pylons_app/controllers/branches.py
Show inline comments
 
import logging
 

	
 
from pylons import request, response, session, tmpl_context as c, url
 
from pylons import tmpl_context as c, app_globals as g, session, request, config, url
 
from pylons.controllers.util import abort, redirect
 

	
 
from pylons_app.lib.base import BaseController, render
 
from pylons_app.lib.utils import get_repo_slug
 
from pylons_app.model.hg_model import HgModel
 
log = logging.getLogger(__name__)
 

	
 
log = logging.getLogger(__name__)
 

	
 
class BranchesController(BaseController):
 
    def __before__(self):
 
        c.repos_prefix = config['repos_name']
 
        c.repo_name = get_repo_slug(request)
 

	
 
    def index(self):
 
        # Return a rendered template
 
        #return render('/branches.mako')
 
        # or, return a string
 
        return 'Hello World'
 
        hg_model = HgModel()
 
        c.repo_info = hg_model.get_repo(c.repo_name)
 
        c.repo_branches = c.repo_info.branches
 
                
 
        return render('branches/branches.html')
pylons_app/controllers/changelog.py
Show inline comments
 
@@ -13,17 +13,15 @@ log = logging.getLogger(__name__)
 
class ChangelogController(BaseController):
 
    def __before__(self):
 
        c.repos_prefix = config['repos_name']
 
        
 
        c.repo_name = get_repo_slug(request)
 
        
 
        
 
    def index(self):
 
        hg_model = HgModel()
 
        p = int(request.params.get('page', 1))
 
        repo = hg_model.get_repo(c.repo_name)
 
        c.repo_changesets = Page(repo, page=p, items_per_page=20)
 
        c.shortlog_data = render('shortlog_data.html')
 
        c.shortlog_data = render('shortlog/shortlog_data.html')
 
        if request.params.get('partial'):
 
            return c.shortlog_data
 
        r = render('/shortlog.html')
 
        r = render('shortlog/shortlog.html')
 
        return r
pylons_app/controllers/repos.py
Show inline comments
 
@@ -31,7 +31,7 @@ class ReposController(BaseController):
 
        hg_model = HgModel()
 
        c.repos_list = list(hg_model.get_repos())
 
        c.repos_list.sort(key=itemgetter('name'))
 
        return render('/repos.html')
 
        return render('admin/repos/repos.html')
 
    
 
    def create(self):
 
        """POST /repos: Create a new item"""
pylons_app/controllers/shortlog.py
Show inline comments
 
@@ -13,17 +13,15 @@ log = logging.getLogger(__name__)
 
class ShortlogController(BaseController):
 
    def __before__(self):
 
        c.repos_prefix = config['repos_name']
 
        
 
        c.repo_name = get_repo_slug(request)
 
        
 
        
 
    def index(self):
 
        hg_model = HgModel()
 
        p = int(request.params.get('page', 1))
 
        repo = hg_model.get_repo(c.repo_name)
 
        c.repo_changesets = Page(repo, page=p, items_per_page=20)
 
        c.shortlog_data = render('shortlog_data.html')
 
        c.shortlog_data = render('shortlog/shortlog_data.html')
 
        if request.params.get('partial'):
 
            return c.shortlog_data
 
        r = render('/shortlog.html')
 
        r = render('shortlog/shortlog.html')
 
        return r
pylons_app/controllers/summary.py
Show inline comments
 
@@ -11,7 +11,6 @@ log = logging.getLogger(__name__)
 
class SummaryController(BaseController):
 
    def __before__(self):
 
        c.repos_prefix = config['repos_name']
 
        
 
        c.repo_name = get_repo_slug(request)
 
        
 
    def index(self):
pylons_app/controllers/tags.py
Show inline comments
 
import logging
 

	
 
from pylons import request, response, session, tmpl_context as c, url
 
from pylons import tmpl_context as c, app_globals as g, session, request, config, url
 
from pylons.controllers.util import abort, redirect
 

	
 
from pylons_app.lib.base import BaseController, render
 
from pylons_app.lib.utils import get_repo_slug
 
from pylons_app.model.hg_model import HgModel
 
log = logging.getLogger(__name__)
 

	
 
log = logging.getLogger(__name__)
 

	
 
class TagsController(BaseController):
 
    def __before__(self):
 
        c.repos_prefix = config['repos_name']
 
        c.repo_name = get_repo_slug(request)
 

	
 
    def index(self):
 
        # Return a rendered template
 
        #return render('/tags.mako')
 
        # or, return a string
 
        return 'Hello World'
 
        hg_model = HgModel()
 
        c.repo_info = hg_model.get_repo(c.repo_name)
 
        c.repo_tags = c.repo_info.tags
 
        
 
        return render('tags/tags.html')
pylons_app/controllers/users.py
Show inline comments
 
@@ -30,7 +30,7 @@ class UsersController(BaseController):
 
        # url('users')
 
        
 
        c.users_list = self.sa.query(Users).all()     
 
        return render('/users.html')
 
        return render('admin/users/users.html')
 
    
 
    def create(self):
 
        """POST /users: Create a new item"""
 
@@ -54,7 +54,7 @@ class UsersController(BaseController):
 
    def new(self, format='html'):
 
        """GET /users/new: Form to create a new item"""
 
        # url('new_user')
 
        return render('/user_add.html')
 
        return render('admin/users/user_add.html')
 

	
 
    def update(self, id):
 
        """PUT /users/id: Update an existing item"""
 
@@ -107,7 +107,7 @@ class UsersController(BaseController):
 
        c.user = self.sa.query(Users).get(id)
 
        defaults = c.user.__dict__
 
        return htmlfill.render(
 
            render('/user_edit.html'),
 
            render('admin/users/user_edit.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
pylons_app/templates/admin/add.html
Show inline comments
 
file renamed from pylons_app/templates/add.html to pylons_app/templates/admin/add.html
pylons_app/templates/admin/admin.html
Show inline comments
 
file renamed from pylons_app/templates/admin.html to pylons_app/templates/admin/admin.html
 
## -*- coding: utf-8 -*-
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 
 <%def name="get_form_error(element)">
 
 	%if hasattr(c,'form_errors'):
 
	    %if type(c.form_errors) == dict:
pylons_app/templates/admin/admin_log.html
Show inline comments
 
file renamed from pylons_app/templates/admin_log.html to pylons_app/templates/admin/admin_log.html
pylons_app/templates/admin/repos/repo_edit.html
Show inline comments
 
file renamed from pylons_app/templates/repo_edit.html to pylons_app/templates/admin/repos/repo_edit.html
pylons_app/templates/admin/repos/repos.html
Show inline comments
 
file renamed from pylons_app/templates/repos.html to pylons_app/templates/admin/repos/repos.html
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('Repository managment')}
 
</%def>
 
@@ -27,7 +27,7 @@
 
        <table>
 
	        %for cnt,repo in enumerate(c.repos_list):
 
	 		<tr class="parity${cnt%2}">
 
			    <td><a href="/${repo['name']}">${repo['name']}</a></td>
 
			    <td>${h.link_to(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td>
 
		        <td>r${repo['rev']}:${repo['tip']}</td>
 
                <td>
 
                  ${h.form(url('repo', id=repo['name']),method='delete')}
pylons_app/templates/admin/users/user_add.html
Show inline comments
 
file renamed from pylons_app/templates/user_add.html to pylons_app/templates/admin/users/user_add.html
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('User')} - ${_('add new')}
 
</%def>
pylons_app/templates/admin/users/user_edit.html
Show inline comments
 
file renamed from pylons_app/templates/user_edit.html to pylons_app/templates/admin/users/user_edit.html
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('User')} - ${c.user.username}
 
</%def>
pylons_app/templates/admin/users/users.html
Show inline comments
 
file renamed from pylons_app/templates/users.html to pylons_app/templates/admin/users/users.html
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 
<%def name="title()">
 
    ${_('Repository managment')}
 
</%def>
pylons_app/templates/branches/branches.html
Show inline comments
 
new file 100644
 
<%inherit file="/base/base.html"/>
 
<%! from pylons_app.lib import filters %>
 
<%def name="title()">
 
    ${_('Branches')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    /
 
    ${_('branches')}
 
</%def>
 
<%def name="page_nav()">
 
        <form action="log">
 
            <dl class="search">
 
                <dt><label>Search: </label></dt>
 
                <dd><input type="text" name="rev" /></dd>
 
            </dl>
 
        </form>
 

	
 
		${self.menu('branches')}    
 
</%def>
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Branches')}</h2>
 

	
 
    <table>
 
		%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
pylons_app/templates/graph.html
Show inline comments
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Repository managment')}
pylons_app/templates/shortlog/shortlog.html
Show inline comments
 
file renamed from pylons_app/templates/shortlog.html to pylons_app/templates/shortlog/shortlog.html
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Repository managment')}
pylons_app/templates/shortlog/shortlog_data.html
Show inline comments
 
file renamed from pylons_app/templates/shortlog_data.html to pylons_app/templates/shortlog/shortlog_data.html
pylons_app/templates/summary.html
Show inline comments
 
<%inherit file="base/base.html"/>
 
<%inherit file="/base/base.html"/>
 
<%!
 
from pylons_app.lib import filters
 
%>
pylons_app/templates/tags/tags.html
Show inline comments
 
new file 100644
 
<%inherit file="/base/base.html"/>
 
<%!
 
from pylons_app.lib import filters
 
%>
 
<%def name="title()">
 
    ${_('Tags')}
 
</%def>
 
<%def name="breadcrumbs()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    / 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    /
 
    ${_('tags')}
 
</%def>
 
<%def name="page_nav()">
 
        <form action="log">
 
            <dl class="search">
 
                <dt><label>Search: </label></dt>
 
                <dd><input type="text" name="rev" /></dd>
 
            </dl>
 
        </form>
 

	
 
		${self.menu('tags')}    
 
</%def>
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Tags')}</h2>
 

	
 
    <table>
 
		%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>
 

	
 
</%def>    
 
\ No newline at end of file
setup.py
Show inline comments
 
@@ -13,9 +13,9 @@ setup(
 
    author_email = 'marcin@python-blog.com',
 
    url = '',
 
    install_requires = [
 
        "Pylons>=0.9.7,<=0.9.7.99",
 
        "SQLAlchemy>=0.5,<=0.5.99",
 
        "Mako>=0.2.2,<=0.2.99",
 
        "Pylons>=1.0.0",
 
        "SQLAlchemy>=0.6",
 
        "Mako>=0.3.2",
 
    ],
 
    setup_requires = ["PasteScript>=1.6.3"],
 
    packages = find_packages(exclude = ['ez_setup']),
0 comments (0 inline, 0 general)