From c6674dd32c1abde0ee3d70fa43498e9156a7ab89 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Thu, 10 Mar 2016 10:02:01 -0300 Subject: [PATCH] Refactor FavoriteEnterprisesBlock footer --- app/models/favorite_enterprises_block.rb | 8 -------- app/views/blocks/footers/favorite_enterprises.html.erb | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) create mode 100644 app/views/blocks/footers/favorite_enterprises.html.erb diff --git a/app/models/favorite_enterprises_block.rb b/app/models/favorite_enterprises_block.rb index c58c1cb..f0605ba 100644 --- a/app/models/favorite_enterprises_block.rb +++ b/app/models/favorite_enterprises_block.rb @@ -12,14 +12,6 @@ class FavoriteEnterprisesBlock < ProfileListBlock _('Favorite Enterprises') end - def footer - owner = self.owner - return '' unless owner.kind_of?(Person) - proc do - link_to _('enterprises|View all'), {:profile => owner.identifier, :controller => 'profile', :action => 'favorite_enterprises'}, :class => 'view-all' - end - end - def profiles owner.favorite_enterprises end diff --git a/app/views/blocks/footers/favorite_enterprises.html.erb b/app/views/blocks/footers/favorite_enterprises.html.erb new file mode 100644 index 0000000..11eee0e --- /dev/null +++ b/app/views/blocks/footers/favorite_enterprises.html.erb @@ -0,0 +1,3 @@ +<% if block.owner.is_a?(Person) %> + <%= link_to _('enterprises|View all'), {:profile => block.owner.identifier, :controller => 'profile', :action => 'favorite_enterprises'}, :class => 'view-all' %> +<% end %> -- libgit2 0.21.2