Commit 902dbc8b889691e782b9bcee591fdefcef1f6cd2

Authored by Rodrigo Souto
1 parent 1a41a455

profile-suggestions: add title to profile-icon and increase max profile-icons to 5

app/helpers/application_helper.rb
@@ -1420,11 +1420,11 @@ module ApplicationHelper @@ -1420,11 +1420,11 @@ module ApplicationHelper
1420 end 1420 end
1421 1421
1422 def profile_suggestion_profile_connections(suggestion) 1422 def profile_suggestion_profile_connections(suggestion)
1423 - profiles = suggestion.profile_connections.first(4).map do |profile|  
1424 - link_to(profile_image(profile, :icon), profile.url, :class => 'profile-suggestion-connection-icon') 1423 + profiles = suggestion.profile_connections.first(5).map do |profile|
  1424 + link_to(profile_image(profile, :icon), profile.url, :class => 'profile-suggestion-connection-icon', :title => profile.name)
1425 end.join 1425 end.join
1426 - extra = suggestion.profile_connections.count > 4 ? "<big> +#{suggestion.profile_connections.count - 4}</big>" : ''  
1427 - content_tag(:p, profiles + extra) 1426 + extra = suggestion.profile_connections.count > 5 ? "<big> +#{suggestion.profile_connections.count - 5}</big>" : ''
  1427 + content_tag(:div, profiles + extra, :class => 'profile-connections')
1428 end 1428 end
1429 1429
1430 def profile_suggestion_tag_connections(suggestion) 1430 def profile_suggestion_tag_connections(suggestion)
app/models/profile_suggestion.rb
@@ -135,6 +135,7 @@ class ProfileSuggestion &lt; ActiveRecord::Base @@ -135,6 +135,7 @@ class ProfileSuggestion &lt; ActiveRecord::Base
135 end 135 end
136 suggestion.send("#{rule}=", value) 136 suggestion.send("#{rule}=", value)
137 connections.each do |connection_id| 137 connections.each do |connection_id|
  138 + next if SuggestionConnection.where(:suggestion_id => suggestion.id, :connection_id => connection_id, :connection_type => options[:connection]).present?
138 SuggestionConnection.create!(:suggestion => suggestion, :connection_id => connection_id, :connection_type => options[:connection]) 139 SuggestionConnection.create!(:suggestion => suggestion, :connection_id => connection_id, :connection_type => options[:connection])
139 end 140 end
140 suggestion.score += value * options[:weight] 141 suggestion.score += value * options[:weight]