Commit 87f147287451f9a57ecb46df844d57f83c2dff56

Authored by Rodrigo Souto
2 parents a2e9399b 999849e6

Merge branch 'stoa' of gitlab.com:colivre/noosfero into stoa

app/controllers/my_profile/friends_controller.rb
... ... @@ -31,6 +31,16 @@ class FriendsController < MyProfileController
31 31 end
32 32 end
33 33  
  34 + def connections
  35 + @suggestion = profile.profile_suggestions.of_person.enabled.find_by_suggestion_id(params[:id])
  36 + if @suggestion
  37 + @tags = @suggestion.tag_connections
  38 + @profiles = @suggestion.profile_connections
  39 + else
  40 + redirect_to :action => 'suggest'
  41 + end
  42 + end
  43 +
34 44 protected
35 45  
36 46 class << self
... ...
app/controllers/my_profile/memberships_controller.rb
... ... @@ -53,6 +53,16 @@ class MembershipsController &lt; MyProfileController
53 53 end
54 54 end
55 55  
  56 + def connections
  57 + @suggestion = profile.profile_suggestions.of_community.enabled.find_by_suggestion_id(params[:id])
  58 + if @suggestion
  59 + @tags = @suggestion.tag_connections
  60 + @profiles = @suggestion.profile_connections
  61 + else
  62 + redirect_to :action => 'suggest'
  63 + end
  64 + end
  65 +
56 66 protected
57 67  
58 68 def per_page
... ...
app/helpers/application_helper.rb
... ... @@ -1422,17 +1422,25 @@ module ApplicationHelper
1422 1422 def profile_suggestion_profile_connections(suggestion)
1423 1423 profiles = suggestion.profile_connections.first(5).map do |profile|
1424 1424 link_to(profile_image(profile, :icon), profile.url, :class => 'profile-suggestion-connection-icon', :title => profile.name)
1425   - end.join
1426   - extra = suggestion.profile_connections.count > 5 ? "<big> +#{suggestion.profile_connections.count - 5}</big>" : ''
1427   - content_tag(:div, profiles + extra, :class => 'profile-connections')
  1425 + end
  1426 +
  1427 + controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships
  1428 + profiles << link_to("<big> +#{suggestion.profile_connections.count - 5}</big>", :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.profile_connections.count > 5
  1429 +
  1430 + content_tag(:div, profiles.join , :class => 'profile-connections')
1428 1431 end
1429 1432  
1430 1433 def profile_suggestion_tag_connections(suggestion)
1431   - tags = suggestion.tag_connections.map do |tag|
  1434 + tags = suggestion.tag_connections.first(4).map do |tag|
1432 1435 tag.name + ', '
1433 1436 end
1434 1437 last_tag = tags.pop
1435 1438 tags << last_tag.strip.chop if last_tag.present?
1436   - content_tag(:div, tags.join, :class => 'tag-connections', :title => tags.join)
  1439 + title = tags.join
  1440 +
  1441 + controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships
  1442 + tags << link_to('...', :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.tag_connections.count > 4
  1443 +
  1444 + content_tag(:div, tags.join, :class => 'tag-connections', :title => title)
1437 1445 end
1438 1446 end
... ...
public/stylesheets/application.css
... ... @@ -4035,6 +4035,7 @@ h1#agenda-title {
4035 4035 }
4036 4036 .controller-favorite_enterprises .profile-list a.profile-link,
4037 4037 .controller-friends .profile-list a.profile-link,
  4038 +.list-profile-connections .profile-list a.profile-link,
4038 4039 .profiles-suggestions .profile-list a.profile-link {
4039 4040 text-decoration: none;
4040 4041 text-align: center;
... ... @@ -4089,6 +4090,7 @@ h1#agenda-title {
4089 4090 }
4090 4091  
4091 4092 .profiles-suggestions .profile-list .extra_info a {
  4093 + text-decoration: none;
4092 4094 padding: 0;
4093 4095 }
4094 4096  
... ... @@ -4124,15 +4126,48 @@ h1#agenda-title {
4124 4126 width: auto;
4125 4127 }
4126 4128  
4127   -.profiles-suggestions .profile-list li {
4128   - width: 85px;
4129   - max-width: 85px;
  4129 +.list-profile-connections .profile-list li {
  4130 + border: 1px solid transparent;
  4131 + -moz-border-radius: 5px;
  4132 + -webkit-border-radius: 5px;
  4133 +}
  4134 +
  4135 +.list-profile-connections .profile-list li:hover,
  4136 +.profiles-suggestions .profile-list li:hover {
  4137 + border: 1px solid #ccc;
  4138 + background: #eee;
4130 4139 }
4131 4140  
4132 4141 .box-1 .profiles-suggestions .profile-list li {
4133   - width: 76px;
4134   - max-width: 76px;
4135   - border: 2px solid transparent;
  4142 + width: 100px;
  4143 + max-width: 100px;
  4144 + height: 130px;
  4145 + max-height: 100%;
  4146 + overflow: hidden;
  4147 + text-overflow: ellipsis;
  4148 +}
  4149 +
  4150 +.box-1 .profiles-suggestions .profile-list .remove-suggestion,
  4151 +.box-1 .profiles-suggestions .profile-list li > a {
  4152 + text-decoration: none;
  4153 +}
  4154 +
  4155 +.common-profile-list-block .profiles-suggestions .profile-list li {
  4156 + width: 100%;
  4157 + max-width: 100%;
  4158 + height: 70px;
  4159 + max-height: 100%;
  4160 + overflow: hidden;
  4161 + text-overflow: ellipsis;
  4162 +}
  4163 +
  4164 +.common-profile-list-block .profiles-suggestions .profile-list li img {
  4165 + float: left;
  4166 +}
  4167 +
  4168 +#content .common-profile-list-block .profiles-suggestions .profile-list a.profile-link {
  4169 + text-align: left;
  4170 + position: relative;
4136 4171 }
4137 4172  
4138 4173 #content .common-profile-list-block .profiles-suggestions .profile-list li {
... ...