Commit c14a3e83f78eff62edb7edc78f24c8f1dca1562a

Authored by Daniela Feitosa
1 parent 159f9701

profile_suggestions: pages follows same standard

(ActionItem3234)
app/views/friends/_profile_list.html.erb
... ... @@ -1,31 +0,0 @@
1   -<ul class="profile-list">
2   - <% profiles.each do |profile| %>
3   - <li>
4   - <%= link_to_profile profile_image(profile) + '<br/>' + profile.short_name,
5   - profile.identifier, :class => 'profile-link' %>
6   - <div class="controll">
7   - <% if collection == :friends %>
8   - <%= link_to content_tag('span',_('remove')),
9   - { :action => 'remove', :id => profile.id },
10   - :class => 'button icon-remove',
11   - :title => _('remove') %>
12   - <%= link_to content_tag('span',_('contact')),
13   - profile.url.merge(:controller => 'contact', :action => 'new', :profile => profile.identifier),
14   - :class => 'button icon-menu-mail',
15   - :title => _('contact') %>
16   - <% elsif collection == :suggestions %>
17   - <%= link_to content_tag('span',_('add')),
18   - profile.add_url,
19   - :class => 'button icon-add add-friend',
20   - :title => _('Add friend') %>
21   - <%= link_to content_tag('span',_('remove')),
22   - { :action => 'remove_suggestion', :id => profile.identifier },
23   - :class => 'button icon-remove',
24   - :title => _('Remove suggestion'),
25   - :method => 'post',
26   - :confirm => _('Are you sure you want to remove this suggestion?') %>
27   - <% end %>
28   - </div><!-- end class="controll" -->
29   - </li>
30   - <% end %>
31   -</ul>
app/views/friends/index.html.erb
... ... @@ -20,7 +20,7 @@
20 20 <% end %>
21 21 <% end %>
22 22  
23   - <%= render :partial => 'profile_list', :locals => { :profiles => @friends, :collection => :friends } %>
  23 + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @friends, :collection => :friends } %>
24 24 <div id='pagination-friends'>
25 25 <%= pagination_links @friends, :param_name => 'npage' %>
26 26 </div>
... ... @@ -31,7 +31,7 @@
31 31 <br style="clear:both" />
32 32 <h2><%= _("Friends suggestions") %></h2>
33 33  
34   - <%= render :partial => 'profile_list', :locals => { :profiles => @suggestions, :collection => :suggestions } %>
  34 + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @suggestions, :collection => :friends_suggestions } %>
35 35  
36 36 <% button_bar do %>
37 37 <%= link_to _('See more suggestions...'), :action => 'suggest' %>
... ...
app/views/friends/suggest.html.erb
1   -<h1><%= _("Friends suggestions for %s") % profile.name %></h1>
  1 +<div class='profiles-suggestions'>
  2 + <h1><%= _("Friends suggestions for %s") % profile.name %></h1>
2 3  
3   -<% button_bar do %>
4   - <%= button(:back, _('Go to friends list'), :controller => 'friends') %>
5   -<% end %>
  4 + <% button_bar do %>
  5 + <%= button(:back, _('Go to friends list'), :controller => 'friends') %>
  6 + <% end %>
6 7  
7   -<% if @suggestions.empty? %>
8   - <p>
9   - <em>
10   - <%= _('You have no suggestions yet.') %>
11   - <%= link_to _('Do you want to see other people in this environment?'), :controller => 'search', :action => 'assets', :asset => 'people' %>
12   - </em>
13   - </p>
14   -<% else %>
  8 + <% if @suggestions.empty? %>
  9 + <p>
  10 + <em>
  11 + <%= _('You have no suggestions yet.') %>
  12 + <%= link_to _('Do you want to see other people in this environment?'), :controller => 'search', :action => 'assets', :asset => 'people' %>
  13 + </em>
  14 + </p>
  15 + <% else %>
  16 + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @suggestions, :collection => :friends_suggestions } %>
15 17  
16   - <%= render :partial => 'profile_list', :locals => { :profiles => @suggestions, :collection => :suggestions } %>
17   -
18   - <%= pagination_links @suggestions, :param_name => 'npage' %>
19   -<% end %>
20   -<br style="clear:both" />
  18 + <%= pagination_links @suggestions, :param_name => 'npage' %>
  19 + <% end %>
  20 + <br style="clear:both" />
  21 +</div>
... ...
app/views/memberships/suggest.html.erb
1   -<div class='communities-suggestions'>
  1 +<div class='profiles-suggestions'>
