Changeset - 2963f2894a7a
[Not reviewed]
default
0 40 0
Marcin Kuzminski - 16 years ago 2010-03-04 23:13:12
marcin@python-blog.com
Tempalting change, bugfix for serving raw files, and diffs. Now raw files are not parsed thruough mako, and diffs are mako safe (not parsed also)
39 files changed with 63 insertions and 8 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/hg.py
Show inline comments
 
@@ -10,7 +10,7 @@ import os
 
from mercurial import ui, hg
 
from mercurial.error import RepoError
 
from ConfigParser import ConfigParser
 

	
 
import encodings
 
log = logging.getLogger(__name__)
 

	
 
class HgController(BaseController):
 
@@ -18,16 +18,16 @@ class HgController(BaseController):
 
    def __before__(self):
 
        c.repos_prefix = 'etelko'
 

	
 

	
 
    def view(self, *args, **kwargs):
 
        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:
 
        #for mercurial protocols and raw files we can't wrap into mako
 
        if request.environ['HTTP_ACCEPT'].find("mercurial") != -1 or \
 
        request.environ['PATH_INFO'].find('raw-file') != -1:
 
                    return response
 

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

	
 
        template = Template(tmpl, lookup=request.environ['pylons.pylons']\
 
                            .config['pylons.g'].mako_lookup)
 

	
 
        return template.render(g = g, c = c, session = session, h = h)
 
@@ -36,6 +36,10 @@ class HgController(BaseController):
 
    def manage_hgrc(self):
 
        pass
 

	
 
    def hgrc(self, dirname):
 
        filename = os.path.join(dirname, '.hg', 'hgrc')
 
        return filename
 

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

	
pylons_app/lib/app_globals.py
Show inline comments
 
@@ -38,6 +38,15 @@ class Globals(object):
 
            baseui.setconfig('web', k, v)
 
        #magic trick to make our custom template dir working
 
        templater.path.append(cfg.get('web', 'templates', None))
 

	
 
        #baseui.setconfig('web', 'description', '')
 
        #baseui.setconfig('web', 'name', '')
 
        #baseui.setconfig('web', 'contact', '')
 
        #baseui.setconfig('web', 'allow_archive', '')
 
        #baseui.setconfig('web', 'style', 'monoblue_plain')
 
        #baseui.setconfig('web', 'baseurl', '')
 
        #baseui.setconfig('web', 'staticurl', '')
 
        
 
        hgwebapp = hgwebdir(paths, baseui = baseui)
 
        return hgwebapp
 

	
pylons_app/templates/monoblue_custom/branches.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Branches</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/changelog.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: changelog</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/changelogentry.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
<h3 class="changelog"><a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
 
<ul class="changelog-entry">
 
    <li class="age">{date|age}</li>
pylons_app/templates/monoblue_custom/changeset.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<title>{repo|escape}: changeset {rev}:{node|short}</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
 
@@ -57,7 +58,9 @@
 
    </table>
 

	
 
    <div class="diff">
 
    <%text filter="n">
 
    {diff}
 
	</%text>
 
    </div>
 

	
 
{footer}
pylons_app/templates/monoblue_custom/error.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Error</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/fileannotate.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<title>{repo|escape}: {file|escape}@{node|short} (annotated)</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/filediff.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<title>{repo|escape}: diff {file|escape}</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
 
@@ -48,7 +49,9 @@
 
    </dl>
 

	
 
    <div class="diff">
 
    <%text filter="n">
 
    {diff}
 
	</%text>
 
    </div>
 

	
 
{footer}
pylons_app/templates/monoblue_custom/filelog.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<title>{repo|escape}: File revisions</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/filerevision.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<title>{repo|escape}: {file|escape}@{node|short}</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
 
@@ -57,7 +58,9 @@
 
    <p class="description">{desc|strip|escape|addbreaks|nonempty}</p>
 

	
 
    <div class="source">
 
		<%text filter="n">
 
    {text%fileline}
 
		</%text>    
 
    </div>
 

	
 
{footer}
pylons_app/templates/monoblue_custom/footer.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
    <div class="page-footer">
 
        <p>Mercurial Repository: {repo|escape}</p>
 
        <ul class="rss-logo">
pylons_app/templates/monoblue_custom/graph.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: graph</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/header.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
<head>
pylons_app/templates/monoblue_custom/index.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Mercurial repositories index</title>
 
</head>
pylons_app/templates/monoblue_custom/manifest.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<title>{repo|escape}: files</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/notfound.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Mercurial repository not found</title>
 
</head>
pylons_app/templates/monoblue_custom/search.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Search</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/shortlog.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: shortlog</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/summary.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Summary</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_custom/tags.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Tags</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_plain/changelog.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/changelogentry.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
<h3 class="changelog"><a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></h3>
 
    <h4>{date|age} ago, by {author|obfuscate} [{date|rfc822date}] rev {rev}</h4>
 
    <p>{desc|strip|escape|addbreaks}</p>
pylons_app/templates/monoblue_plain/changeset.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/error.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Error</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_plain/fileannotate.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/filediff.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/filelog.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/filerevision.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/footer.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
    <div class="page-footer">
 
        <p>
 
            Mercurial Repository: {repo|escape}
pylons_app/templates/monoblue_plain/graph.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
 
<div id="container">
pylons_app/templates/monoblue_plain/header.tmpl
Show inline comments
 

	
 
## -*- coding: utf-8 -*-
pylons_app/templates/monoblue_plain/index.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/manifest.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/notfound.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Mercurial repository not found</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_plain/search.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
    <title>{repo|escape}: Search</title>
 
    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
pylons_app/templates/monoblue_plain/shortlog.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/summary.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
pylons_app/templates/monoblue_plain/tags.tmpl
Show inline comments
 
## -*- coding: utf-8 -*-
 
{header}
 
<div id="container">
 
    <div class="page-header">
0 comments (0 inline, 0 general)