Commit 6fab2d0fae8fdecf336e4c7dbf4249ba8208a3a6

Authored by Larissa Reis
2 parents 4094e425 12f1d2a5

Merge remote-tracking branch 'colivre/stoa' into feedback

Conflicts:
	app/helpers/application_helper.rb
	public/designs/themes/base/style.css
	public/stylesheets/application.css
app/helpers/application_helper.rb
@@ -1420,14 +1420,14 @@ module ApplicationHelper @@ -1420,14 +1420,14 @@ 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 1425 end
1426 1426
1427 controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships 1427 controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships
1428 - profiles << link_to("<big> +#{suggestion.profile_connections.count - 4}</big>", :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.profile_connections.count > 4 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 1429
1430 - content_tag(:p, profiles.join) 1430 + content_tag(:div, profiles.join , :class => 'profile-connections')
1431 end 1431 end
1432 1432
1433 def profile_suggestion_tag_connections(suggestion) 1433 def profile_suggestion_tag_connections(suggestion)
@@ -1440,6 +1440,6 @@ module ApplicationHelper @@ -1440,6 +1440,6 @@ module ApplicationHelper
1440 controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships 1440 controller_target = suggestion.suggestion_type == 'Person' ? :friends : :memberships
1441 tags << link_to('...', :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.tag_connections.count > 4 1441 tags << link_to('...', :controller => controller_target, :action => :connections, :id => suggestion.suggestion_id) if suggestion.tag_connections.count > 4
1442 1442
1443 - content_tag(:p, tags.join) 1443 + content_tag(:div, tags.join, :class => 'tag-connections')
1444 end 1444 end
1445 end 1445 end
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]
app/views/blocks/communities.html.erb
@@ -12,6 +12,8 @@ @@ -12,6 +12,8 @@
12 <div class='profiles-suggestions'> 12 <div class='profiles-suggestions'>
13 <%= render :partial => 'shared/profile_suggestions_list', :locals => { :suggestions => suggestions, :collection => :communities_suggestions } %> 13 <%= render :partial => 'shared/profile_suggestions_list', :locals => { :suggestions => suggestions, :collection => :communities_suggestions } %>
14 </div> 14 </div>
15 - <%= link_to _('See more suggestions'), profile.communities_suggestions_url, :class => 'more-suggestions' %> 15 + <div class='more-suggestions'>
  16 + <%= link_to _('See more suggestions'), profile.communities_suggestions_url %>
  17 + </div>
16 </div> 18 </div>
17 <% end %> 19 <% end %>
plugins/people_block/public/style.css
@@ -73,17 +73,6 @@ @@ -73,17 +73,6 @@
73 width: auto; 73 width: auto;
74 display: block; 74 display: block;
75 } 75 }
76 -#content .people-block .block-footer-content a,  
77 -#content .friends-block .block-footer-content a,  
78 -#content .members-block .block-footer-content a {  
79 - position: absolute;  
80 - top: 2px;  
81 - right: 0px;  
82 - font-size: 11px;  
83 - color: #000;  
84 - text-decoration: none;  
85 - padding-right: 15px;  
86 -}  
87 #content .members-block .block-footer-content .join-leave-button a { 76 #content .members-block .block-footer-content .join-leave-button a {
88 position: relative; 77 position: relative;
89 background-color: #EEE; 78 background-color: #EEE;
plugins/people_block/views/blocks/friends.html.erb
@@ -6,6 +6,8 @@ @@ -6,6 +6,8 @@
6 <div class='profiles-suggestions'> 6 <div class='profiles-suggestions'>
7 <%= render :partial => 'shared/profile_suggestions_list', :locals => { :suggestions => suggestions, :collection => :friends_suggestions } %> 7 <%= render :partial => 'shared/profile_suggestions_list', :locals => { :suggestions => suggestions, :collection => :friends_suggestions } %>
8 </div> 8 </div>
9 - <%= link_to _('See more suggestions'), profile.people_suggestions_url, :class => 'more-suggestions' %> 9 + <div class='more-suggestions'>
  10 + <%= link_to _('See more suggestions'), profile.people_suggestions_url %>
  11 + </div>
