web: add the project_url option
author |
Steve Losh <steve@stevelosh.com> |
date |
Mon, 12 Jul 2010 22:59:37 -0400 |
parents |
9f8ab6e7b2ec
|
children |
7ae0c716218d
cde269f2147e
|
branches/tags |
(none) |
files |
contrib/deploy/wsgi.py review/templates/base.html review/web.py |
Changes
--- a/contrib/deploy/wsgi.py Mon Jul 12 21:49:16 2010 -0400
+++ b/contrib/deploy/wsgi.py Mon Jul 12 22:59:37 2010 -0400
@@ -12,6 +12,7 @@
ANON_USER = 'Anonymous <anonymous@example.com>'
SITE_ROOT = 'http://yoursite.com/optional/path'
TITLE = 'Your Project'
+PROJECT_URL = 'http://bitbucket.org/your/project/' # or None
from mercurial import hg, ui
from review.web import app
@@ -26,6 +27,7 @@
app.title = TITLE
app.debug = False
app.ui = _ui
+app.project_url = PROJECT_URL
app.repo = repo
application = app
--- a/review/templates/base.html Mon Jul 12 21:49:16 2010 -0400
+++ b/review/templates/base.html Mon Jul 12 22:59:37 2010 -0400
@@ -61,7 +61,12 @@
<div class="footer">
<div class="wrap">
<p>
- reviewing {{ title }}
+ reviewing
+ {% if project_url %}
+ <a href="{{ project_url }}">{{ title }}</a>
+ {% else %}
+ {{ title }}
+ {% endif %}
with <a href="http://bitbucket.org/sjl/hg-review/">hg-review</a>
</p>
</div>
--- a/review/web.py Mon Jul 12 21:49:16 2010 -0400
+++ b/review/web.py Mon Jul 12 22:59:37 2010 -0400
@@ -75,7 +75,7 @@
def _render(template, **kwargs):
return render_template(template, read_only=app.read_only,
allow_anon=app.allow_anon, utils=utils, datastore=g.datastore,
- title=app.title, **kwargs)
+ title=app.title, project_url=app.project_url, **kwargs)
def _get_revision_or_404(revhash):
revhash = revhash.lower()
@@ -236,6 +236,7 @@
app.ui = ui
app.repo = repo
app.title = os.path.basename(repo.root)
+ app.project_url = None
if app.debug:
from flaskext.lesscss import lesscss