Sha256: 0ad6572408c8a00bda6266a64cac9ae050e113f8dd5ec52c32ba1e37372f7232

Contents?: true

Size: 1.13 KB

Versions: 6

Compression:

Stored size: 1.13 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.showGenericModal(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.closeGenericModal();

	    // var heading = "Crop Image";
	    // var bodyContent = "<%#= escape_javascript(render(:partial=>'crop_form')) %>";
	    // this.parent.showGenericModal(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

6 entries across 6 versions & 1 rubygems

Version Path
kuppayam-0.1.5 app/views/kuppayam/images/update.html.erb
kuppayam-0.1.4dev app/views/kuppayam/images/update.html.erb
kuppayam-0.1.4 app/views/kuppayam/images/update.html.erb
kuppayam-0.1.3 app/views/kuppayam/images/update.html.erb
kuppayam-0.1.2 app/views/kuppayam/images/update.html.erb
kuppayam-0.1.1 app/views/kuppayam/images/update.html.erb