10 </div> 12 </div>
11 <% end %> 13 <% end %>
public/designs/themes/base/style.css
@@ -416,7 +416,7 @@ div#notice { @@ -416,7 +416,7 @@ div#notice {
416 font-variant: normal; 416 font-variant: normal;
417 color: #AAA; 417 color: #AAA;
418 font-size: 11px; 418 font-size: 11px;
419 - text-align: left; 419 + text-align: center;
420 border-bottom: 1px solid #AAA; 420 border-bottom: 1px solid #AAA;
421 padding: 2px 0; 421 padding: 2px 0;
422 } 422 }
@@ -504,10 +504,7 @@ div#notice { @@ -504,10 +504,7 @@ div#notice {
504 display: block; 504 display: block;
505 } 505 }
506 506
507 -#content .tags-block .block-footer-content a,  
508 -#content .profile-list-block .block-footer-content a,  
509 -#content .enterprises-block .block-footer-content a,  
510 -#content .communities-block .block-footer-content a { 507 +.block-footer-content a.view-all {
511 position: absolute; 508 position: absolute;
512 top: 2px; 509 top: 2px;
513 right: 0px; 510 right: 0px;
@@ -515,11 +512,6 @@ div#notice { @@ -515,11 +512,6 @@ div#notice {
515 color: #000; 512 color: #000;
516 text-decoration: none; 513 text-decoration: none;
517 padding-right: 15px; 514 padding-right: 15px;
518 -}  
519 -#content .tags-block .block-footer-content a,  
520 -#content .profile-list-block .block-footer-content a,  
521 -#content .enterprises-block .block-footer-content a,  
522 -#content .communities-block .block-footer-content a.view-all {  
523 background: url(imgs/arrow-right-p.png) 100% 50% no-repeat; 515 background: url(imgs/arrow-right-p.png) 100% 50% no-repeat;
524 } 516 }
525 517
public/stylesheets/application.css
@@ -1668,6 +1668,10 @@ a.button.disabled, input.disabled { @@ -1668,6 +1668,10 @@ a.button.disabled, input.disabled {
1668 padding-bottom: 0px; 1668 padding-bottom: 0px;
1669 } 1669 }
1670 1670
  1671 +#content .block-footer-content .profiles-suggestions a {
  1672 + text-decoration: none;
  1673 +}
  1674 +
