From 28a6635e44bd9b632cb5ff9c45702bbcd0f8b08b Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Sun, 19 Dec 2010 08:53:19 -0300 Subject: [PATCH] Making the profile listing blocks more compact. --- app/helpers/application_helper.rb | 23 +---------------------- app/models/communities_block.rb | 4 ---- app/models/profile_list_block.rb | 7 +------ app/views/browse/_person.rhtml | 3 +++ public/designs/themes/base/style.css | 2 -- public/stylesheets/application.css | 15 +++++++++++++-- 6 files changed, 18 insertions(+), 36 deletions(-) create mode 100644 app/views/browse/_person.rhtml diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bfa4b97..3b9b492 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -524,7 +524,6 @@ module ApplicationHelper def profile_image_link( profile, size=:portrait, tag='li', extra_info = nil ) name = profile.short_name if profile.person? - city = content_tag 'span', content_tag( 'span', profile.city, :class => 'locality' ), :class => 'adr' url = url_for(profile.check_friendship_url) trigger_class = 'person-trigger' else @@ -543,7 +542,7 @@ module ApplicationHelper link_to( content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + content_tag( 'span', h(name), :class => ( profile.class == Person ? 'fn' : 'org' ) ) + - city + extra_info + profile_sex_icon( profile ) + profile_cat_icons( profile ), + extra_info + profile_sex_icon( profile ) + profile_cat_icons( profile ), profile.url, :class => 'profile_link url', :help => _('Click on this icon to go to the %s\'s home page') % profile.name, @@ -551,26 +550,6 @@ module ApplicationHelper :class => 'vcard' end - # displays a link to the community homepage with its image (as generated by - # #profile_image) and its name and number of members beside it. - def community_image_link( profile, size=:portrait, tag='li' ) - name = h(profile.short_name) - links = links_for_balloon(profile) - url = url_for(profile.check_membership_url) - content_tag tag, - (environment.enabled?(:show_balloon_with_profile_links_when_clicked) ? link_to( content_tag( 'span', _('Profile links')), '#', :onclick => "toggleSubmenu(this, '#{profile.short_name}', #{links.to_json}); return false", :class => 'menu-submenu-trigger community-trigger', :url => url) : "") + - link_to( - content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + - content_tag( 'span', name, :class => 'org' ) + - content_tag( 'span', n_('1 member', '%s members', profile.members.count) % profile.members.count, :class => 'community-member-count' ), - profile.url, - :class => 'profile_link url', - :help => _('Click on this icon to go to the %s\'s home page') % profile.name, - :title => profile.name ) + - '
', - :class => 'vcard' - end - def gravatar_url_for(email, options = {}) # Ta dando erro de roteamento url_for( { :gravatar_id => Digest::MD5.hexdigest(email), diff --git a/app/models/communities_block.rb b/app/models/communities_block.rb index 0e9ef2e..f027920 100644 --- a/app/models/communities_block.rb +++ b/app/models/communities_block.rb @@ -8,10 +8,6 @@ class CommunitiesBlock < ProfileListBlock n__('{#} community', '{#} communities', profile_count) end - def profile_image_link_method - :community_image_link - end - def help __('This block displays the communities in which the user is a member.') end diff --git a/app/models/profile_list_block.rb b/app/models/profile_list_block.rb index 92ebf07..dc3c671 100644 --- a/app/models/profile_list_block.rb +++ b/app/models/profile_list_block.rb @@ -37,12 +37,11 @@ class ProfileListBlock < Block profiles = self.profile_list title = self.view_title nl = "\n" - link_method = profile_image_link_method lambda do count=0 list = profiles.map {|item| count+=1 - send(link_method, item, :minor ) + send(:profile_image_link, item, :minor ) }.join("\n ") if list.empty? list = '
'+ _('None') +'
' @@ -55,10 +54,6 @@ class ProfileListBlock < Block end end - def profile_image_link_method - :profile_image_link - end - def view_title title.gsub('{#}', profile_count.to_s) end diff --git a/app/views/browse/_person.rhtml b/app/views/browse/_person.rhtml new file mode 100644 index 0000000..80ad4ae --- /dev/null +++ b/app/views/browse/_person.rhtml @@ -0,0 +1,3 @@ +<%= profile_image_link profile, :portrait, 'li', + "#{profile.city}" + + (@filter == 'more_recent' ? profile.send(@filter + '_label') + show_date(profile.created_at) : profile.send(@filter + '_label')) %> diff --git a/public/designs/themes/base/style.css b/public/designs/themes/base/style.css index 9589fd5..5668dd7 100644 --- a/public/designs/themes/base/style.css +++ b/public/designs/themes/base/style.css @@ -678,8 +678,6 @@ div#notice { } .communities-block .vcard a .org { - padding-top: 5px; - max-height: 30px; overflow: hidden; } .msie .communities-block .vcard a .org { diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 0955396..82310f9 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1445,11 +1445,10 @@ input.disabled { #content .communities-block .vcard .profile_link { text-align: center; padding-bottom: 0px; - height: 112px; } .msie7 .communities-block .common-profile-list-block .vcard .profile_link { - height: 120px; + height: 75px; padding-bottom: 0px; } @@ -1705,8 +1704,20 @@ input.disabled { height: 90px; } .msie7 .common-profile-list-block .vcard a { + width: 92px; +} + +.box-2 .common-profile-list-block .vcard a.profile_link, +.box-3 .common-profile-list-block .vcard a.profile_link { + height: 75px; + max-height: 75px; +} + +.msie7 .box-2 .common-profile-list-block .vcard a, +.msie7 .box-3 .common-profile-list-block .vcard a { width: 58px; } + .common-profile-list-block .vcard a:hover { border: 2px solid #2A5896; background: #B8CFE7; -- libgit2 0.21.2