Sha256: be21f32dbe266ce1abeac02f5f1488006feedbc594313ff09c9454e1a5066fd8

Contents?: true

Size: 1.77 KB

Versions: 12

Compression:

Stored size: 1.77 KB

Contents

<% if @r_object.errors.blank? %>
  
  // Inserting the row on top of the table and highlighting it
  $('#div_<%= @resource_options[:item_name] %>_index table > tbody').prepend("<%= 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");

  <% if @resource_options[:show_modal_after_create] %>
    // 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);
  <% else %>
    // Closing the modal if it is opened
    closeGenericModal();
  <% end %>

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

<% else %>

  // Reload the form with errors
	var heading = "Add an <%= @resource_options[:collection_name] %>";
	var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
	showGenericModal(heading, bodyContent, true);

  // 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

12 entries across 12 versions & 1 rubygems

Version Path
kuppayam-0.1.14 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.13 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.12 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.11 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.10 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.8 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.7 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.6dev2 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.5dev4 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.5dev3 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.5dev2 app/views/kuppayam/workflows/parrot/create.js.erb
kuppayam-0.1.5dev app/views/kuppayam/workflows/parrot/create.js.erb