From c14a3e83f78eff62edb7edc78f24c8f1dca1562a Mon Sep 17 00:00:00 2001 From: Daniela Feitosa Date: Sun, 27 Jul 2014 11:35:33 -0300 Subject: [PATCH] profile_suggestions: pages follows same standard --- app/views/friends/_profile_list.html.erb | 31 ------------------------------- app/views/friends/index.html.erb | 4 ++-- app/views/friends/suggest.html.erb | 35 ++++++++++++++++++----------------- app/views/memberships/suggest.html.erb | 23 ++--------------------- app/views/shared/_profile_list.html.erb | 38 ++++++++++++++++++++++++++++++++++++++ public/stylesheets/application.css | 54 ++++++++++++++++++++++++++++++++++++++++-------------- 6 files changed, 100 insertions(+), 85 deletions(-) delete mode 100644 app/views/friends/_profile_list.html.erb create mode 100644 app/views/shared/_profile_list.html.erb diff --git a/app/views/friends/_profile_list.html.erb b/app/views/friends/_profile_list.html.erb deleted file mode 100644 index 1a68d17..0000000 --- a/app/views/friends/_profile_list.html.erb +++ /dev/null @@ -1,31 +0,0 @@ - diff --git a/app/views/friends/index.html.erb b/app/views/friends/index.html.erb index df4a19a..39b6a9f 100644 --- a/app/views/friends/index.html.erb +++ b/app/views/friends/index.html.erb @@ -20,7 +20,7 @@ <% end %> <% end %> - <%= render :partial => 'profile_list', :locals => { :profiles => @friends, :collection => :friends } %> + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @friends, :collection => :friends } %>
<%= pagination_links @friends, :param_name => 'npage' %>
@@ -31,7 +31,7 @@

<%= _("Friends suggestions") %>

- <%= render :partial => 'profile_list', :locals => { :profiles => @suggestions, :collection => :suggestions } %> + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @suggestions, :collection => :friends_suggestions } %> <% button_bar do %> <%= link_to _('See more suggestions...'), :action => 'suggest' %> diff --git a/app/views/friends/suggest.html.erb b/app/views/friends/suggest.html.erb index 30d0436..4368dab 100644 --- a/app/views/friends/suggest.html.erb +++ b/app/views/friends/suggest.html.erb @@ -1,20 +1,21 @@ -

<%= _("Friends suggestions for %s") % profile.name %>

+
+

<%= _("Friends suggestions for %s") % profile.name %>

-<% button_bar do %> - <%= button(:back, _('Go to friends list'), :controller => 'friends') %> -<% end %> + <% button_bar do %> + <%= button(:back, _('Go to friends list'), :controller => 'friends') %> + <% end %> -<% if @suggestions.empty? %> -

- - <%= _('You have no suggestions yet.') %> - <%= link_to _('Do you want to see other people in this environment?'), :controller => 'search', :action => 'assets', :asset => 'people' %> - -

-<% else %> + <% if @suggestions.empty? %> +

+ + <%= _('You have no suggestions yet.') %> + <%= link_to _('Do you want to see other people in this environment?'), :controller => 'search', :action => 'assets', :asset => 'people' %> + +

+ <% else %> + <%= render :partial => 'shared/profile_list', :locals => { :profiles => @suggestions, :collection => :friends_suggestions } %> - <%= render :partial => 'profile_list', :locals => { :profiles => @suggestions, :collection => :suggestions } %> - - <%= pagination_links @suggestions, :param_name => 'npage' %> -<% end %> -
+ <%= pagination_links @suggestions, :param_name => 'npage' %> + <% end %> +
+
diff --git a/app/views/memberships/suggest.html.erb b/app/views/memberships/suggest.html.erb index ace7597..0f6856a 100644 --- a/app/views/memberships/suggest.html.erb +++ b/app/views/memberships/suggest.html.erb @@ -1,4 +1,4 @@ -
+

<%= _("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