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 | 524 | def profile_image_link( profile, size=:portrait, tag='li', extra_info = nil ) |
525 | 525 | name = profile.short_name |
526 | 526 | if profile.person? |
527 | - city = content_tag 'span', content_tag( 'span', profile.city, :class => 'locality' ), :class => 'adr' | |
528 | 527 | url = url_for(profile.check_friendship_url) |
529 | 528 | trigger_class = 'person-trigger' |
530 | 529 | else |
... | ... | @@ -543,7 +542,7 @@ module ApplicationHelper |
543 | 542 | link_to( |
544 | 543 | content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + |
545 | 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 | 546 | profile.url, |
548 | 547 | :class => 'profile_link url', |
549 | 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 | 550 | :class => 'vcard' |
552 | 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 | 553 | def gravatar_url_for(email, options = {}) |
575 | 554 | # Ta dando erro de roteamento |
576 | 555 | url_for( { :gravatar_id => Digest::MD5.hexdigest(email), | ... | ... |
app/models/communities_block.rb
... | ... | @@ -8,10 +8,6 @@ class CommunitiesBlock < ProfileListBlock |
8 | 8 | n__('{#} community', '{#} communities', profile_count) |
9 | 9 | end |
10 | 10 | |
11 | - def profile_image_link_method | |
12 | - :community_image_link | |
13 | - end | |
14 | - | |
15 | 11 | def help |
16 | 12 | __('This block displays the communities in which the user is a member.') |
17 | 13 | end | ... | ... |
app/models/profile_list_block.rb
... | ... | @@ -37,12 +37,11 @@ class ProfileListBlock < Block |
37 | 37 | profiles = self.profile_list |
38 | 38 | title = self.view_title |
39 | 39 | nl = "\n" |
40 | - link_method = profile_image_link_method | |
41 | 40 | lambda do |
42 | 41 | count=0 |
43 | 42 | list = profiles.map {|item| |
44 | 43 | count+=1 |
45 | - send(link_method, item, :minor ) | |
44 | + send(:profile_image_link, item, :minor ) | |
46 | 45 | }.join("\n ") |
47 | 46 | if list.empty? |
48 | 47 | list = '<div class="common-profile-list-block-none">'+ _('None') +'</div>' |
... | ... | @@ -55,10 +54,6 @@ class ProfileListBlock < Block |
55 | 54 | end |
56 | 55 | end |
57 | 56 | |
58 | - def profile_image_link_method | |
59 | - :profile_image_link | |
60 | - end | |
61 | - | |
62 | 57 | def view_title |
63 | 58 | title.gsub('{#}', profile_count.to_s) |
64 | 59 | end | ... | ... |
public/designs/themes/base/style.css
public/stylesheets/application.css
... | ... | @@ -1445,11 +1445,10 @@ input.disabled { |
1445 | 1445 | #content .communities-block .vcard .profile_link { |
1446 | 1446 | text-align: center; |
1447 | 1447 | padding-bottom: 0px; |
1448 | - height: 112px; | |
1449 | 1448 | } |
1450 | 1449 | |
1451 | 1450 | .msie7 .communities-block .common-profile-list-block .vcard .profile_link { |
1452 | - height: 120px; | |
1451 | + height: 75px; | |
1453 | 1452 | padding-bottom: 0px; |
1454 | 1453 | } |
1455 | 1454 | |
... | ... | @@ -1705,8 +1704,20 @@ input.disabled { |
1705 | 1704 | height: 90px; |
1706 | 1705 | } |
1707 | 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 | 1718 | width: 58px; |
1709 | 1719 | } |
1720 | + | |
1710 | 1721 | .common-profile-list-block .vcard a:hover { |
1711 | 1722 | border: 2px solid #2A5896; |
1712 | 1723 | background: #B8CFE7; | ... | ... |