Sha256: 731590cf7289e631a210e93e13ff7ae49ab74bc7843e5aa091973dce45921f2b

Contents?: true

Size: 1.57 KB

Versions: 6

Compression:

Stored size: 1.57 KB

Contents

<% if @r_object.errors.blank? %>
  
  // Updating the edited row and highlighting it
  $('#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>').replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: { @resource_options[:item_name].to_sym => @r_object, i: -1})) %>");
  $("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").css("background-color", "#fffddd");
  
  // Showing the saved data in the modal
  var heading = "<%= raw @r_object.try(:display_name) %>";
  var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
  showGenericModal(heading, bodyContent, false);

  // Showing Growl Like Message
  notifySuccess("<%= @notification[:title] %>", "<%= @notification[:message] %>");

<% else %>

	// Reload the form with errors
	var heading = "Edit '<%= raw @r_object.try(:display_name) %>'";
	var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
	showGenericModal(heading, bodyContent);

	// Show Main Error Message on the form
  <% error_message = content_tag(:div, I18n.t('errors.errors_highlighted'), class: "alert alert-danger mt-20") %>
  $("#<%= @resource_options[:item_name] %>_form_error").html("<%= escape_javascript(error_message) %>");
  
  // Initialize WYSIHTML Editor
  $(".wysihtml5").wysihtml5(
    {"stylesheets": '/assets/wysiwyg-color.css'}
  );

  // Showing Growl Like Message
  notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
  
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuppayam-0.1.5 app/views/kuppayam/workflows/parrot/update.js.erb
kuppayam-0.1.4dev app/views/kuppayam/workflows/parrot/update.js.erb
kuppayam-0.1.4 app/views/kuppayam/workflows/parrot/update.js.erb
kuppayam-0.1.3 app/views/kuppayam/workflows/parrot/update.js.erb
kuppayam-0.1.2 app/views/kuppayam/workflows/parrot/update.js.erb
kuppayam-0.1.1 app/views/kuppayam/workflows/parrot/update.js.erb