Sha256: 99c5d3091c8c01f1b695182a44625a4483d0a49e5a63a7ec4ddf286ac3153079
Contents?: true
Size: 1.93 KB
Versions: 5
Compression:
Stored size: 1.93 KB
Contents
<% if @r_object.errors.blank? %> <% locals = {@resource_options[:item_name].to_sym => @r_object, i: -1} if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty? locals.merge!(@row_partial_locals) end %> // 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: locals)) %>"); $("#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")) %>"; showLargeModal(heading, bodyContent, false); <% else %> // Closing the modal if it is opened closeLargeModal(); <% end %> // Showing Growl Like Message notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>"); <% else %> // Reload the form with errors var heading = "Add <%= @resource_options[:item_name] %>"; var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>"; showLargeModal(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
5 entries across 5 versions & 1 rubygems