Commit a6e8c7faf38b895b1b3a1bb43956dc3d767149d2

Authored by Daniela Feitosa
Committed by Antonio Terceiro
1 parent f92f835b

Changed profiles list blocks to have 3 columns

ActionItem1773

Signed-off-by: Antonio Terceiro <terceiro@colivre.coop.br>
app/helpers/application_helper.rb
@@ -555,7 +555,7 @@ module ApplicationHelper @@ -555,7 +555,7 @@ module ApplicationHelper
555 # displays a link to the community homepage with its image (as generated by 555 # displays a link to the community homepage with its image (as generated by
556 # #profile_image) and its name and number of members beside it. 556 # #profile_image) and its name and number of members beside it.
557 def community_image_link( profile, size=:portrait, tag='li' ) 557 def community_image_link( profile, size=:portrait, tag='li' )
558 - name = h(profile.name) 558 + name = h(profile.short_name)
559 links = links_for_balloon(profile) 559 links = links_for_balloon(profile)
560 url = url_for(profile.check_membership_url) 560 url = url_for(profile.check_membership_url)
561 content_tag tag, 561 content_tag tag,
app/models/profile_list_block.rb
@@ -38,7 +38,7 @@ class ProfileListBlock &lt; Block @@ -38,7 +38,7 @@ class ProfileListBlock &lt; Block
38 count=0 38 count=0
39 list = profiles.map {|item| 39 list = profiles.map {|item|
40 count+=1 40 count+=1
41 - send(link_method, item ) #+ 41 + send(link_method, item, :minor )
42 }.join("\n ") 42 }.join("\n ")
43 if list.empty? 43 if list.empty?
44 list = '<div class="common-profile-list-block-none">'+ _('None') +'</div>' 44 list = '<div class="common-profile-list-block-none">'+ _('None') +'</div>'
public/stylesheets/application.css
@@ -1430,8 +1430,6 @@ input.disabled { @@ -1430,8 +1430,6 @@ input.disabled {
1430 float: none; 1430 float: none;
1431 padding-left: 0px; 1431 padding-left: 0px;
1432 max-width: none; 1432 max-width: none;
1433 - width: 92px;  
1434 - height: 64px;  
1435 } 1433 }
1436 1434
1437 #content .communities-block .vcard .profile_link { 1435 #content .communities-block .vcard .profile_link {
@@ -1721,6 +1719,18 @@ input.disabled { @@ -1721,6 +1719,18 @@ input.disabled {
1721 border: none; 1719 border: none;
1722 } 1720 }
1723 1721
  1722 +.box-2 .common-profile-list-block span,
  1723 +.box-3 .common-profile-list-block span,
  1724 +.box-2 .common-profile-list-block .profile-image,
  1725 +.box-3 .common-profile-list-block .profile-image {
  1726 + width: 58px;
  1727 +}
  1728 +
  1729 +.box-2 .common-profile-list-block .profile-image,
  1730 +.box-3 .common-profile-list-block .profile-image {
  1731 + height: 50px;
  1732 +}
  1733 +
1724 .common-profile-list-block .locality { 1734 .common-profile-list-block .locality {
1725 font-size: 9px; 1735 font-size: 9px;
1726 opacity: 0.5; 1736 opacity: 0.5;
test/unit/people_block_test.rb
@@ -25,8 +25,8 @@ class PeopleBlockTest &lt; ActiveSupport::TestCase @@ -25,8 +25,8 @@ class PeopleBlockTest &lt; ActiveSupport::TestCase
25 person1 = fast_create(Person, :environment_id => owner.id) 25 person1 = fast_create(Person, :environment_id => owner.id)
26 person2 = fast_create(Person, :environment_id => owner.id) 26 person2 = fast_create(Person, :environment_id => owner.id)
27 27
28 - expects(:profile_image_link).with(person1).returns(person1.name)  
29 - expects(:profile_image_link).with(person2).returns(person2.name) 28 + expects(:profile_image_link).with(person1, :minor).returns(person1.name)
  29 + expects(:profile_image_link).with(person2, :minor).returns(person2.name)
30 expects(:block_title).with(anything).returns('') 30 expects(:block_title).with(anything).returns('')
31 31
32 content = instance_eval(&block.content) 32 content = instance_eval(&block.content)
test/unit/profile_list_block_test.rb
@@ -28,9 +28,9 @@ class ProfileListBlockTest &lt; Test::Unit::TestCase @@ -28,9 +28,9 @@ class ProfileListBlockTest &lt; Test::Unit::TestCase
28 block = ProfileListBlock.new 28 block = ProfileListBlock.new
29 block.stubs(:owner).returns(env) 29 block.stubs(:owner).returns(env)
30 30
31 - self.expects(:profile_image_link).with(person1).once  
32 - self.expects(:profile_image_link).with(person2).once  
33 - self.expects(:profile_image_link).with(person3).once 31 + self.expects(:profile_image_link).with(person1, :minor).once
  32 + self.expects(:profile_image_link).with(person2, :minor).once
  33 + self.expects(:profile_image_link).with(person3, :minor).once
34 34
35 self.expects(:content_tag).returns('<div></div>').at_least_once 35 self.expects(:content_tag).returns('<div></div>').at_least_once
36 self.expects(:block_title).returns('block title').at_least_once 36 self.expects(:block_title).returns('block title').at_least_once