From 9cc61a303c51577485fa197884c1fdcdfe953e6a Mon Sep 17 00:00:00 2001 From: Brice Sanchez Date: Fri, 10 Jul 2015 09:36:26 -0400 Subject: [PATCH] Use _records partial for items --- .../portfolio/admin/items/_records.html.erb | 20 ++++++++++++++++++ .../portfolio/admin/items/index.html.erb | 21 +------------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/app/views/refinery/portfolio/admin/items/_records.html.erb b/app/views/refinery/portfolio/admin/items/_records.html.erb index e69de29..4e83758 100644 --- a/app/views/refinery/portfolio/admin/items/_records.html.erb +++ b/app/views/refinery/portfolio/admin/items/_records.html.erb @@ -0,0 +1,20 @@ +<% if searching? %> +

<%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %>

+ <% if @items.any? %> + <%= render :partial => 'items', :collection => @items %> + <% else %> +

<%= t('.no_results', :scope => 'refinery.admin.search') %>

+ <% end %> +<% else %> + <% if @items.any? %> + <%= will_paginate @items %> + <%= render :partial => "sortable_list" %> + <%= will_paginate @items %> + <% else %> +

+ + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.portfolio.admin.items')) %> + +

+ <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/refinery/portfolio/admin/items/index.html.erb b/app/views/refinery/portfolio/admin/items/index.html.erb index 3a9614c..59393cf 100644 --- a/app/views/refinery/portfolio/admin/items/index.html.erb +++ b/app/views/refinery/portfolio/admin/items/index.html.erb @@ -1,24 +1,5 @@
- <% if searching? %> -

<%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %>

- <% if @items.any? %> - <%= render :partial => 'items', :collection => @items %> - <% else %> -

<%= t('.no_results', :scope => 'refinery.admin.search') %>

- <% end %> - <% else %> - <% if @items.any? %> - <%= will_paginate @items %> - <%= render :partial => "sortable_list" %> - <%= will_paginate @items %> - <% else %> -

- - <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.portfolio.admin.items')) %> - -

- <% end %> - <% end %> + <%= render 'records' %>