2 2 <h1><%= _("Communities suggestions for %s") % profile.name %></h1>
3 3  
4 4 <% button_bar do %>
... ... @@ -13,26 +13,7 @@
13 13 </em>
14 14 </p>
15 15 <% else %>
16   - <ul class="profile-list">
17   - <% @suggestions.each do |suggestion| %>
18   - <li>
19   - <%= link_to_profile profile_image(suggestion) + '<br/>' + suggestion.short_name,
20   - suggestion.identifier, :class => 'profile-link' %>
21   - <div class="controll">
22   - <%= link_to content_tag('span',_('join')),
23   - suggestion.join_url,
24   - :class => 'button icon-add join-community',
25   - :title => _("Join %s") % suggestion.name %>
26   - <%= link_to content_tag('span',_('remove')),
27   - { :action => 'remove_suggestion', :id => suggestion.identifier },
28   - :class => 'button icon-remove',
29   - :title => _('Remove suggestion'),
30   - :method => 'post',
31   - :confirm => _('Are you sure you want to remove this suggestion?') %>
32   - </div><!-- end class="controll" -->
33   - </li>
34   - <% end %>
35   - </ul>
  16 + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @suggestions, :collection => :communities_suggestions } %>
36 17 <% end %>
37 18  
38 19 <%= pagination_links @suggestions, :param_name => 'npage' %>
... ...
app/views/shared/_profile_list.html.erb 0 → 100644
... ... @@ -0,0 +1,38 @@
  1 +<ul class="profile-list">
  2 + <% profiles.each do |profile| %>
  3 + <li>
  4 + <%= link_to_profile profile_image(profile) + '<br/>' + profile.short_name,
  5 + profile.identifier, :class => 'profile-link' %>
  6 + <div class="controll">
  7 + <% if collection == :friends %>
  8 + <%= button_without_text :remove, content_tag('span',_('remove')),
  9 + { :action => 'remove', :id => profile.id },
  10 + :title => _('remove') %>
  11 + <%= button_without_text 'menu-mail', content_tag('span',_('contact')),
  12 + profile.url.merge(:controller => 'contact', :action => 'new', :profile => profile.identifier),
  13 + :title => _('contact') %>
  14 + <% elsif collection == :friends_suggestions %>
  15 + <%= button_without_text :add, content_tag('span',_('add')),
  16 + profile.add_url,
  17 + :class => 'add-friend',
  18 + :title => _('Add friend') %>
  19 + <%= button_without_text :remove, content_tag('span',_('remove')),
  20 + { :action => 'remove_suggestion', :id => profile.identifier },
  21 + :title => _('Remove suggestion'),
  22 + :method => 'post',
  23 + :confirm => _('Are you sure you want to remove this suggestion?') %>
  24 + <% elsif collection == :communities_suggestions %>
  25 + <%= button_without_text :add, content_tag('span',_('join')),
  26 + profile.join_url,
  27 + :class => 'join-community',
  28 + :title => _("Join %s") % profile.name %>
  29 + <%= button_without_text :remove, content_tag('span',_('remove')),
  30 + { :action => 'remove_suggestion', :id => profile.identifier },
  31 + :title => _('Remove suggestion'),
  32 + :method => 'post',
  33 + :confirm => _('Are you sure you want to remove this suggestion?') %>
  34 + <% end %>
  35 + </div><!-- end class="controll" -->
  36 + </li>
  37 + <% end %>
  38 +</ul>
