From 55952f37d6f91330197daa8d2ca4c627be9485ba Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Wed, 27 Feb 2008 15:17:48 +0000 Subject: [PATCH] ActionItem36: pointing to /profile/${person}/friends --- app/models/friends_block.rb | 7 +++++++ public/stylesheets/blocks/friends-block.css | 1 + public/stylesheets/blocks/profile-list-block.css | 2 ++ test/unit/friends_block_test.rb | 12 ++++++++++++ 4 files changed, 22 insertions(+), 0 deletions(-) create mode 120000 public/stylesheets/blocks/friends-block.css diff --git a/app/models/friends_block.rb b/app/models/friends_block.rb index baa5f93..6d37394 100644 --- a/app/models/friends_block.rb +++ b/app/models/friends_block.rb @@ -8,6 +8,13 @@ class FriendsBlock < ProfileListBlock _('Friends') end + def footer + owner_id = owner.identifier + lambda do + link_to _('All friends'), :profile => owner_id, :controller => 'profile', :action => 'friends' + end + end + class FriendsBlock::Finder < ProfileListBlock::Finder def ids self.block.owner.friend_ids diff --git a/public/stylesheets/blocks/friends-block.css b/public/stylesheets/blocks/friends-block.css new file mode 120000 index 0000000..748a402 --- /dev/null +++ b/public/stylesheets/blocks/friends-block.css @@ -0,0 +1 @@ +profile-list-block.css \ No newline at end of file diff --git a/public/stylesheets/blocks/profile-list-block.css b/public/stylesheets/blocks/profile-list-block.css index cd2499c..02b16c8 100644 --- a/public/stylesheets/blocks/profile-list-block.css +++ b/public/stylesheets/blocks/profile-list-block.css @@ -56,12 +56,14 @@ } .enterprises-block .block-footer-content, +.friends-block .block-footer-content, .communities-block .block-footer-content { text-align: center; font-size: 80%; padding: 5px 0px 0px 0px; } .msie .enterprises-block .block-footer-content, +.msie .friends-block .block-footer-content, .msie .communities-block .block-footer-content { padding: 0px; margin-top: -5px; diff --git a/test/unit/friends_block_test.rb b/test/unit/friends_block_test.rb index 7bb0dda..3ee70d5 100644 --- a/test/unit/friends_block_test.rb +++ b/test/unit/friends_block_test.rb @@ -31,4 +31,16 @@ class FriendsBlockTest < ActiveSupport::TestCase assert_equivalent [p2, p3, p4], block.profiles end + should 'point to list with all friends' do + block = FriendsBlock.new + user = mock + user.expects(:identifier).returns('theuser') + block.expects(:owner).returns(user) + + def self._(s); s; end + expects(:link_to).with('All friends', :profile => 'theuser', :controller => 'profile', :action => 'friends') + + instance_eval(&block.footer) + end + end -- libgit2 0.21.2