[Bps-public-commit] App-Changeloggr branch, master, updated. 8f398d32b72e41ac6008e06545b0099e4772addc

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 30 15:59:07 EDT 2009


The branch, master has been updated
       via  8f398d32b72e41ac6008e06545b0099e4772addc (commit)
       via  dd75d46217a2f7c46f618327c0a96bc4abd269f6 (commit)
      from  afdb42d8317e453de7006548a76c7ebbec6fc25c (commit)

Summary of changes:
 lib/App/Changeloggr/View.pm             |   10 ++++++++--
 lib/App/Changeloggr/View/Leaderboard.pm |    9 ++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit dd75d46217a2f7c46f618327c0a96bc4abd269f6
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Jul 30 15:57:13 2009 -0400

    Link "currently ranked" to the global leaderboard

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index 3ea29a2..10ad08e 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -109,8 +109,14 @@ template '/score' => sub {
     div {
         {id is "score"};
         my $user = Jifty->web->current_user->user_object;
-        my($votes, $place) = $user->vote_placement;
-        outs _("You have %quant(%1,vote), and are currently ranked #%2!", $votes, $place);
+        my ($votes, $place) = $user->vote_placement;
+
+        outs _("You have %quant(%1,vote), and are ", $votes);
+        hyperlink(
+            label => _("currently ranked"),
+            url   => '/leaderboard/global',
+        );
+        outs _(" #%1!", $place);
     };
 };
 

commit 8f398d32b72e41ac6008e06545b0099e4772addc
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Jul 30 15:58:58 2009 -0400

    Notify the user if they are on the leaderboard

diff --git a/lib/App/Changeloggr/View/Leaderboard.pm b/lib/App/Changeloggr/View/Leaderboard.pm
index 382c52b..08f52a9 100644
--- a/lib/App/Changeloggr/View/Leaderboard.pm
+++ b/lib/App/Changeloggr/View/Leaderboard.pm
@@ -25,9 +25,16 @@ sub show_leaderboard {
         for (0 .. 25) {
             my $vote = $votes->next
                 or last;
+            my $is_current = $vote->user->id == Jifty->web->current_user->id;
             li {
                 my $name = $vote->user->name || 'anonymous';
-                outs _("%1 - %2", $name, $vote->id);
+                outs_raw '<b>' if $is_current;
+                outs _("%1: %2", $name, $vote->id);
+
+                if ($is_current) {
+                    outs_raw '</b>';
+                    outs " -- That's you!";
+                }
             }
         }
     }

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



More information about the Bps-public-commit mailing list