[Bps-public-commit] App-Changeloggr branch, master, updated. 5c012bdfca2bc9df56bcf6b685a6b55f372c3713

Alex M Vandiver alexmv at bestpractical.com
Wed May 20 18:46:24 EDT 2009


The branch, master has been updated
       via  5c012bdfca2bc9df56bcf6b685a6b55f372c3713 (commit)
      from  0b280f8a76af4b3ea6279c4401949115c1b3fb9f (commit)

Summary of changes:
 lib/App/Changeloggr/Model/Changelog.pm |   16 +++++++++++-----
 lib/App/Changeloggr/View.pm            |    3 +++
 share/web/static/css/app.css           |    3 ++-
 3 files changed, 16 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 5c012bdfca2bc9df56bcf6b685a6b55f372c3713
Author: Alex Vandiver <alexmv at mit.edu>
Date:   Wed May 20 18:46:11 2009 -0400

    Show how many changes remain

diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index 0d5b0ea..f25f6d4 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -124,12 +124,8 @@ sub commit_links {
     return M('CommitLinkCollection', changelog_id => $self);
 }
 
-sub choose_change {
+sub unvoted_changes {
     my $self = shift;
-
-    # This will become more advanced in the future, picking a change that
-    # the current user has not voted on yet, ordered by the confidence of the
-    # top tag. But for now.. an arbitrary change belonging to this changelog.
     my $changes = M('ChangeCollection', changelog_id => $self);
     my $votes = $changes->join(
         type => 'left',
@@ -150,6 +146,16 @@ sub choose_change {
         operator => 'IS',
         value => 'NULL',
     );
+    return $changes;
+}
+
+sub choose_change {
+    my $self = shift;
+
+    # This will become more advanced in the future, picking a change that
+    # the current user has not voted on yet, ordered by the confidence of the
+    # top tag. But for now.. an arbitrary change belonging to this changelog.
+    my $changes = $self->unvoted_changes;
     $changes->rows_per_page(1);
     $changes->order_by( column => 'date', order => 'asc' );
     return $changes->first;
diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index d3f5e6d..dce958a 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -109,6 +109,9 @@ sub show_change {
             else {
                 outs $change->identifier;
             }
+            span {
+                "(". $change->changelog->unvoted_changes->count . " remaining)"
+            }
         };
 
         p {
diff --git a/share/web/static/css/app.css b/share/web/static/css/app.css
index 8461a16..3370acc 100644
--- a/share/web/static/css/app.css
+++ b/share/web/static/css/app.css
@@ -59,12 +59,13 @@ hr {
 
 .change .identifier {
   font-size: .6em;
-  text-align: right;
+  float: right;
   color: #777;
 }
 
 .identifier a.external_source {
   color: #777;
   text-decoration: none;
+  float: none;
 }
 

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



More information about the Bps-public-commit mailing list