Skip to content

Commit

Permalink
Use _records partial for items
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice Sanchez authored and bricesanchez committed Jul 23, 2015
1 parent ca94f4f commit 9cc61a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
20 changes: 20 additions & 0 deletions app/views/refinery/portfolio/admin/items/_records.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
<% if @items.any? %>
<%= render :partial => 'items', :collection => @items %>
<% else %>
<p><%= t('.no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
<% if @items.any? %>
<%= will_paginate @items %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @items %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.portfolio.admin.items')) %>
</strong>
</p>
<% end %>
<% end %>
21 changes: 1 addition & 20 deletions app/views/refinery/portfolio/admin/items/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
<section id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
<% if @items.any? %>
<%= render :partial => 'items', :collection => @items %>
<% else %>
<p><%= t('.no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
<% if @items.any? %>
<%= will_paginate @items %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @items %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.portfolio.admin.items')) %>
</strong>
</p>
<% end %>
<% end %>
<%= render 'records' %>
</section>

<section id='actions'>
Expand Down

0 comments on commit 9cc61a3

Please sign in to comment.