[Bps-public-commit] App-Changeloggr branch, master, updated. 37ace56cbe60ddae26937e1149ad31f6d6c810e2

sartak at bestpractical.com sartak at bestpractical.com
Wed May 20 16:29:05 EDT 2009


The branch, master has been updated
       via  37ace56cbe60ddae26937e1149ad31f6d6c810e2 (commit)
      from  5ab90b85e86e395233864004dee963ababcb70ce (commit)

Summary of changes:
 lib/App/Changeloggr/View.pm |   45 +++++++++++++++++++++++++++---------------
 1 files changed, 29 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 37ace56cbe60ddae26937e1149ad31f6d6c810e2
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed May 20 16:28:55 2009 -0400

    If the user wants full diffs, give em full diffs

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index c80fbec..5428d02 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -128,23 +128,36 @@ sub show_change {
         );
 
         if (my $url = $change->external_source) {
-            hyperlink(
-                label => 'Full diff',
-                class => 'external_source',
-                onclick => [{
-                    region       => Jifty->web->qualified_region("change_${id}_source"),
-                    replace_with => '/change/external_source',
-                    toggle       => 1,
-                    effect       => 'slideDown',
-                    arguments    => {
-                        url => $url,
+            if (Jifty->web->current_user->user_object->show_diff) {
+                div {
+                    render_region(
+                        name => "change_${id}_source",
+                        path => "/change/external_source",
+                        arguments => {
+                            url => $url,
+                        },
+                    );
+                };
+            }
+            else {
+                hyperlink(
+                    label => 'Full diff',
+                    class => 'external_source',
+                    onclick => [{
+                        region       => Jifty->web->qualified_region("change_${id}_source"),
+                        replace_with => '/change/external_source',
+                        toggle       => 1,
+                        effect       => 'slideDown',
+                        arguments    => {
+                            url => $url,
+                        },
                     },
-                },
-                "this.innerHTML = this.innerHTML == 'Full diff' ? 'Hide diff' : 'Full diff';",
-            ]);
-            div {
-                render_region("change_${id}_source");
-            };
+                    "this.innerHTML = this.innerHTML == 'Full diff' ? 'Hide diff' : 'Full diff';",
+                ]);
+                div {
+                    render_region("change_${id}_source");
+                };
+            }
         }
 
         if ($args{voting_form}) {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list