diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -45,10 +45,12 @@ repos_name = Python-works #################################### beaker.cache.data_dir=/tmp/cache/data beaker.cache.lock_dir=/tmp/cache/lock -beaker.cache.regions=short_term +beaker.cache.regions=short_term,long_term +beaker.cache.short_term.type=file +beaker.cache.short_term.expire=3600 beaker.cache.short_term.type=memory beaker.cache.short_term.expire=60 - + ################################################################################ ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ## ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ## diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -45,9 +45,11 @@ repos_name = Python-works #################################### beaker.cache.data_dir=/tmp/cache/data beaker.cache.lock_dir=/tmp/cache/lock -beaker.cache.regions=short_term +beaker.cache.regions=short_term,long_term +beaker.cache.short_term.type=file +beaker.cache.short_term.expire=3600 beaker.cache.short_term.type=memory -beaker.cache.short_term.expire=3600 +beaker.cache.short_term.expire=60 ################################################################################ ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ## diff --git a/pylons_app/config/environment.py b/pylons_app/config/environment.py --- a/pylons_app/config/environment.py +++ b/pylons_app/config/environment.py @@ -48,7 +48,7 @@ def load_environment(global_conf, app_co imports=['from webhelpers.html import escape']) #sets the c attribute access when don't existing attribute ar accessed - config['pylons.strict_tmpl_context'] = False + config['pylons.strict_tmpl_context'] = True #MULTIPLE DB configs # Setup the SQLAlchemy database engine diff --git a/pylons_app/controllers/summary.py b/pylons_app/controllers/summary.py --- a/pylons_app/controllers/summary.py +++ b/pylons_app/controllers/summary.py @@ -27,6 +27,6 @@ class SummaryController(BaseController): '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.get_tags(limit=10) + c.repo_branches = []#c.repo_info.get_branches(limit=10) return render('/summary.html') diff --git a/pylons_app/lib/base.py b/pylons_app/lib/base.py --- a/pylons_app/lib/base.py +++ b/pylons_app/lib/base.py @@ -5,14 +5,25 @@ Provides the BaseController class for su from pylons.controllers import WSGIController from pylons.templating import render_mako as render from pylons_app.model import meta +from beaker.cache import cache_region +from pylons import tmpl_context as c +from pylons_app.model.hg_model import HgModel class BaseController(WSGIController): - + def _load_repos(self): + + @cache_region('long_term', 'repo_list_2') + def _get_repos(): + return [rep['name'] for rep in HgModel().get_repos()] + + c.repo_list = _get_repos() + def __call__(self, environ, start_response): """Invoke the Controller""" # WSGIController.__call__ dispatches to the Controller method # the request is routed to. This routing information is # available in environ['pylons.routes_dict'] + self._load_repos() try: return WSGIController.__call__(self, environ, start_response) finally: diff --git a/pylons_app/public/css/monoblue_custom.css b/pylons_app/public/css/monoblue_custom.css --- a/pylons_app/public/css/monoblue_custom.css +++ b/pylons_app/public/css/monoblue_custom.css @@ -43,7 +43,7 @@ div.page-header { margin: 10px 0 30px; font-size: 1.8em; font-weight: bold; - font-family: osaka,'MS P Gothic', Georgia, serif; + font-family: sans-serif; letter-spacing: 1px; color: #DDD; } @@ -91,18 +91,21 @@ div.page-header { ul.page-nav li { margin: 0 2px 0 0; float: left; - width: 80px; height: 24px; font-size: 1.1em; line-height: 24px; - text-align: center; + text-align: center; } ul.page-nav li.current { background: #FFF; + padding-right:5px; + padding-left:5px; } ul.page-nav li a { height: 24px; color: #666; + padding-right:5px; + padding-left:5px; background: #DDD; display: block; text-decoration: none; diff --git a/pylons_app/templates/base/base.html b/pylons_app/templates/base/base.html --- a/pylons_app/templates/base/base.html +++ b/pylons_app/templates/base/base.html @@ -51,7 +51,36 @@ <%def name="menu(current)">