<% if !is_modal %> <%= content_tag( :div, class: 'file-collection-container', data: { max: properties['max-files'].nil? ? 0 : properties['max-files'] } ) do %> <%= f.fields_for(attribute) do |builder| %> <%= render 'adminpanel/shared/image_fields', f: builder %> <% end -%> <% if ( properties['max-files'].to_i != 0 && properties['max-files'].to_i <= f.object.send(@model.gallery_relationship).count.to_i ) %> <% hidden = 'hidden' %> <% else %> <% hidden = 'not-hidden' %> <% end %> <%= link_to_add_fields I18n.t('Add Image'), f, attribute, hidden %> <% end %> <% end %>