... ...
public/stylesheets/application.css
... ... @@ -3723,12 +3723,16 @@ h1#agenda-title {
3723 3723  
3724 3724 /* ==> @import url(manage_contacts_list.css); <== */
3725 3725  
3726   -.controller-favorite_enterprises .profile-list, .controller-friends .profile-list {
  3726 +.controller-favorite_enterprises .profile-list,
  3727 +.controller-friends .profile-list,
  3728 +.profiles-suggestions .profile-list {
3727 3729 margin: 0px;
3728 3730 padding: 0px;
3729 3731 list-style: none;
3730 3732 }
3731   -.controller-favorite_enterprises .profile-list li, .controller-friends .profile-list li {
  3733 +.controller-favorite_enterprises .profile-list li,
  3734 +.controller-friends .profile-list li,
  3735 +.profiles-suggestions .profile-list li {
3732 3736 float: left;
3733 3737 width: 90px;
3734 3738 height: 90px;
... ... @@ -3740,52 +3744,74 @@ h1#agenda-title {
3740 3744 list-style: none;
3741 3745 position: relative;
3742 3746 }
3743   -.controller-favorite_enterprises .profile-list li:hover, .controller-friends .profile-list li:hover {
  3747 +.controller-favorite_enterprises .profile-list li:hover,
  3748 +.controller-friends .profile-list li:hover,
  3749 +.profiles-suggestions .profile-list li:hover {
3744 3750 border: 2px solid #eeeeec;
3745 3751 }
3746   -.controller-favorite_enterprises .profile-list img, .controller-friends .profile-list img {
  3752 +.controller-favorite_enterprises .profile-list img,
  3753 +.controller-friends .profile-list img,
  3754 +.profiles-suggestions .profile-list img {
3747 3755 border: none;
3748 3756 }
3749   -.controller-favorite_enterprises .profile-list a.profile-link, .controller-friends .profile-list a.profile-link {
  3757 +.controller-favorite_enterprises .profile-list a.profile-link,
  3758 +.controller-friends .profile-list a.profile-link,
  3759 +.profiles-suggestions .profile-list a.profile-link {
3750 3760 text-decoration: none;
3751 3761 text-align: center;
3752 3762 display: block;
3753 3763 font-size: 11px;
3754 3764 }
3755   -.controller-favorite_enterprises .profile-list a.profile-link:hover, .controller-friends .profile-list a.profile-link:hover {
  3765 +.controller-favorite_enterprises .profile-list a.profile-link:hover,
  3766 +.controller-friends .profile-list a.profile-link:hover,
  3767 +.profiles-suggestions .profile-list a.profile-link:hover {
3756 3768 color: #FFF;
3757 3769 }
3758   -.controller-favorite_enterprises .profile-list .profile_link span, .controller-friends .profile-list .profile_link span {
  3770 +.controller-favorite_enterprises .profile-list .profile_link span,
  3771 +.controller-friends .profile-list .profile_link span,
  3772 +.profiles-suggestions .profile-list .profile_link span {
3759 3773 width: 80px;
3760 3774 display: block;
3761 3775 overflow: hidden;
3762 3776 }
3763   -.controller-favorite_enterprises .profile-list, .controller-friends .profile-list {
  3777 +.controller-favorite_enterprises .profile-list,
  3778 +.controller-friends .profile-list,
  3779 +.profiles-suggestions .profile-list {
3764 3780 position: relative;
3765 3781 }
3766   -.controller-favorite_enterprises .profile-list .controll, .controller-friends .profile-list .controll {
  3782 +.controller-favorite_enterprises .profile-list .controll,
  3783 +.controller-friends .profile-list .controll,
  3784 +.profiles-suggestions .profile-list .controll {
3767 3785 position: absolute;
3768 3786 top: 7px;
3769 3787 right: -10px;
3770 3788 }
3771   -.controller-favorite_enterprises .profile-list .controll a, .controller-friends .profile-list .controll a {
  3789 +.controller-favorite_enterprises .profile-list .controll a,
  3790 +.controller-friends .profile-list .controll a,
  3791 +.profiles-suggestions .profile-list .controll a {
3772 3792 display: block;
3773 3793 margin-bottom: 2px;
3774 3794 }
3775   -.controller-favorite_enterprises .msie6 .profile-list .controll a, .controller-friends .msie6 .profile-list .controll a {
  3795 +.controller-favorite_enterprises .msie6 .profile-list .controll a,
  3796 +.controller-friends .msie6 .profile-list .controll a,
  3797 +.profiles-suggestions .msie6 .profile-list .controll a {
3776 3798 width: 0px;
3777 3799 }
3778   -.controller-favorite_enterprises .button-bar, .controller-friends .button-bar {
  3800 +.controller-favorite_enterprises .button-bar,
  3801 +.controller-friends .button-bar,
  3802 +.profiles-suggestions .button-bar {
3779 3803 clear: both;
3780 3804 padding-top: 20px;
3781 3805 }
3782 3806 /* ==> public/stylesheets/controller_friends.css <== */
3783 3807  
3784   -.controller-friends #remove_friend .friend_picture {
  3808 +.controller-friends #remove_friend .friend_picture,
  3809 +#remove_suggestion .suggestion_picture {
3785 3810 float: left;
3786 3811 margin-right: 15px;
3787 3812 }
3788   -.controller-friends #remove_friend form {
  3813 +.controller-friends #remove_friend form,
  3814 +#remove_suggestion form {
3789 3815 clear: both;
3790 3816 padding-top: 20px;
3791 3817 }
... ...