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

sartak at bestpractical.com sartak at bestpractical.com
Wed Apr 29 19:58:49 EDT 2009


The branch, master has been updated
       via  de8c2303b740b1dd25b7c8e20c15a0989f4e3da4 (commit)
      from  630b17c26837457242affdf1abb4a9ad09fecd0d (commit)

Summary of changes:
 lib/App/Changeloggr/Model/User.pm   |    9 +++++++++
 lib/App/Changeloggr/View/Account.pm |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit de8c2303b740b1dd25b7c8e20c15a0989f4e3da4
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed Apr 29 19:58:40 2009 -0400

    Display vote count (it's something at least)

diff --git a/lib/App/Changeloggr/Model/User.pm b/lib/App/Changeloggr/Model/User.pm
index eef45fe..3f30c0b 100644
--- a/lib/App/Changeloggr/Model/User.pm
+++ b/lib/App/Changeloggr/Model/User.pm
@@ -16,6 +16,9 @@ use App::Changeloggr::Record schema {
         is immutable;
 };
 
+# has to go below schema
+use JiftyX::ModelHelpers;
+
 sub since { '0.0.4' }
 
 sub current_user_can {
@@ -37,5 +40,11 @@ sub current_user_can {
     return $self->SUPER::current_user_can($right, %args);
 }
 
+sub votes {
+    my $self = shift;
+
+    return M('VoteCollection', user_id => $self->id);
+}
+
 1;
 
diff --git a/lib/App/Changeloggr/View/Account.pm b/lib/App/Changeloggr/View/Account.pm
index 2913736..1575686 100644
--- a/lib/App/Changeloggr/View/Account.pm
+++ b/lib/App/Changeloggr/View/Account.pm
@@ -17,6 +17,8 @@ template '/index.html' => page {
 };
 
 template '/votes' => page {
+    my $user = Jifty->web->current_user->user_object;
+    p { _("You've voted on %quant(%1,change).", $user->votes->count) };
 };
 
 1;

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



More information about the Bps-public-commit mailing list