Sha256: 05c115f7ac91736c14044feace680947a54c65e21c1663a54b60d63dabd03150

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 %>
				heading = "Edit - <%= @image_type.class.name.titleize %>";
			<% else %>
				heading = "Edit - Image";
			<% end %>

			bodyContent = "<%= escape_javascript(render(:partial=>'form')) %>";

			this.parent.showImageUploadModal(heading, bodyContent);

			<%
		    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.showGenericModal(heading, bodyContent, true);
	    // 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/update.html.erb
kuppayam-0.1.5dev3 app/views/kuppayam/images/update.html.erb
kuppayam-0.1.5dev2 app/views/kuppayam/images/update.html.erb
kuppayam-0.1.5dev app/views/kuppayam/images/update.html.erb