Commit 28a6635e44bd9b632cb5ff9c45702bbcd0f8b08b
Committed by
Antonio Terceiro
1 parent
49e9185a
Exists in
master
and in
28 other branches
Making the profile listing blocks more compact.
* Removing city from profile_image_link * Removed unnecessary method community_image_link * Added people's city when browsing people (ActionItem1773) Signed-off-by: Antonio Terceiro <terceiro@colivre.coop.br>
Showing
6 changed files
with
18 additions
and
36 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -524,7 +524,6 @@ module ApplicationHelper | @@ -524,7 +524,6 @@ module ApplicationHelper | ||
524 | def profile_image_link( profile, size=:portrait, tag='li', extra_info = nil ) | 524 | def profile_image_link( profile, size=:portrait, tag='li', extra_info = nil ) |
525 | name = profile.short_name | 525 | name = profile.short_name |
526 | if profile.person? | 526 | if profile.person? |
527 | - city = content_tag 'span', content_tag( 'span', profile.city, :class => 'locality' ), :class => 'adr' | ||
528 | url = url_for(profile.check_friendship_url) | 527 | url = url_for(profile.check_friendship_url) |
529 | trigger_class = 'person-trigger' | 528 | trigger_class = 'person-trigger' |
530 | else | 529 | else |
@@ -543,7 +542,7 @@ module ApplicationHelper | @@ -543,7 +542,7 @@ module ApplicationHelper | ||
543 | link_to( | 542 | link_to( |
544 | content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + | 543 | content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + |
545 | content_tag( 'span', h(name), :class => ( profile.class == Person ? 'fn' : 'org' ) ) + | 544 | content_tag( 'span', h(name), :class => ( profile.class == Person ? 'fn' : 'org' ) ) + |
546 | - city + extra_info + profile_sex_icon( profile ) + profile_cat_icons( profile ), | 545 | + extra_info + profile_sex_icon( profile ) + profile_cat_icons( profile ), |
547 | profile.url, | 546 | profile.url, |
548 | :class => 'profile_link url', | 547 | :class => 'profile_link url', |
549 | :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name, | 548 | :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name, |
@@ -551,26 +550,6 @@ module ApplicationHelper | @@ -551,26 +550,6 @@ module ApplicationHelper | ||
551 | :class => 'vcard' | 550 | :class => 'vcard' |
552 | end | 551 | end |
553 | 552 | ||
554 | - # displays a link to the community homepage with its image (as generated by | ||
555 | - # #profile_image) and its name and number of members beside it. | ||
556 | - def community_image_link( profile, size=:portrait, tag='li' ) | ||
557 | - name = h(profile.short_name) | ||
558 | - links = links_for_balloon(profile) | ||
559 | - url = url_for(profile.check_membership_url) | ||
560 | - content_tag tag, | ||
561 | - (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) : "") + | ||
562 | - link_to( | ||
563 | - content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + | ||
564 | - content_tag( 'span', name, :class => 'org' ) + | ||
565 | - content_tag( 'span', n_('1 member', '%s members', profile.members.count) % profile.members.count, :class => 'community-member-count' ), | ||
566 | - profile.url, | ||
567 | - :class => 'profile_link url', | ||
568 | - :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name, | ||
569 | - :title => profile.name ) + | ||
570 | - '<br class="may-clear"/>', | ||
571 | - :class => 'vcard' | ||
572 | - end | ||
573 | - | ||
574 | def gravatar_url_for(email, options = {}) | 553 | def gravatar_url_for(email, options = {}) |
575 | # Ta dando erro de roteamento | 554 | # Ta dando erro de roteamento |
576 | url_for( { :gravatar_id => Digest::MD5.hexdigest(email), | 555 | url_for( { :gravatar_id => Digest::MD5.hexdigest(email), |
app/models/communities_block.rb
@@ -8,10 +8,6 @@ class CommunitiesBlock < ProfileListBlock | @@ -8,10 +8,6 @@ class CommunitiesBlock < ProfileListBlock | ||
8 | n__('{#} community', '{#} communities', profile_count) | 8 | n__('{#} community', '{#} communities', profile_count) |
9 | end | 9 | end |
10 | 10 | ||
11 | - def profile_image_link_method | ||
12 | - :community_image_link | ||
13 | - end | ||
14 | - | ||
15 | def help | 11 | def help |
16 | __('This block displays the communities in which the user is a member.') | 12 | __('This block displays the communities in which the user is a member.') |
17 | end | 13 | end |
app/models/profile_list_block.rb
@@ -37,12 +37,11 @@ class ProfileListBlock < Block | @@ -37,12 +37,11 @@ class ProfileListBlock < Block | ||
37 | profiles = self.profile_list | 37 | profiles = self.profile_list |
38 | title = self.view_title | 38 | title = self.view_title |
39 | nl = "\n" | 39 | nl = "\n" |
40 | - link_method = profile_image_link_method | ||
41 | lambda do | 40 | lambda do |
42 | count=0 | 41 | count=0 |
43 | list = profiles.map {|item| | 42 | list = profiles.map {|item| |
44 | count+=1 | 43 | count+=1 |
45 | - send(link_method, item, :minor ) | 44 | + send(:profile_image_link, item, :minor ) |
46 | }.join("\n ") | 45 | }.join("\n ") |
47 | if list.empty? | 46 | if list.empty? |
48 | list = '<div class="common-profile-list-block-none">'+ _('None') +'</div>' | 47 | list = '<div class="common-profile-list-block-none">'+ _('None') +'</div>' |
@@ -55,10 +54,6 @@ class ProfileListBlock < Block | @@ -55,10 +54,6 @@ class ProfileListBlock < Block | ||
55 | end | 54 | end |
56 | end | 55 | end |
57 | 56 | ||
58 | - def profile_image_link_method | ||
59 | - :profile_image_link | ||
60 | - end | ||
61 | - | ||
62 | def view_title | 57 | def view_title |
63 | title.gsub('{#}', profile_count.to_s) | 58 | title.gsub('{#}', profile_count.to_s) |
64 | end | 59 | end |
public/designs/themes/base/style.css
@@ -678,8 +678,6 @@ div#notice { | @@ -678,8 +678,6 @@ div#notice { | ||
678 | } | 678 | } |
679 | 679 | ||
680 | .communities-block .vcard a .org { | 680 | .communities-block .vcard a .org { |
681 | - padding-top: 5px; | ||
682 | - max-height: 30px; | ||
683 | overflow: hidden; | 681 | overflow: hidden; |
684 | } | 682 | } |
685 | .msie .communities-block .vcard a .org { | 683 | .msie .communities-block .vcard a .org { |
public/stylesheets/application.css
@@ -1445,11 +1445,10 @@ input.disabled { | @@ -1445,11 +1445,10 @@ input.disabled { | ||
1445 | #content .communities-block .vcard .profile_link { | 1445 | #content .communities-block .vcard .profile_link { |
1446 | text-align: center; | 1446 | text-align: center; |
1447 | padding-bottom: 0px; | 1447 | padding-bottom: 0px; |
1448 | - height: 112px; | ||
1449 | } | 1448 | } |
1450 | 1449 | ||
1451 | .msie7 .communities-block .common-profile-list-block .vcard .profile_link { | 1450 | .msie7 .communities-block .common-profile-list-block .vcard .profile_link { |
1452 | - height: 120px; | 1451 | + height: 75px; |
1453 | padding-bottom: 0px; | 1452 | padding-bottom: 0px; |
1454 | } | 1453 | } |
1455 | 1454 | ||
@@ -1705,8 +1704,20 @@ input.disabled { | @@ -1705,8 +1704,20 @@ input.disabled { | ||
1705 | height: 90px; | 1704 | height: 90px; |
1706 | } | 1705 | } |
1707 | .msie7 .common-profile-list-block .vcard a { | 1706 | .msie7 .common-profile-list-block .vcard a { |
1707 | + width: 92px; | ||
1708 | +} | ||
1709 | + | ||
1710 | +.box-2 .common-profile-list-block .vcard a.profile_link, | ||
1711 | +.box-3 .common-profile-list-block .vcard a.profile_link { | ||
1712 | + height: 75px; | ||
1713 | + max-height: 75px; | ||
1714 | +} | ||
1715 | + | ||
1716 | +.msie7 .box-2 .common-profile-list-block .vcard a, | ||
1717 | +.msie7 .box-3 .common-profile-list-block .vcard a { | ||
1708 | width: 58px; | 1718 | width: 58px; |
1709 | } | 1719 | } |
1720 | + | ||
1710 | .common-profile-list-block .vcard a:hover { | 1721 | .common-profile-list-block .vcard a:hover { |
1711 | border: 2px solid #2A5896; | 1722 | border: 2px solid #2A5896; |
1712 | background: #B8CFE7; | 1723 | background: #B8CFE7; |