app/views/storytime/dashboard/media/_gallery.html.erb in storytime-2.0.0 vs app/views/storytime/dashboard/media/_gallery.html.erb in storytime-2.1.0
- old
+ new
@@ -1,15 +1,16 @@
<div id="media_gallery">
+ <% if !@media.nil? && @media.any? %>
+ <% @media.in_groups_of(5, false) do |media_row| %>
+ <div class="row">
+ <% media_row.each do |media| %>
+ <%= render partial: "storytime/dashboard/media/media.html.erb", locals: { media: media } %>
+ <% end %>
+ </div>
+ <% end %>
- <% @media.in_groups_of(5, false) do |media_row| %>
- <div class="row">
- <% media_row.each do |media| %>
- <%= render partial: "storytime/dashboard/media/media.html.erb", locals: { media: media } %>
- <% end %>
- </div>
+ <%= paginate @media, remote: true, params: { controller: "dashboard/media",
+ action: "index",
+ id: nil,
+ large_gallery: @large_gallery.nil? ? true : @large_gallery } %>
<% end %>
-
- <%= paginate @media, remote: true, params: { controller: "dashboard/media",
- action: "index",
- id: nil,
- large_gallery: @large_gallery.nil? ? true : @large_gallery } %>
</div>