Mercurial > kallithea
changeset 101:8b06c420491d
statics moved to pylons.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 25 Apr 2010 01:25:54 +0200 |
parents | d8fc93ae1866 |
children | 2dc0c8e4f384 |
files | pylons_app/config/middleware.py pylons_app/controllers/admin.py pylons_app/controllers/changelog.py pylons_app/controllers/error.py pylons_app/controllers/files.py pylons_app/controllers/hg.py pylons_app/controllers/repos.py pylons_app/controllers/shortlog.py pylons_app/controllers/summary.py pylons_app/controllers/users.py pylons_app/public/images/hgicon.png pylons_app/public/images/hglogo.png pylons_app/templates/add.html pylons_app/templates/base/base.html |
diffstat | 14 files changed, 20 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/pylons_app/config/middleware.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/config/middleware.py Sun Apr 25 01:25:54 2010 +0200 @@ -8,6 +8,7 @@ from pylons.wsgiapp import PylonsApp from routes.middleware import RoutesMiddleware from paste.auth.basic import AuthBasicHandler +from pylons_app.lib.simplehg import SimpleHg from pylons_app.config.environment import load_environment from pylons_app.lib.auth import authfunc @@ -37,12 +38,14 @@ # The Pylons WSGI app app = PylonsApp(config=config) - # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) - + # Routing/Session/Cache Middleware app = RoutesMiddleware(app, config['routes.map']) app = SessionMiddleware(app, config) - app = AuthBasicHandler(app, config['repos_name'] + ' mercurial repository', authfunc) + + # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) + app = SimpleHg(app, config) + app = AuthBasicHandler(app, config['repos_name'] + ' mercurial repository', authfunc) if asbool(full_stack): # Handle Python exceptions
--- a/pylons_app/controllers/admin.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/admin.py Sun Apr 25 01:25:54 2010 +0200 @@ -20,7 +20,7 @@ class AdminController(BaseController): def __before__(self): - c.staticurl = g.statics + c.admin_user = session.get('admin_user', False) c.admin_username = session.get('admin_username')
--- a/pylons_app/controllers/changelog.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/changelog.py Sun Apr 25 01:25:54 2010 +0200 @@ -13,7 +13,7 @@ class ChangelogController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.staticurl = g.statics + c.repo_name = get_repo_slug(request)
--- a/pylons_app/controllers/error.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/error.py Sun Apr 25 01:25:54 2010 +0200 @@ -23,7 +23,7 @@ # def __before__(self): c.repos_prefix = config['repos_name'] - c.staticurl = g.statics + c.repo_name = request.environ['pylons.original_request']\ .environ.get('PATH_INFO').split('/')[-1]
--- a/pylons_app/controllers/files.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/files.py Sun Apr 25 01:25:54 2010 +0200 @@ -11,7 +11,7 @@ class FilesController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.staticurl = g.statics + c.repo_name = get_repo_slug(request) def index(self, repo_name, revision, f_path):
--- a/pylons_app/controllers/hg.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/hg.py Sun Apr 25 01:25:54 2010 +0200 @@ -21,7 +21,7 @@ def __before__(self): c.repos_prefix = config['repos_name'] - c.staticurl = g.statics + c.repo_name = get_repo_slug(request) def index(self):
--- a/pylons_app/controllers/repos.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/repos.py Sun Apr 25 01:25:54 2010 +0200 @@ -20,7 +20,7 @@ @authenticate def __before__(self): - c.staticurl = g.statics + c.admin_user = session.get('admin_user') c.admin_username = session.get('admin_username') self.sa = meta.Session
--- a/pylons_app/controllers/shortlog.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/shortlog.py Sun Apr 25 01:25:54 2010 +0200 @@ -13,7 +13,7 @@ class ShortlogController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.staticurl = g.statics + c.repo_name = get_repo_slug(request)
--- a/pylons_app/controllers/summary.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/summary.py Sun Apr 25 01:25:54 2010 +0200 @@ -11,7 +11,7 @@ class SummaryController(BaseController): def __before__(self): c.repos_prefix = config['repos_name'] - c.staticurl = g.statics + c.repo_name = get_repo_slug(request) def index(self):
--- a/pylons_app/controllers/users.py Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/controllers/users.py Sun Apr 25 01:25:54 2010 +0200 @@ -20,7 +20,7 @@ @authenticate def __before__(self): - c.staticurl = g.statics + c.admin_user = session.get('admin_user') c.admin_username = session.get('admin_username') self.sa = meta.Session
--- a/pylons_app/templates/add.html Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/templates/add.html Sun Apr 25 01:25:54 2010 +0200 @@ -2,9 +2,9 @@ <!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"> <head> - <link rel="icon" href="${c.staticurl}hgicon.png" type="image/png" /> + <link rel="icon" href="/images/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow"/> - <link rel="stylesheet" href="${c.staticurl}style-monoblue.css" type="text/css" /> + <link rel="stylesheet" href="/images/style-monoblue.css" type="text/css" /> <title> Mercurial repositories add</title> </head> @@ -30,7 +30,7 @@ <div id="powered-by"> <p> <a href="http://mercurial.selenic.com/" title="Mercurial"> - <img src="${c.staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a> + <img src="/images/hglogo.png" width="75" height="90" border=0 alt="mercurial"/></a> </p> </div>
--- a/pylons_app/templates/base/base.html Sun Apr 25 01:20:56 2010 +0200 +++ b/pylons_app/templates/base/base.html Sun Apr 25 01:25:54 2010 +0200 @@ -2,7 +2,7 @@ <!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"> <head> - <link rel="icon" href="${c.staticurl}hgicon.png" type="image/png" /> + <link rel="icon" href="/images/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow"/> <title>${next.title()}</title> ${self.css()} @@ -27,7 +27,7 @@ <div id="powered-by"> <p> <a href="http://mercurial.selenic.com/" title="Mercurial"> - <img src="${c.staticurl}hglogo.png" width="75" height="90" alt="mercurial"/></a> + <img src="/images/hglogo.png" width="75" height="90" alt="mercurial"/></a> </p> </div>