Commit 15e48e28a00fe6fd54d37c871afb12f6792597d3

Authored by Larissa Reis
1 parent 6abdae0a

profile-suggestions: adds profile and tag connections below user

(ActionItem3234)
app/helpers/application_helper.rb
@@ -1420,12 +1420,19 @@ module ApplicationHelper @@ -1420,12 +1420,19 @@ module ApplicationHelper
1420 end 1420 end
1421 1421
1422 def profile_suggestion_profile_connections(suggestion) 1422 def profile_suggestion_profile_connections(suggestion)
1423 - suggestion.profile_connections.map do |cat| 1423 + profiles = suggestion.profile_connections.first(4).map do |profile|
  1424 + link_to(profile_image(profile, :icon), profile.url, :class => 'profile-suggestion-connection-icon')
1424 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)
1425 end 1428 end
1426 1429
1427 def profile_suggestion_tag_connections(suggestion) 1430 def profile_suggestion_tag_connections(suggestion)
1428 - suggestion.tag_connections.map do |cat|  
1429 - end.join 1431 + tags = suggestion.tag_connections.map do |tag|
  1432 + tag.name + ', '
  1433 + end
  1434 + last_tag = tags.pop
  1435 + tags << last_tag.strip.chop if last_tag.present?
  1436 + content_tag(:p, tags.join)
1430 end 1437 end
1431 end 1438 end
app/views/shared/_profile_suggestions_list.html.erb
@@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
18 s.suggestion.add_url, :class => 'accept-suggestion' %> 18 s.suggestion.add_url, :class => 'accept-suggestion' %>
19 <% end %> 19 <% end %>
20 <div class='extra_info'> 20 <div class='extra_info'>
21 - <%= profile_suggestion_categories(s) %> 21 + <%= profile_suggestion_profile_connections(s) %>
  22 + <%= profile_suggestion_tag_connections(s) %>
22 </div> 23 </div>
23 <div class="controll"> 24 <div class="controll">
24 <% if collection == :friends_suggestions %> 25 <% if collection == :friends_suggestions %>
public/stylesheets/application.css
@@ -4085,6 +4085,16 @@ h1#agenda-title { @@ -4085,6 +4085,16 @@ h1#agenda-title {
4085 margin: 0px; 4085 margin: 0px;
4086 } 4086 }
4087 4087
  4088 +#content .profiles-suggestions .profile-list .extra_info .profile-suggestion-connection-icon {
  4089 + position: relative;
  4090 +}
  4091 +
  4092 +.profiles-suggestions .profile-list .extra_info big {
  4093 + font-size: 14px;
  4094 + font-weight: bold;
  4095 + vertical-align: text-bottom;
  4096 +}
  4097 +
4088 .profiles-suggestions .profile-list .extra_info span { 4098 .profiles-suggestions .profile-list .extra_info span {
4089 background-position: 4px 50%; 4099 background-position: 4px 50%;
4090 background-repeat: no-repeat; 4100 background-repeat: no-repeat;