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

Version Path
kuppayam-0.2.12.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.11.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.10.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.9.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.8.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.7.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.6.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.5.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.4.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.3.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.2.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.1.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.2.0.pre.materialize app/views/kuppayam/images/create.html.erb
kuppayam-0.1.39 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.38 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.37 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.36 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.35 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.34 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.33 app/views/kuppayam/images/create.html.erb