app/views/spotlight/exhibits/index.html.erb in blacklight-spotlight-0.14.2 vs app/views/spotlight/exhibits/index.html.erb in blacklight-spotlight-0.15.0

- old
+ new

@@ -1,10 +1,10 @@ <div class="col-md-9"> <% if (current_user && current_user.exhibits.any?) || can?(:manage, Spotlight::Exhibit) %> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#published" aria-controls="published" role="tab" data-toggle="tab"><%= t('.published') %></a></li> - <% if can?(:manage, Spotlight::Exhibit) %> + <% if can?(:manage, Spotlight::Exhibit) && @exhibits.unpublished.accessible_by(current_ability).any? %> <li role="presentation"><a href="#unpublished" aria-controls="unpublished" role="tab" data-toggle="tab"><%= t('.unpublished') %></a></li> <% end %> <% if current_user && current_user.exhibits.any? %> <li role="presentation"><a href="#user" aria-controls="user" role="tab" data-toggle="tab"><%= t('.user') %></a></li> <% end %> @@ -16,34 +16,22 @@ <% if @exhibits.published.none? %> <%= render 'missing_exhibits' %> <% end %> <%= cache cache_key_for_spotlight_exhibits do %> - <% @exhibits.published.each_slice(3).each do |row| %> - <div class="row"><!-- start main content row --> - <%= render collection: row, partial: 'exhibit_card', as: 'exhibit' %> - </div> - <% end %> + <%= render 'exhibits', exhibits: @exhibits.published %> <% end %> </div> <% if @exhibits.unpublished.accessible_by(current_ability).any? %> <div role="tabpanel" class="tab-pane" id="unpublished"> - <% @exhibits.unpublished.accessible_by(current_ability).each_slice(3).each do |row| %> - <div class="row"><!-- start main content row --> - <%= render collection: row, partial: 'exhibit_card', as: 'exhibit' %> - </div> - <% end %> + <%= render 'exhibits', exhibits: @exhibits.unpublished.accessible_by(current_ability) %> </div> <% end %> <% if current_user && current_user.exhibits.any? %> <div role="tabpanel" class="tab-pane" id="user"> - <% current_user.exhibits.each_slice(3).each do |row| %> - <div class="row"><!-- start main content row --> - <%= render collection: row, partial: 'exhibit_card', as: 'exhibit' %> - </div> - <% end %> + <%= render 'exhibits', exhibits: current_user.exhibits %> </div> <% end %> </div> </div>