Sha256: 94f449465677c0e48d7d174d37c4644ae7556d329b20ab5de6acf3d2f9ea9373
Contents?: true
Size: 1.66 KB
Versions: 37
Compression:
Stored size: 1.66 KB
Contents
<%= content_for :javascript_footer do %> <script type="text/javascript"> <% if @image.errors.any? %> <% if @image_type %> var heading = "Add <%= @image_type.class.name.titleize %>"; <% else %> var heading = "Add Image"; <% end %> var bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>"; this.parent.showImageUploadModal(heading, bodyContent, true); <% text = "You have few errors. They have been highlighted." error_message = content_tag(:div, text, class: "alert alert-danger") %> this.parent.$("#image_form_error").html("<%= escape_javascript(error_message) %>"); <% else %> <% if params[:multiple] && ["true", "t", "yes", "1"].include?(params[:multiple]) %> this.parent.closeImageUploadModal(); <% images = @image.class.where("imageable_id = ? AND imageable_type = ?", @image.imageable_id, @image.imageable_type).all %> this.parent.$("#div_multiple_images_index").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/multiple_images", locals: {images: images, object: @image.imageable})) %>") <% else %> this.parent.closeImageUploadModal(); //var heading = "Crop Image"; //var bodyContent = "<%#= escape_javascript(render(:partial=>"crop_form")) %>"; //this.parent.showModal(heading, bodyContent); //this.parent.cropImage("form_crop_photo"); this.parent.$(".<%= @image.imageable_id %>-large-image").attr("src", "<%= @image.image.large.url %>"); this.parent.$(".<%= @image.imageable_id %>-small-image").attr("src", "<%= @image.image.small.url %>"); <% end %> <% end %> </script> <% end %>
Version data entries
37 entries across 37 versions & 1 rubygems