diff --git a/app/controllers/my_profile/friends_controller.rb b/app/controllers/my_profile/friends_controller.rb index 343566d..f900322 100644 --- a/app/controllers/my_profile/friends_controller.rb +++ b/app/controllers/my_profile/friends_controller.rb @@ -31,6 +31,16 @@ class FriendsController < MyProfileController end end + def connections + @suggestion = profile.profile_suggestions.of_person.enabled.find_by_suggestion_id(params[:id]) + if @suggestion + @tags = @suggestion.tag_connections + @profiles = @suggestion.profile_connections + else + redirect_to :action => 'suggest' + end + end + protected class << self diff --git a/app/controllers/my_profile/memberships_controller.rb b/app/controllers/my_profile/memberships_controller.rb index 961a26a..9b20e86 100644 --- a/app/controllers/my_profile/memberships_controller.rb +++ b/app/controllers/my_profile/memberships_controller.rb @@ -53,6 +53,16 @@ class MembershipsController < MyProfileController end end + def connections + @suggestion = profile.profile_suggestions.of_community.enabled.find_by_suggestion_id(params[:id]) + if @suggestion + @tags = @suggestion.tag_connections + @profiles = @suggestion.profile_connections + else + redirect_to :action => 'suggest' + end + end + protected def per_page diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index add0f94..6d77dfd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1422,9 +1422,12 @@ module ApplicationHelper def profile_suggestion_profile_connections(suggestion) profiles = suggestion.profile_connections.first(4).map do |profile| link_to(profile_image(profile, :icon), profile.url, :class => 'profile-suggestion-connection-icon') - end.join - extra = suggestion.profile_connections.count > 4 ? " +#{suggestion.profile_connections.count - 4}" : '' - content_tag(:p, profiles + extra) + end + + controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships + profiles << link_to(" +#{suggestion.profile_connections.count - 4}", :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.profile_connections.count > 4 + + content_tag(:p, profiles.join) end def profile_suggestion_tag_connections(suggestion) @@ -1433,7 +1436,10 @@ module ApplicationHelper end last_tag = tags.pop tags << last_tag.strip.chop if last_tag.present? - tags << '...' if suggestion.tag_connections.count > 4 + + controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships + tags << link_to('...', :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.tag_connections.count > 4 + content_tag(:p, tags.join) end end diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 42545b5..854796a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -4095,6 +4095,10 @@ h1#agenda-title { margin: 0px; } +.profiles-suggestions .profile-list .extra_info a { + text-decoration: none; +} + #content .profiles-suggestions .profile-list .extra_info .profile-suggestion-connection-icon { position: relative; } @@ -4114,6 +4118,13 @@ h1#agenda-title { width: auto; } +.list-profile-connections .profile-list li { + border: 1px solid transparent; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.list-profile-connections .profile-list li:hover, .profiles-suggestions .profile-list li:hover { border: 1px solid #ccc; background: #eee; -- libgit2 0.21.2