1671 #content .communities-block .block-footer-content .profiles-suggestions a.accept-suggestion, 1675 #content .communities-block .block-footer-content .profiles-suggestions a.accept-suggestion,
1672 #content .communities-block .block-footer-content .profiles-suggestions a.remove-suggestion { 1676 #content .communities-block .block-footer-content .profiles-suggestions a.remove-suggestion {
1673 position: relative; 1677 position: relative;
@@ -1676,8 +1680,13 @@ a.button.disabled, input.disabled { @@ -1676,8 +1680,13 @@ a.button.disabled, input.disabled {
1676 1680
1677 #content .block-footer-content .profiles-suggestions a.accept-suggestion { 1681 #content .block-footer-content .profiles-suggestions a.accept-suggestion {
1678 padding-bottom: 3px; 1682 padding-bottom: 3px;
1679 - display: block; 1683 + display: inline-block;
1680 color: #333; 1684 color: #333;
  1685 + font-size: 11px
  1686 +}
  1687 +
  1688 +#content .block-footer-content .profiles-suggestions a.accept-suggestion:hover {
  1689 + text-decoration: underline;
1681 } 1690 }
1682 1691
1683 #content .profiles-suggestions .profile-list a.remove-suggestion { 1692 #content .profiles-suggestions .profile-list a.remove-suggestion {
@@ -1690,6 +1699,7 @@ a.button.disabled, input.disabled { @@ -1690,6 +1699,7 @@ a.button.disabled, input.disabled {
1690 font-size: 14px; 1699 font-size: 14px;
1691 text-align: center; 1700 text-align: center;
1692 font-weight: bold; 1701 font-weight: bold;
  1702 + margin: 1px 1px 0 0;
1693 } 1703 }
1694 1704
1695 #content .profiles-suggestions .profile-list a.remove-suggestion:hover { 1705 #content .profiles-suggestions .profile-list a.remove-suggestion:hover {
@@ -1705,12 +1715,13 @@ a.button.disabled, input.disabled { @@ -1705,12 +1715,13 @@ a.button.disabled, input.disabled {
1705 font-weight: bold; 1715 font-weight: bold;
1706 } 1716 }
1707 1717
1708 -#content .communities-block .profiles-suggestions .profile-list .extra_info {  
1709 - z-index: 10; 1718 +.more-suggestions {
  1719 + text-align: center;
1710 } 1720 }
1711 1721
1712 -#content .communities-block .block-footer-content a.more-suggestions {  
1713 - position: relative; 1722 +.profiles-suggestions .profile-list .extra_info {
  1723 + z-index: 10;
  1724 + display: inline-block;
1714 } 1725 }
1715 1726
1716 .suggestions-block .block-subtitle { 1727 .suggestions-block .block-subtitle {
@@ -3995,49 +4006,31 @@ h1#agenda-title { @@ -3995,49 +4006,31 @@ h1#agenda-title {
3995 4006
3996 /* ==> @import url(manage_contacts_list.css); <== */ 4007 /* ==> @import url(manage_contacts_list.css); <== */
3997 4008
3998 -.controller-favorite_enterprises .profile-list,  
3999 -.controller-friends .profile-list,  
4000 -.profiles-suggestions .profile-list { 4009 +.profile-list {
4001 margin: 0px; 4010 margin: 0px;
4002 padding: 0px; 4011 padding: 0px;
4003 list-style: none; 4012 list-style: none;
4004 } 4013 }
4005 -.controller-favorite_enterprises .profile-list li,  
4006 -.controller-friends .profile-list li { 4014 +
  4015 +.profile-list li {
4007 float: left; 4016 float: left;
4008 margin: 5px; 4017 margin: 5px;
4009 - height: 90px;  
4010 - max-height: 80px;  
4011 padding: 5px; 4018 padding: 5px;
4012 - border: 2px solid transparent;  
4013 list-style: none; 4019 list-style: none;
4014 position: relative; 4020 position: relative;
4015 } 4021 }
4016 -.profiles-suggestions .profile-list li {  
4017 - float: left;  
4018 - margin: 5px;  
4019 - height: 90px;  
4020 - max-height: 80px;  
4021 - padding: 5px;  
4022 - border: 1px solid transparent;  
4023 - list-style: none;  
4024 - position: relative;  
4025 - -moz-border-radius: 5px;  
4026 - -webkit-border-radius: 5px; 4022 +
  4023 +.profile-list li:hover {
  4024 + background-color: #eeeeec;
4027 } 4025 }
  4026 +
4028 .controller-favorite_enterprises .profile-list li, 4027 .controller-favorite_enterprises .profile-list li,
4029 .controller-friends .profile-list li { 4028 .controller-friends .profile-list li {
4030 width: 90px; 4029 width: 90px;
4031 max-width: 80px; 4030 max-width: 80px;
4032 } 4031 }
4033 4032
4034 -.controller-favorite_enterprises .profile-list li:hover,  
4035 -.controller-friends .profile-list li:hover {  
4036 - border: 2px solid #eeeeec;  
4037 -}  
4038 -.controller-favorite_enterprises .profile-list img,  
4039 -.controller-friends .profile-list img,  
4040 -.profiles-suggestions .profile-list img { 4033 +.profile-list img {
4041 border: none; 4034 border: none;
4042 } 4035 }
4043 .controller-favorite_enterprises .profile-list a.profile-link, 4036 .controller-favorite_enterprises .profile-list a.profile-link,
@@ -4097,6 +4090,16 @@ h1#agenda-title { @@ -4097,6 +4090,16 @@ h1#agenda-title {
4097 4090
4098 .profiles-suggestions .profile-list .extra_info a { 4091 .profiles-suggestions .profile-list .extra_info a {
4099 text-decoration: none; 4092 text-decoration: none;
  4093 + padding: 0;
  4094 +}
  4095 +
  4096 +.profile-connections {
  4097 + height: 20px;
  4098 +}
  4099 +
  4100 +.tag-connections {
  4101 + margin-left: 2px;
  4102 + margin-top: 3px;
4100 } 4103 }
4101 4104
4102 #content .profiles-suggestions .profile-list .extra_info .profile-suggestion-connection-icon { 4105 #content .profiles-suggestions .profile-list .extra_info .profile-suggestion-connection-icon {
@@ -4106,7 +4109,7 @@ h1#agenda-title { @@ -4106,7 +4109,7 @@ h1#agenda-title {
4106 .profiles-suggestions .profile-list .extra_info big { 4109 .profiles-suggestions .profile-list .extra_info big {
4107 font-size: 14px; 4110 font-size: 14px;
4108 font-weight: bold; 4111 font-weight: bold;
4109 - vertical-align: text-bottom; 4112 + line-height: 20px;
4110 } 4113 }
4111 4114
4112 .profiles-suggestions .profile-list .extra_info span { 4115 .profiles-suggestions .profile-list .extra_info span {
@@ -4162,6 +4165,25 @@ h1#agenda-title { @@ -4162,6 +4165,25 @@ h1#agenda-title {
4162 position: relative; 4165 position: relative;
4163 } 4166 }
4164 4167
  4168 +#content .common-profile-list-block .profiles-suggestions .profile-list li {
  4169 + width: 100%;
  4170 + max-width: 100%;
  4171 + padding: 3px 0;
  4172 +}
  4173 +
  4174 +.common-profile-list-block .profiles-suggestions .profile-list li img {
  4175 + float: left;
  4176 +}
  4177 +
  4178 +#content .common-profile-list-block .profiles-suggestions .profile-list a.profile-link {
  4179 + text-align: left;
  4180 + position: relative;
  4181 + height: 50px;
  4182 + width: 50px;
  4183 + float: left;
  4184 + margin-right: 5px;
  4185 +}
  4186 +
4165 /* ==> public/stylesheets/controller_friends.css <== */ 4187 /* ==> public/stylesheets/controller_friends.css <== */
4166 4188
4167 .controller-friends #remove_friend .friend_picture, 4189 .controller-friends #remove_friend .friend_picture,