Sha256: f8f42221d40e8475a7a140948429b21757d3098c88546559a966bdd391163c1a

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 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 %>

	    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.$(".<%= @resource.id %>-large-image").attr("src", "<%= @image.image.large.url %>");
	    this.parent.$(".<%= @resource.id %>-small-image").attr("src", "<%= @image.image.small.url %>");

    <% end %>
    
  </script>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kuppayam-0.1.5dev4 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.5dev3 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.5dev2 app/views/kuppayam/images/create.html.erb
kuppayam-0.1.5dev app/views/kuppayam/images/create.html.erb