[Bps-public-commit] App-Changeloggr branch, master, updated. 55759cff1b8fab51648103020e8cf0a8cb7535ad

Alex M Vandiver alexmv at bestpractical.com
Wed Jul 29 14:54:16 EDT 2009


The branch, master has been updated
       via  55759cff1b8fab51648103020e8cf0a8cb7535ad (commit)
       via  80c9bfa7efb940e6ab3ac2809e437e45667f80cb (commit)
       via  25d422f72cf96c58bd275cd9f5c035a8ff34acdc (commit)
      from  c1f25d874dc13334a207a99c35e73046df749684 (commit)

Summary of changes:
 lib/App/Changeloggr/Model/Change.pm |    4 ++++
 lib/App/Changeloggr/View/Admin.pm   |   33 ++++++++++++++++++++++++---------
 2 files changed, 28 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 25d422f72cf96c58bd275cd9f5c035a8ff34acdc
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Jul 29 14:53:10 2009 -0400

    Include count for votes in ->grouped_votes

diff --git a/lib/App/Changeloggr/Model/Change.pm b/lib/App/Changeloggr/Model/Change.pm
index 5c7779d..afa52db 100644
--- a/lib/App/Changeloggr/Model/Change.pm
+++ b/lib/App/Changeloggr/Model/Change.pm
@@ -66,6 +66,10 @@ sub grouped_votes {
     $votes->column(
         column => 'tag',
     );
+    $votes->column(
+        column => 'id',
+        function => 'count(*)',
+    );
     $votes->group_by(
         column => 'tag',
     );

commit 80c9bfa7efb940e6ab3ac2809e437e45667f80cb
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Jul 29 14:53:52 2009 -0400

    Add CSS selectors on change_sections

diff --git a/lib/App/Changeloggr/View/Admin.pm b/lib/App/Changeloggr/View/Admin.pm
index a6f9123..685ef2c 100644
--- a/lib/App/Changeloggr/View/Admin.pm
+++ b/lib/App/Changeloggr/View/Admin.pm
@@ -66,8 +66,8 @@ template '/changelog/votes' => page {
                     dl {
                         for (@sections) {
                             my ($name, $code) = @$_;
-                            dt { $name }
-                            dd { $code->() }
+                            dt { {class is lc $name }; $name }
+                            dd { {class is lc $name }; $code->() }
                         }
                     }
                 }

commit 55759cff1b8fab51648103020e8cf0a8cb7535ad
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Jul 29 14:54:06 2009 -0400

    Show vote counts in addition to comments

diff --git a/lib/App/Changeloggr/View/Admin.pm b/lib/App/Changeloggr/View/Admin.pm
index 685ef2c..4cb1480 100644
--- a/lib/App/Changeloggr/View/Admin.pm
+++ b/lib/App/Changeloggr/View/Admin.pm
@@ -84,15 +84,30 @@ sub change_sections {
 
     my $votes = $change->votes;
     $votes->limit_to_commented;
+    if ( $votes->count ) {
+        push @sections, [
+            Comments => sub {
+                ul {
+                    while ( my $vote = <$votes> ) {
+                        li { $vote->comment };
+                    }
+                };
+            }
+        ];
+    }
 
-    if ($votes->count) {
-        push @sections, [Comments => sub {
-            ul {
-                while (my $vote = <$votes>) {
-                    li { $vote->comment }
-                }
+    $votes = $change->grouped_votes;
+    if ( $votes->count ) {
+        push @sections, [
+            Votes => sub {
+                dl {
+                    while ( my $vote = <$votes> ) {
+                        dt { $vote->tag };
+                        dd { $vote->id };
+                    }
+                };
             }
-        }];
+        ];
     }
 
     return @sections;

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



More information about the Bps-public-commit mailing list