Changeset - fac1f62a1d71
[Not reviewed]
default
0 5 0
Marcin Kuzminski - 16 years ago 2010-02-28 02:24:44

Wrapped into mako templates,
changed templates info. Added session and cache middleware.
5 files changed with 30 insertions and 11 deletions:
0 comments (0 inline, 0 general)
pylons_app/config/middleware.py
Show inline comments
 
@@ -38,12 +38,14 @@ def make_app(global_conf, full_stack = T
 
    app = PylonsApp()
 

	
 
    # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
 

	
 
    # Routing/Session/Cache Middleware
 
    app = RoutesMiddleware(app, config['routes.map'])
 
    app = SessionMiddleware(app, config)
 
    app = CacheMiddleware(app, config)
 

	
 
    if asbool(full_stack):
 
        # Handle Python exceptions
 
        app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
 

	
 
        # Display error documents for 401, 403, 404 status codes (and
pylons_app/controllers/hg.py
Show inline comments
 
@@ -10,17 +10,29 @@ from mercurial import ui, hg
 
from mercurial.error import RepoError
 
from ConfigParser import ConfigParser
 

	
 
log = logging.getLogger(__name__)
 

	
 
class HgController(BaseController):
 
    def index(self):
 
        return g.hgapp(request.environ, self.start_response)
 

	
 
    def __before__(self):
 
        c.repos_prefix = 'etelko'
 

	
 

	
 
    def view(self, *args, **kwargs):
 
        return g.hgapp(request.environ, self.start_response)
 
        response = g.hgapp(request.environ, self.start_response)
 
        #for mercurial protocols we can't wrap into mako
 
        if request.environ['HTTP_ACCEPT'].find("mercurial") >= 0:
 
                    return response
 

	
 
        #wrap the murcurial response in a mako template.
 
        template = Template("".join(response),
 
                            lookup = request.environ['pylons.pylons']\
 
                            .config['pylons.g'].mako_lookup)
 

	
 
        return template.render(g = g, c = c, session = session, h = h)
 

	
 
    def add_repo(self, new_repo):
 
        c.staticurl = g.statics
 

	
 
        #extra check it can be add since it's the command
 
        if new_repo == 'add':
pylons_app/templates/monoblue_custom/changelog.tmpl
Show inline comments
 
@@ -21,16 +21,19 @@
 
            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
 
            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
 
            <li class="current">changelog</li>
 
            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
 
            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
 
            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
 
            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}</li>
 
        </ul>
 
            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
 

	
 
      
 
    </div>
 

	
 
    <ul class="submenu">
 
        {archives%archiveentry}
 
    </ul>  
 
    <h2 class="no-link no-border">changelog</h2>
 
    <div>
 
    {entries%changelogentry}
 
    </div>
 

	
 
    <div class="page-path">
pylons_app/templates/monoblue_custom/index.tmpl
Show inline comments
 
@@ -2,13 +2,13 @@
 
    <title>{repo|escape}: Mercurial repositories index</title>
 
</head>
 

	
 
<body>
 
<div id="container">
 
    <div class="page-header">
 
        <h1> Mercurial Repositories</h1>
 
        <h1>${c.repos_prefix} Mercurial Repositories</h1>
 
        <ul class="page-nav">
 
        </ul>
 
    </div>
 
    
 
    <table cellspacing="0">
 
        <tr>
pylons_app/templates/monoblue_custom/shortlog.tmpl
Show inline comments
 
@@ -21,21 +21,23 @@
 
            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
 
            <li class="current">shortlog</li>
 
            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
 
            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
 
            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
 
            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
 
            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}</li>
 
            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
 
        </ul>
 
    </div>
 

	
 
    <ul class="submenu">
 
        {archives%archiveentry}
 
    </ul>  
 
    <h2 class="no-link no-border">shortlog</h2>
 

	
 
    <table>
 
{entries%shortlogentry}
 
        {entries%shortlogentry}
 
    </table>
 

	
 
    <div class="page-path">
 
{changenav%navshortentry}
 
        {changenav%navshortentry}
 
    </div>
 

	
 
{footer}
0 comments (0 inline, 0 general)