You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2012/12/19 17:25:53 UTC

[9/48] git commit: [#5389] Minor tweak to diff switch UI

[#5389] Minor tweak to diff switch UI

Signed-off-by: Cory Johns <jo...@geek.net>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0a7b1853
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0a7b1853
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0a7b1853

Branch: refs/heads/db/4790
Commit: 0a7b1853741f48b198e952d8505284a049e100de
Parents: b770d92
Author: Cory Johns <jo...@geek.net>
Authored: Mon Dec 17 22:54:58 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Mon Dec 17 23:00:40 2012 +0000

----------------------------------------------------------------------
 Allura/allura/templates/repo/commit.html           |    4 +++-
 Allura/allura/templates/repo/diff.html             |    2 +-
 .../forgegit/tests/functional/test_controllers.py  |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0a7b1853/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index a6054af..c4ca330 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -68,11 +68,13 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
           href = href + '&diformat=regular';
           $('#' + diffid).load(href, function() {
             self.attr('data-diformat', 'regular');
+            self.text('Switch to side-by-side view');
           });
         } else {
           href = href + '&diformat=sidebyside';
           $('#' + diffid).load(href, function() {
             self.attr('data-diformat', 'sidebyside');
+            self.text('Switch to unified view');
           });
         }
         return false;
@@ -107,7 +109,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
             {% if type in ('added', 'changed') %}
                 <a href="{{commit.url()}}tree/{{h.really_unicode(file)}}">{{h.really_unicode(file)}}</a>
                 <a class="commit-diff-link" href="{{commit.url()}}tree/{{h.really_unicode(file)}}?diff={{prev[0]._id if prev else ''}}">Diff</a>
-                <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{commit.url()}}tree/{{h.really_unicode(file)}}?barediff={{prev[0]._id if prev else ''}}">Switch regular/side-by-side view</a>
+                <a class="commit-diff-link switch-diff-format-link" data-diformat="{{session.diformat}}" data-diffid="diff-{{loop.index}}" href="{{commit.url()}}tree/{{h.really_unicode(file)}}?barediff={{prev[0]._id if prev else ''}}">Switch to {{'unified' if session.diformat == 'sidebyside' else 'side-by-side'}} view</a>
             {% elif type == 'removed' %}
                 <a href="{{prev[0].url()}}tree/{{h.really_unicode(file)}}">{{h.really_unicode(file)}}</a>
             {% elif type == 'copied' %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0a7b1853/Allura/allura/templates/repo/diff.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/diff.html b/Allura/allura/templates/repo/diff.html
index 6faede2..4c5ba93 100644
--- a/Allura/allura/templates/repo/diff.html
+++ b/Allura/allura/templates/repo/diff.html
@@ -34,7 +34,7 @@
       <span class="fright">
         {% if session.diformat == 'sidebyside' %}
           {% set switch_url = request.url.replace('&diformat=sidebyside', '') + '&diformat=regular' %}
-          {% set switch_text = 'regular' %}
+          {% set switch_text = 'unified' %}
         {% else %}
           {% set switch_url = request.url.replace('&diformat=regular', '') + '&diformat=sidebyside' %}
           {% set switch_text = 'side-by-side' %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0a7b1853/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 7a83039..d89ee0f 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -169,7 +169,7 @@ class TestRootController(_TestCase):
         assert fn + '&amp;diformat=sidebyside">Switch to side-by-side view</a>' in r
 
         r = self.app.get(ci + fn + '&diformat=sidebyside')
-        assert fn + '&amp;diformat=regular">Switch to regular view</a>' in r
+        assert fn + '&amp;diformat=regular">Switch to unified view</a>' in r
         assert '<table class="side-by-side-diff">' in r
 
     def test_refresh(self):