Mercurial > public > src > rhodecode
changeset 511:9dd372c7166c
added menu for changeset raw diff and download diff
small bugfix for raw template
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 11 Sep 2010 02:56:22 +0200 |
parents | 183cee110578 |
children | bcaab62bed6f e94f4e54dc03 |
files | pylons_app/controllers/changeset.py pylons_app/templates/changeset/changeset.html pylons_app/templates/changeset/raw_changeset.html |
diffstat | 3 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pylons_app/controllers/changeset.py Sat Sep 11 01:52:16 2010 +0200 +++ b/pylons_app/controllers/changeset.py Sat Sep 11 02:56:22 2010 +0200 @@ -88,6 +88,7 @@ def raw_changeset(self,revision): hg_model = HgModel() + method = request.GET.get('diff','show') try: c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision) except RepositoryError: @@ -125,7 +126,8 @@ c.changes.append(('changed', node, diff, cs1, cs2)) response.content_type = 'text/plain' - + if method == 'download': + response.content_disposition = 'attachment; filename=%s.patch' % revision parent = True if len(c.changeset.parents) > 0 else False c.parent_tmpl = 'Parent %s' % c.changeset.parents[0]._hex if parent else ''
--- a/pylons_app/templates/changeset/changeset.html Sat Sep 11 01:52:16 2010 +0200 +++ b/pylons_app/templates/changeset/changeset.html Sat Sep 11 02:56:22 2010 +0200 @@ -23,6 +23,18 @@ ${self.breadcrumbs()} </div> <div class="table"> + <div id="body" class="diffblock"> + <div class="code-header"> + <div> + ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.raw_id} + » <span>${h.link_to(_('raw diff'), + h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span> + » <span>${h.link_to(_('download diff'), + h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span> + </div> + </div> + </div> + <div id="changeset_content"> <div class="container"> <div class="left">
--- a/pylons_app/templates/changeset/raw_changeset.html Sat Sep 11 01:52:16 2010 +0200 +++ b/pylons_app/templates/changeset/raw_changeset.html Sat Sep 11 02:56:22 2010 +0200 @@ -1,5 +1,5 @@ # HG changeset patch -# User ${c.changeset.author} +# User ${c.changeset.author|n} # Date ${"%d %d" % c.changeset._ctx.date()} # Node ID ${c.changeset._hex} # ${c.parent_tmpl}