[Bps-public-commit] App-Changeloggr branch, master, updated. 1a675fa1bc739a63661d74149f7997b2043bfabd

sartak at bestpractical.com sartak at bestpractical.com
Tue May 19 11:41:42 EDT 2009


The branch, master has been updated
       via  1a675fa1bc739a63661d74149f7997b2043bfabd (commit)
       via  feee996874eefdf698d96d234527581b86c667ac (commit)
       via  2afab0797fb79df735a24144595a09b3bf29983e (commit)
      from  5af4f8adcd845bc8372bfc4b0be8265a21126df2 (commit)

Summary of changes:
 etc/config.yml                         |    2 +-
 lib/App/Changeloggr/InputFormat/Git.pm |    3 ++
 lib/App/Changeloggr/Model/User.pm      |    6 ++++
 lib/App/Changeloggr/View.pm            |   43 ++++++++++++++++++++-----------
 4 files changed, 38 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 2afab0797fb79df735a24144595a09b3bf29983e
Author: Shawn M Moore <sartak at gmail.com>
Date:   Tue May 19 11:37:47 2009 -0400

    Remove extra newlines at the end of a diffstat

diff --git a/lib/App/Changeloggr/InputFormat/Git.pm b/lib/App/Changeloggr/InputFormat/Git.pm
index 35a5f33..e025dc4 100644
--- a/lib/App/Changeloggr/InputFormat/Git.pm
+++ b/lib/App/Changeloggr/InputFormat/Git.pm
@@ -61,6 +61,9 @@ sub next_match {
     }
     if ($entry =~ /\n(\s{1,2}\S+\s+\|\s+\d+.*)$/ims) {
         $fields{diffstat} = $1;
+
+        # Remove extra newlines at the end of the diffstat
+        $fields{diffstat} =~ s/\s+\z//;
     }
 
     $fields{message} =~ s/^git-svn-id: .*$//m;

commit feee996874eefdf698d96d234527581b86c667ac
Author: Shawn M Moore <sartak at gmail.com>
Date:   Tue May 19 11:41:16 2009 -0400

    Add a user column for "always show details"

diff --git a/etc/config.yml b/etc/config.yml
index 06adbb9..13b3ede 100644
--- a/etc/config.yml
+++ b/etc/config.yml
@@ -14,7 +14,7 @@ framework:
     Password: ''
     RecordBaseClass: Jifty::DBI::Record::Cachable
     User: ''
-    Version: 0.0.8
+    Version: 0.0.9
   DevelMode: 1
   L10N: 
     PoDir: share/po
diff --git a/lib/App/Changeloggr/Model/User.pm b/lib/App/Changeloggr/Model/User.pm
index 3f30c0b..816f60d 100644
--- a/lib/App/Changeloggr/Model/User.pm
+++ b/lib/App/Changeloggr/Model/User.pm
@@ -14,6 +14,12 @@ use App::Changeloggr::Record schema {
         type is 'text',
         render as 'hidden',
         is immutable;
+
+    column show_details =>
+        is boolean,
+        default is 0,
+        label is 'Always show details',
+        since '0.0.9';
 };
 
 # has to go below schema

commit 1a675fa1bc739a63661d74149f7997b2043bfabd
Author: Shawn M Moore <sartak at gmail.com>
Date:   Tue May 19 11:41:27 2009 -0400

    Always display details if the user wants them

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index 6c565d9..bd0a083 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -114,22 +114,35 @@ sub show_change {
                 class  => "external_source",
             );
         }
-        hyperlink(
-            label => 'more...',
-            onclick => [{
-                region       => Jifty->web->qualified_region("change_$id"),
-                replace_with => '/change/more',
-                toggle       => 1,
-                effect       => 'slideDown',
-                arguments    => {
-                    change => $id,
+        if (Jifty->web->current_user->user_object->show_details) {
+            div {
+                render_region(
+                    name      => "change_$id",
+                    path      => '/change/more',
+                    arguments => {
+                        change => $id,
+                    },
+                );
+            };
+        }
+        else {
+            hyperlink(
+                label => 'more...',
+                onclick => [{
+                    region       => Jifty->web->qualified_region("change_$id"),
+                    replace_with => '/change/more',
+                    toggle       => 1,
+                    effect       => 'slideDown',
+                    arguments    => {
+                        change => $id,
+                    },
                 },
-            },
-            "this.innerHTML = this.innerHTML == 'more...' ? 'less...' : 'more...';",
-        ]);
-        div {
-            render_region("change_$id");
-        };
+                "this.innerHTML = this.innerHTML == 'more...' ? 'less...' : 'more...';",
+            ]);
+            div {
+                render_region("change_$id");
+            };
+        }
 
         if ($args{voting_form}) {
             hr {};

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



More information about the Bps-public-commit mailing list