<%= _("Communities suggestions for %s") % profile.name %>
<% button_bar do %>
@@ -13,26 +13,7 @@
<% else %>
-
- <% @suggestions.each do |suggestion| %>
- -
- <%= link_to_profile profile_image(suggestion) + '
' + suggestion.short_name,
- suggestion.identifier, :class => 'profile-link' %>
-
- <%= link_to content_tag('span',_('join')),
- suggestion.join_url,
- :class => 'button icon-add join-community',
- :title => _("Join %s") % suggestion.name %>
- <%= link_to content_tag('span',_('remove')),
- { :action => 'remove_suggestion', :id => suggestion.identifier },
- :class => 'button icon-remove',
- :title => _('Remove suggestion'),
- :method => 'post',
- :confirm => _('Are you sure you want to remove this suggestion?') %>
-
-
- <% end %>
-
+ <%= render :partial => 'shared/profile_list', :locals => { :profiles => @suggestions, :collection => :communities_suggestions } %>
<% end %>
<%= pagination_links @suggestions, :param_name => 'npage' %>
diff --git a/app/views/shared/_profile_list.html.erb b/app/views/shared/_profile_list.html.erb
new file mode 100644
index 0000000..8549600
--- /dev/null
+++ b/app/views/shared/_profile_list.html.erb
@@ -0,0 +1,38 @@
+
+ <% profiles.each do |profile| %>
+ -
+ <%= link_to_profile profile_image(profile) + '
' + profile.short_name,
+ profile.identifier, :class => 'profile-link' %>
+
+ <% if collection == :friends %>
+ <%= button_without_text :remove, content_tag('span',_('remove')),
+ { :action => 'remove', :id => profile.id },
+ :title => _('remove') %>
+ <%= button_without_text 'menu-mail', content_tag('span',_('contact')),
+ profile.url.merge(:controller => 'contact', :action => 'new', :profile => profile.identifier),
+ :title => _('contact') %>
+ <% elsif collection == :friends_suggestions %>
+ <%= button_without_text :add, content_tag('span',_('add')),
+ profile.add_url,
+ :class => 'add-friend',
+ :title => _('Add friend') %>
+ <%= button_without_text :remove, content_tag('span',_('remove')),
+ { :action => 'remove_suggestion', :id => profile.identifier },
+ :title => _('Remove suggestion'),
+ :method => 'post',
+ :confirm => _('Are you sure you want to remove this suggestion?') %>
+ <% elsif collection == :communities_suggestions %>
+ <%= button_without_text :add, content_tag('span',_('join')),
+ profile.join_url,
+ :class => 'join-community',
+ :title => _("Join %s") % profile.name %>
+ <%= button_without_text :remove, content_tag('span',_('remove')),
+ { :action => 'remove_suggestion', :id => profile.identifier },
+ :title => _('Remove suggestion'),
+ :method => 'post',
+ :confirm => _('Are you sure you want to remove this suggestion?') %>
+ <% end %>
+
+
+ <% end %>
+
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 1a84d34..0b6c54a 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -3723,12 +3723,16 @@ h1#agenda-title {
/* ==> @import url(manage_contacts_list.css); <== */
-.controller-favorite_enterprises .profile-list, .controller-friends .profile-list {
+.controller-favorite_enterprises .profile-list,
+.controller-friends .profile-list,
+.profiles-suggestions .profile-list {
margin: 0px;
padding: 0px;
list-style: none;
}
-.controller-favorite_enterprises .profile-list li, .controller-friends .profile-list li {
+.controller-favorite_enterprises .profile-list li,
+.controller-friends .profile-list li,
+.profiles-suggestions .profile-list li {
float: left;
width: 90px;
height: 90px;
@@ -3740,52 +3744,74 @@ h1#agenda-title {
list-style: none;
position: relative;
}
-.controller-favorite_enterprises .profile-list li:hover, .controller-friends .profile-list li:hover {
+.controller-favorite_enterprises .profile-list li:hover,
+.controller-friends .profile-list li:hover,
+.profiles-suggestions .profile-list li:hover {
border: 2px solid #eeeeec;
}
-.controller-favorite_enterprises .profile-list img, .controller-friends .profile-list img {
+.controller-favorite_enterprises .profile-list img,
+.controller-friends .profile-list img,
+.profiles-suggestions .profile-list img {
border: none;
}
-.controller-favorite_enterprises .profile-list a.profile-link, .controller-friends .profile-list a.profile-link {
+.controller-favorite_enterprises .profile-list a.profile-link,
+.controller-friends .profile-list a.profile-link,
+.profiles-suggestions .profile-list a.profile-link {
text-decoration: none;
text-align: center;
display: block;
font-size: 11px;
}
-.controller-favorite_enterprises .profile-list a.profile-link:hover, .controller-friends .profile-list a.profile-link:hover {
+.controller-favorite_enterprises .profile-list a.profile-link:hover,
+.controller-friends .profile-list a.profile-link:hover,
+.profiles-suggestions .profile-list a.profile-link:hover {
color: #FFF;
}
-.controller-favorite_enterprises .profile-list .profile_link span, .controller-friends .profile-list .profile_link span {
+.controller-favorite_enterprises .profile-list .profile_link span,
+.controller-friends .profile-list .profile_link span,
+.profiles-suggestions .profile-list .profile_link span {
width: 80px;
display: block;
overflow: hidden;
}
-.controller-favorite_enterprises .profile-list, .controller-friends .profile-list {
+.controller-favorite_enterprises .profile-list,
+.controller-friends .profile-list,
+.profiles-suggestions .profile-list {
position: relative;
}
-.controller-favorite_enterprises .profile-list .controll, .controller-friends .profile-list .controll {
+.controller-favorite_enterprises .profile-list .controll,
+.controller-friends .profile-list .controll,
+.profiles-suggestions .profile-list .controll {
position: absolute;
top: 7px;
right: -10px;
}
-.controller-favorite_enterprises .profile-list .controll a, .controller-friends .profile-list .controll a {
+.controller-favorite_enterprises .profile-list .controll a,
+.controller-friends .profile-list .controll a,
+.profiles-suggestions .profile-list .controll a {
display: block;
margin-bottom: 2px;
}
-.controller-favorite_enterprises .msie6 .profile-list .controll a, .controller-friends .msie6 .profile-list .controll a {
+.controller-favorite_enterprises .msie6 .profile-list .controll a,
+.controller-friends .msie6 .profile-list .controll a,
+.profiles-suggestions .msie6 .profile-list .controll a {
width: 0px;
}
-.controller-favorite_enterprises .button-bar, .controller-friends .button-bar {
+.controller-favorite_enterprises .button-bar,
+.controller-friends .button-bar,
+.profiles-suggestions .button-bar {
clear: both;
padding-top: 20px;
}
/* ==> public/stylesheets/controller_friends.css <== */
-.controller-friends #remove_friend .friend_picture {
+.controller-friends #remove_friend .friend_picture,
+#remove_suggestion .suggestion_picture {
float: left;
margin-right: 15px;
}
-.controller-friends #remove_friend form {
+.controller-friends #remove_friend form,
+#remove_suggestion form {
clear: both;
padding-top: 20px;
}
--
libgit2 0.21.2