Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE9B0D636 for ; Tue, 18 Dec 2012 04:29:43 +0000 (UTC) Received: (qmail 16654 invoked by uid 500); 18 Dec 2012 04:29:37 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 16209 invoked by uid 500); 18 Dec 2012 04:29:34 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 15908 invoked by uid 99); 18 Dec 2012 04:29:30 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Dec 2012 04:29:30 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9AF0981E28B; Tue, 18 Dec 2012 04:29:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tvansteenburgh@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [10/41] git commit: [#5389] ticket:229 add styles for side-by-side diff Message-Id: <20121218042929.9AF0981E28B@tyr.zones.apache.org> Date: Tue, 18 Dec 2012 04:29:29 +0000 (UTC) [#5389] ticket:229 add styles for side-by-side diff Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b09028b3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b09028b3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b09028b3 Branch: refs/heads/tv/4957 Commit: b09028b37593bdfda75069351be5c776bdf8bb8d Parents: a68e421 Author: Igor Bondarenko Authored: Thu Dec 6 13:58:18 2012 +0000 Committer: Cory Johns Committed: Mon Dec 17 22:21:16 2012 +0000 ---------------------------------------------------------------------- Allura/allura/controllers/repository.py | 1 + Allura/allura/public/nf/css/forge/diff.css | 44 +++++++++++++++++++++++ Allura/allura/templates/repo/commit.html | 2 + Allura/allura/templates/repo/diff.html | 1 + 4 files changed, 48 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b09028b3/Allura/allura/controllers/repository.py ---------------------------------------------------------------------- diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py index 1d8a061..d93fe1d 100644 --- a/Allura/allura/controllers/repository.py +++ b/Allura/allura/controllers/repository.py @@ -588,6 +588,7 @@ class FileBrowser(BaseController): if fmt == 'sidebyside': hd = difflib.HtmlDiff(tabsize=4) diff = hd.make_table(la, lb, adesc, bdesc, context=True) + diff = diff.replace(' ', ' ') else: diff = ''.join(difflib.unified_diff(la, lb, adesc, bdesc)) return dict(a=a, b=b, diff=diff) http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b09028b3/Allura/allura/public/nf/css/forge/diff.css ---------------------------------------------------------------------- diff --git a/Allura/allura/public/nf/css/forge/diff.css b/Allura/allura/public/nf/css/forge/diff.css new file mode 100644 index 0000000..7e9e553 --- /dev/null +++ b/Allura/allura/public/nf/css/forge/diff.css @@ -0,0 +1,44 @@ +/* Styles for side-by-side diffs. Trying to match pygments styles for regular diffs */ + +table.diff { + background: #f8f8f8; + margin: 0 !important; + width: 100% !important; +} + +table.diff colgroup, +table.diff td.diff_next, +table.diff th.diff_next, +.inline-diff-body table.diff thead { display: none; } + +table.diff, +table.diff tr, +table.diff td { + border: 0; + color: gray; + margin: 0; + padding: 0; + vertical-align: text-top; + white-space: pre-wrap; +} + +table.diff td { padding: 0 .2em; } + +/* line number */ +table.diff td.diff_header { + background-color: #ebebeb; + display:inline-block; + padding: 0 .5em; + border-width: 0 1px 0 0; + border-style: solid; + border-color: #ddd; + height: 100%; + width: 2em; +} + +/* colors */ +table.diff tr:hover { background-color: #ff9; } + +table.diff tr td span.diff_add { color: #000; background-color: #dfd; } +table.diff tr td span.diff_sub { color: #000; background-color: #fdd; } +table.diff tr td span.diff_chg { color: #000; background-color: #ff9; } http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b09028b3/Allura/allura/templates/repo/commit.html ---------------------------------------------------------------------- diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html index 6057f5a..52c38ad 100644 --- a/Allura/allura/templates/repo/commit.html +++ b/Allura/allura/templates/repo/commit.html @@ -1,5 +1,7 @@ {% extends 'allura:templates/repo/repo_master.html' %} +{% do g.register_forge_css('css/forge/diff.css') %} + {% block title %} {{c.project.name}} / {{c.app.config.options.mount_label}} / Commit {{commit.shorthand_id()}} {% endblock %} http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b09028b3/Allura/allura/templates/repo/diff.html ---------------------------------------------------------------------- diff --git a/Allura/allura/templates/repo/diff.html b/Allura/allura/templates/repo/diff.html index 5156bd8..6faede2 100644 --- a/Allura/allura/templates/repo/diff.html +++ b/Allura/allura/templates/repo/diff.html @@ -1,5 +1,6 @@ {% extends 'allura:templates/repo/repo_master.html' %} {% do g.register_forge_css('css/forge/hilite.css') %} +{% do g.register_forge_css('css/forge/diff.css') %} {% block title %} {{c.project.name}} / {{c.app.config.options.mount_label}} / Diff of {{h.really_unicode(b.path())}}