kuppayam 0.1.34 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/favicon.png +0 -0
- data/app/assets/javascripts/{jquery_with_ujs.js → jquery_and_family.js} +3 -2
- data/app/assets/javascripts/kuppayam.js +13 -0
- data/app/assets/javascripts/kuppayam/utilities.js +3 -3
- data/app/assets/stylesheets/jquery_and_family.css +14 -0
- data/app/assets/stylesheets/kuppayam/custom.css +73 -0
- data/app/helpers/kuppayam_helper.rb +6 -2
- data/app/helpers/render_helper.rb +6 -2
- data/app/helpers/resource_helper.rb +44 -5
- data/app/helpers/resource_view_helper.rb +123 -35
- data/app/models/concerns/publishable.rb +1 -0
- data/app/models/image/base.rb +3 -3
- data/app/views/kuppayam/images/_multiple_images.html.erb +6 -4
- data/app/views/kuppayam/workflows/default/create.js.erb +81 -0
- data/app/views/kuppayam/workflows/default/destroy.js.erb +32 -0
- data/app/views/kuppayam/workflows/default/edit.js.erb +21 -0
- data/app/views/kuppayam/workflows/default/index.js.erb +43 -0
- data/app/views/kuppayam/workflows/default/new.js.erb +21 -0
- data/app/views/kuppayam/workflows/default/row.js.erb +50 -0
- data/app/views/kuppayam/workflows/default/show.js.erb +17 -0
- data/app/views/kuppayam/workflows/default/update.js.erb +73 -0
- data/app/views/kuppayam/workflows/parrot/create.js.erb +8 -1
- data/app/views/kuppayam/workflows/parrot/index.js.erb +9 -1
- data/app/views/kuppayam/workflows/parrot/new.js.erb +1 -1
- data/app/views/kuppayam/workflows/parrot/row.js.erb +8 -1
- data/app/views/kuppayam/workflows/parrot/update.js.erb +8 -1
- data/app/views/kuppayam/workflows/peacock/create.js.erb +8 -1
- data/app/views/kuppayam/workflows/peacock/index.js.erb +9 -1
- data/app/views/kuppayam/workflows/peacock/row.js.erb +8 -1
- data/app/views/kuppayam/workflows/peacock/update.js.erb +8 -1
- data/app/views/layouts/dashboard/_items.html.erb +1 -1
- data/app/views/layouts/kuppayam/_head.html.erb +2 -2
- data/app/views/layouts/kuppayam/_sidebar.html.erb +1 -1
- data/app/views/layouts/kuppayam/admin.html.erb +1 -1
- data/app/views/layouts/kuppayam/document_upload.html.erb +1 -1
- data/app/views/layouts/kuppayam/image_upload.html.erb +1 -1
- data/lib/generators/kuppayam/templates/views/_index.html.erb +1 -1
- data/lib/generators/kuppayam/templates/views/_row.html.erb +1 -1
- data/lib/kuppayam/engine.rb +1 -1
- data/lib/kuppayam/version.rb +1 -1
- data/vendor/assets/jquery-ui/AUTHORS.txt +333 -0
- data/vendor/assets/jquery-ui/LICENSE.txt +43 -0
- data/vendor/assets/jquery-ui/external/jquery/jquery.js +11008 -0
- data/vendor/assets/jquery-ui/images/ui-icons_444444_256x240.png +0 -0
- data/vendor/assets/jquery-ui/images/ui-icons_555555_256x240.png +0 -0
- data/vendor/assets/jquery-ui/images/ui-icons_777620_256x240.png +0 -0
- data/vendor/assets/jquery-ui/images/ui-icons_777777_256x240.png +0 -0
- data/vendor/assets/jquery-ui/images/ui-icons_cc0000_256x240.png +0 -0
- data/vendor/assets/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/jquery-ui/index.html +559 -0
- data/vendor/assets/jquery-ui/jquery-ui.css +1312 -0
- data/vendor/assets/jquery-ui/jquery-ui.js +18706 -0
- data/vendor/assets/jquery-ui/jquery-ui.min.css +7 -0
- data/vendor/assets/jquery-ui/jquery-ui.min.js +13 -0
- data/vendor/assets/jquery-ui/jquery-ui.structure.css +886 -0
- data/vendor/assets/jquery-ui/jquery-ui.structure.min.css +5 -0
- data/vendor/assets/jquery-ui/jquery-ui.theme.css +443 -0
- data/vendor/assets/jquery-ui/jquery-ui.theme.min.css +5 -0
- data/vendor/assets/jquery-ui/package.json +74 -0
- data/vendor/assets/jquery-validation/additional-methods.js +1158 -0
- data/vendor/assets/jquery-validation/additional-methods.min.js +8 -0
- data/vendor/assets/{javascripts/jquery-validate → jquery-validation}/jquery.validate.js +615 -371
- data/vendor/assets/jquery-validation/jquery.validate.min.js +4 -0
- data/vendor/assets/jquery/jquery-3.2.1.min.js +4 -0
- data/vendor/assets/stylesheets/xenon-core.css +16 -16
- metadata +45 -122
- data/vendor/assets/javascripts/jquery-validate/additional-methods.js +0 -928
- data/vendor/assets/javascripts/jquery-validate/additional-methods.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/index.html +0 -0
- data/vendor/assets/javascripts/jquery-validate/jquery.validate.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ar.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ar.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_bg.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_bg.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ca.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ca.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_cs.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_cs.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_da.js +0 -30
- data/vendor/assets/javascripts/jquery-validate/localization/messages_da.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_de.js +0 -30
- data/vendor/assets/javascripts/jquery-validate/localization/messages_de.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_el.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_el.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_es.js +0 -36
- data/vendor/assets/javascripts/jquery-validate/localization/messages_es.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_es_AR.js +0 -37
- data/vendor/assets/javascripts/jquery-validate/localization/messages_es_AR.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_et.js +0 -31
- data/vendor/assets/javascripts/jquery-validate/localization/messages_et.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_eu.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_eu.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_fa.js +0 -36
- data/vendor/assets/javascripts/jquery-validate/localization/messages_fa.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_fi.js +0 -31
- data/vendor/assets/javascripts/jquery-validate/localization/messages_fi.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_fr.js +0 -59
- data/vendor/assets/javascripts/jquery-validate/localization/messages_fr.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_gl.js +0 -38
- data/vendor/assets/javascripts/jquery-validate/localization/messages_gl.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_he.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_he.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_hr.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_hr.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_hu.js +0 -32
- data/vendor/assets/javascripts/jquery-validate/localization/messages_hu.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_id.js +0 -32
- data/vendor/assets/javascripts/jquery-validate/localization/messages_id.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_is.js +0 -31
- data/vendor/assets/javascripts/jquery-validate/localization/messages_is.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_it.js +0 -36
- data/vendor/assets/javascripts/jquery-validate/localization/messages_it.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ja.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ja.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ka.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ka.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_kk.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_kk.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ko.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ko.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_lt.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_lt.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_lv.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_lv.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_my.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_my.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_nl.js +0 -43
- data/vendor/assets/javascripts/jquery-validate/localization/messages_nl.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_no.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_no.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_pl.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_pl.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_BR.js +0 -37
- data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_BR.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_PT.js +0 -37
- data/vendor/assets/javascripts/jquery-validate/localization/messages_pt_PT.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ro.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ro.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ru.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_ru.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_si.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_si.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sk.js +0 -30
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sk.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sl.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sl.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sr.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sr.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sr_lat.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sr_lat.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sv.js +0 -31
- data/vendor/assets/javascripts/jquery-validate/localization/messages_sv.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_th.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_th.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_tj.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_tj.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_tr.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_tr.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_uk.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_uk.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_vi.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_vi.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_zh.js +0 -33
- data/vendor/assets/javascripts/jquery-validate/localization/messages_zh.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/messages_zh_TW.js +0 -34
- data/vendor/assets/javascripts/jquery-validate/localization/messages_zh_TW.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/methods_de.js +0 -22
- data/vendor/assets/javascripts/jquery-validate/localization/methods_de.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/methods_es_CL.js +0 -22
- data/vendor/assets/javascripts/jquery-validate/localization/methods_es_CL.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/methods_fi.js +0 -22
- data/vendor/assets/javascripts/jquery-validate/localization/methods_fi.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/methods_nl.js +0 -19
- data/vendor/assets/javascripts/jquery-validate/localization/methods_nl.min.js +0 -4
- data/vendor/assets/javascripts/jquery-validate/localization/methods_pt.js +0 -19
- data/vendor/assets/javascripts/jquery-validate/localization/methods_pt.min.js +0 -4
@@ -11,6 +11,7 @@ module Publishable
|
|
11
11
|
STATUS = {"Published" => PUBLISHED, "Unpublished" => UNPUBLISHED, "Archived" => ARCHIVED, "Removed" => REMOVED}
|
12
12
|
STATUS_REVERSE = {PUBLISHED => "Published", UNPUBLISHED => "Unpublished", ARCHIVED => "Archived", REMOVED => "Removed"}
|
13
13
|
STATUS_UI_CLASS = {PUBLISHED => "success", UNPUBLISHED => "default", ARCHIVED => "default", REMOVED => "danger"}
|
14
|
+
STATUS_UI_ICON = {PUBLISHED => "fa-check", UNPUBLISHED => "fa-square-o", ARCHIVED => "fa-archive", REMOVED => "fa-remove"}
|
14
15
|
|
15
16
|
included do
|
16
17
|
|
data/app/models/image/base.rb
CHANGED
@@ -32,10 +32,10 @@ class Image::Base < Kuppayam::ApplicationRecord
|
|
32
32
|
|
33
33
|
def check_file_size
|
34
34
|
if image && image.file
|
35
|
-
if image.file.size.to_f > self.max_upload_limit
|
35
|
+
if self.max_upload_limit && image.file.size.to_f > self.max_upload_limit
|
36
36
|
errors.add(:image, "You cannot upload an image greater than #{Filesize.from(self.max_upload_limit.to_s+ " b").pretty}")
|
37
37
|
end
|
38
|
-
if image.file.size.to_f < self.min_upload_limit
|
38
|
+
if self.min_upload_limit && image.file.size.to_f < self.min_upload_limit
|
39
39
|
errors.add(:image, "You cannot upload an image lesser than #{Filesize.from(self.min_upload_limit.to_s+ " b").pretty}")
|
40
40
|
end
|
41
41
|
end
|
@@ -67,7 +67,7 @@ class Image::Base < Kuppayam::ApplicationRecord
|
|
67
67
|
def get_image_configuration
|
68
68
|
imageable = self.imageable
|
69
69
|
hsh = {}
|
70
|
-
if imageable.respond_to?(:image_configuration)
|
70
|
+
if imageable.respond_to?(:image_configuration) && imageable.image_configuration[self.image_type]
|
71
71
|
hsh = imageable.image_configuration[self.image_type]
|
72
72
|
elsif self.class.respond_to?(:image_configuration)
|
73
73
|
hsh = self.class.image_configuration
|
@@ -3,10 +3,12 @@
|
|
3
3
|
images = []
|
4
4
|
end
|
5
5
|
unless defined?(image_size)
|
6
|
-
image_size = "image.
|
6
|
+
image_size = "image.small_square.url"
|
7
7
|
end
|
8
8
|
%>
|
9
|
-
|
9
|
+
|
10
|
+
<div id="div_multiple_images_index">
|
11
|
+
|
10
12
|
<% images.each do |ci| %>
|
11
13
|
|
12
14
|
<% img_url = image_url(ci, image_size, height: "auto", class: "img-inline") %>
|
@@ -15,8 +17,8 @@
|
|
15
17
|
remove_btn_display = raw(theme_fa_icon("trash") + theme_button_text("Remove"))
|
16
18
|
%>
|
17
19
|
|
18
|
-
<div class="col-md-3 col-sm-12 col-xs-12"
|
19
|
-
style="border
|
20
|
+
<div class="col-lg-2 col-md-3 col-sm-12 col-xs-12"
|
21
|
+
style="border:1px solid #f1f1f1;padding:10px;"
|
20
22
|
id="<%= ci.id %>-multiple-image">
|
21
23
|
|
22
24
|
<%= image_tag(img_url, width: "100%", height: "auto", class: "img-inline") %>
|
@@ -0,0 +1,81 @@
|
|
1
|
+
<%
|
2
|
+
if @resource_options[:layout] == :table
|
3
|
+
row_id = "#tr_#{@resource_options[:item_name]}_#{@r_object.try(:id)}"
|
4
|
+
row_parent_id = raw("#div_#{@resource_options[:item_name]}_index table > tbody")
|
5
|
+
elsif @resource_options[:layout] == :feed
|
6
|
+
row_id = "#div_#{@resource_options[:item_name]}_#{@r_object.try(:id)}"
|
7
|
+
row_parent_id = "#div_#{@resource_options[:item_name]}_list"
|
8
|
+
end
|
9
|
+
%>
|
10
|
+
|
11
|
+
<% show_id = "#div_#{@resource_options[:item_name]}_show" %>
|
12
|
+
|
13
|
+
<% if @r_object.errors.blank? %>
|
14
|
+
|
15
|
+
<%
|
16
|
+
locals = {@resource_options[:item_name].to_sym => @r_object, i: -1}
|
17
|
+
if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
|
18
|
+
locals.merge!(@row_partial_locals)
|
19
|
+
end
|
20
|
+
%>
|
21
|
+
|
22
|
+
// Inserting the row on top of the table and highlighting it
|
23
|
+
$("<%= row_parent_id %>").prepend("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: locals)) %>");
|
24
|
+
$("<%= row_id %>").css("background-color", "#fffddd");
|
25
|
+
|
26
|
+
<% if @resource_options[:show_modal_after_create] %>
|
27
|
+
|
28
|
+
// Showing the saved data in the modal
|
29
|
+
var heading = "<%= raw @r_object.try(:display_name) %>";
|
30
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
|
31
|
+
<% if @resource_options[:show_model_size] == :generic %>
|
32
|
+
showGenericModal(heading, bodyContent, true);
|
33
|
+
<% elsif @resource_options[:show_model_size] == :large %>
|
34
|
+
showLargeModal(heading, bodyContent, true);
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
<% else %>
|
38
|
+
// Closing the modal if it is opened
|
39
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
40
|
+
closeGenericModal();
|
41
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
42
|
+
closeLargeModal();
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
// Showing Growl Like Message
|
47
|
+
notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
|
48
|
+
|
49
|
+
<% else %>
|
50
|
+
|
51
|
+
// Reload the form with errors
|
52
|
+
var heading = "Add an <%= @resource_options[:collection_name] %>";
|
53
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
54
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
55
|
+
showGenericModal(heading, bodyContent, true);
|
56
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
57
|
+
showLargeModal(heading, bodyContent, true);
|
58
|
+
<% end %>
|
59
|
+
|
60
|
+
// Show Main Error Message on the form
|
61
|
+
<% error_message = content_tag(:div, I18n.t('errors.errors_highlighted'), class: "alert alert-danger mt-20") %>
|
62
|
+
$("#<%= @resource_options[:item_name] %>_form_error").html("<%= escape_javascript(error_message) %>");
|
63
|
+
|
64
|
+
<% if @resource_options[:load_wysihtml5] %>
|
65
|
+
// Initialize WYSIHTML Editor
|
66
|
+
$(".wysihtml5").wysihtml5(
|
67
|
+
{"stylesheets": '/assets/wysiwyg-color.css'}
|
68
|
+
);
|
69
|
+
<% end %>
|
70
|
+
|
71
|
+
<% if @resource_options[:tagsinput] %>
|
72
|
+
// Initialize WYSIHTML Editor
|
73
|
+
$('input.kuppayam-tagsinput').tagsinput();
|
74
|
+
<% end %>
|
75
|
+
|
76
|
+
// Showing Growl Like Message
|
77
|
+
notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
|
78
|
+
|
79
|
+
<% end %>
|
80
|
+
|
81
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% if @resource_options[:layout] == :table %>
|
2
|
+
<% row_id = "#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>" %>
|
3
|
+
<% elsif @resource_options[:layout] == :feed %>
|
4
|
+
<% row_id = "#div_<%= @resource_options[:item_name] %>_<%= @r_object.id %>" %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% if @destroyed %>
|
8
|
+
|
9
|
+
// Removing the item from the list
|
10
|
+
$("<%= row_id %>").remove();
|
11
|
+
|
12
|
+
// Closing the modal if it is opened
|
13
|
+
<% if @resource_options[:show_model_size] == :generic %>
|
14
|
+
closeGenericModal();
|
15
|
+
<% elsif @resource_options[:show_model_size] == :large %>
|
16
|
+
closeLargeModal();
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
// Showing Growl Like Message
|
20
|
+
notifySuccess("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
|
21
|
+
|
22
|
+
<% else %>
|
23
|
+
|
24
|
+
// Show the error in a modal
|
25
|
+
showMessageModal("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
|
26
|
+
|
27
|
+
// Showing Growl Like Message
|
28
|
+
notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(@notification[:message]) %>");
|
29
|
+
|
30
|
+
<% end %>
|
31
|
+
|
32
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// Load the form
|
2
|
+
var heading = "Edit '<%= raw @r_object.try(:display_name) %>'";
|
3
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
4
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
5
|
+
showGenericModal(heading, bodyContent, true);
|
6
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
7
|
+
showLargeModal(heading, bodyContent, true);
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
// Initialize WYSIHTML Editor
|
11
|
+
<% if @resource_options[:load_wysihtml5] %>
|
12
|
+
$(".wysihtml5").wysihtml5(
|
13
|
+
{"stylesheets": '/assets/wysiwyg-color.css'}
|
14
|
+
);
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
// Initialize WYSIHTML Editor
|
18
|
+
<% if @resource_options[:tagsinput] %>
|
19
|
+
$('input.kuppayam-tagsinput').tagsinput();
|
20
|
+
<% end %>
|
21
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<%
|
2
|
+
# if @resource_options[:layout] == :table
|
3
|
+
# index_id = "#div_#{@resource_options[:item_name]}_index"
|
4
|
+
# elsif @resource_options[:layout] == :feed
|
5
|
+
# index_id = "#div_#{@resource_options[:item_name]}_index"
|
6
|
+
# end
|
7
|
+
index_id = "#div_#{@resource_options[:item_name]}_index"
|
8
|
+
%>
|
9
|
+
|
10
|
+
// Close Modal if it is opened
|
11
|
+
<% if @resource_options[:show_model_size] == "generic" %>
|
12
|
+
closeGenericModal();
|
13
|
+
<% elsif @resource_options[:show_model_size] == "large" %>
|
14
|
+
closeLargeModal();
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<% if @r_objects.any? %>
|
18
|
+
|
19
|
+
<%
|
20
|
+
if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
|
21
|
+
locals = @row_partial_locals
|
22
|
+
else
|
23
|
+
locals = {}
|
24
|
+
end
|
25
|
+
%>
|
26
|
+
|
27
|
+
// Refresh the list
|
28
|
+
$("<%= index_id %>").html("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/index", locals: locals)) %>");
|
29
|
+
|
30
|
+
<% else %>
|
31
|
+
|
32
|
+
<%
|
33
|
+
if @resource_options[:layout] == :table
|
34
|
+
list_id = "#div_#{@resource_options[:item_name]}_index"
|
35
|
+
elsif @resource_options[:layout] == :feed
|
36
|
+
list_id = "#div_#{@resource_options[:item_name]}_list"
|
37
|
+
end
|
38
|
+
%>
|
39
|
+
|
40
|
+
var noResultsText = "<%= escape_javascript(theme_panel_message(I18n.translate('success.no_results_found')))%>";
|
41
|
+
$("<%= list_id %>").html(noResultsText);
|
42
|
+
|
43
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// Load the form
|
2
|
+
var heading = "Add <%= @resource_options[:item_name].to_s.titleize %>";
|
3
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
4
|
+
|
5
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
6
|
+
showGenericModal(heading, bodyContent, true);
|
7
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
8
|
+
showLargeModal(heading, bodyContent, true);
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
// Initialize WYSIHTML Editor
|
12
|
+
<% if @resource_options[:load_wysihtml5] %>
|
13
|
+
$(".wysihtml5").wysihtml5(
|
14
|
+
{"stylesheets": '/assets/wysiwyg-color.css'}
|
15
|
+
);
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
// Initialize WYSIHTML Editor
|
19
|
+
<% if @resource_options[:tagsinput] %>
|
20
|
+
$('input.kuppayam-tagsinput').tagsinput();
|
21
|
+
<% end %>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<%
|
2
|
+
if @resource_options[:layout] == :table
|
3
|
+
row_id = "#tr_#{@resource_options[:item_name]}_#{@r_object.id}"
|
4
|
+
elsif @resource_options[:layout] == :feed
|
5
|
+
row_id = "#div_#{@resource_options[:item_name]}_#{@r_object.id}"
|
6
|
+
end
|
7
|
+
%>
|
8
|
+
|
9
|
+
<% show_id = "#div_#{@resource_options[:item_name]}_show" %>
|
10
|
+
|
11
|
+
<% if @r_object && @r_object.errors.blank? %>
|
12
|
+
|
13
|
+
<%
|
14
|
+
locals = {@resource_options[:item_name].to_sym => @r_object, i: -1}
|
15
|
+
if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
|
16
|
+
locals.merge!(@row_partial_locals)
|
17
|
+
end
|
18
|
+
%>
|
19
|
+
|
20
|
+
// Updating the edited row and highlighting it
|
21
|
+
$("<%= row_id %>").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: locals)) %>");
|
22
|
+
$("<%= row_id %>").css("background-color", "#fffddd");
|
23
|
+
|
24
|
+
<% if @resource_options[:show_modal_after_update] %>
|
25
|
+
// Refresh the modal content if it is open
|
26
|
+
$("<%= show_id %>").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>")
|
27
|
+
<% else %>
|
28
|
+
// Closing the modal if it is opened
|
29
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
30
|
+
closeGenericModal();
|
31
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
32
|
+
closeLargeModal();
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
// Closing the modal
|
37
|
+
showAndHideModals();
|
38
|
+
|
39
|
+
// Showing Growl Like Message
|
40
|
+
notifySuccess("<%= @notification[:title] %>", "<%= @notification[:message] %>");
|
41
|
+
|
42
|
+
<% else %>
|
43
|
+
|
44
|
+
// Updating the row which got errored and highlighting it
|
45
|
+
$("<%= row_id %>").css("background-color", "#ffefef");
|
46
|
+
|
47
|
+
// Showing Growl Like Message
|
48
|
+
notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
|
49
|
+
|
50
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% if @r_object %>
|
2
|
+
|
3
|
+
// Show the details in the large modal
|
4
|
+
var heading = "<%= raw @r_object.try(:display_name) %>";
|
5
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
|
6
|
+
<% if @resource_options[:show_model_size] == :generic %>
|
7
|
+
showGenericModal(heading, bodyContent, true);
|
8
|
+
<% elsif @resource_options[:show_model_size] == :large %>
|
9
|
+
showLargeModal(heading, bodyContent, true);
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% else %>
|
13
|
+
|
14
|
+
// Showing Growl Like Message
|
15
|
+
notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
|
16
|
+
|
17
|
+
<% end %>
|
@@ -0,0 +1,73 @@
|
|
1
|
+
<%
|
2
|
+
if @resource_options[:layout] == :table
|
3
|
+
row_id = "#tr_#{@resource_options[:item_name]}_#{@r_object.id}"
|
4
|
+
elsif @resource_options[:layout] == :feed
|
5
|
+
row_id = "#div_#{@resource_options[:item_name]}_#{@r_object.id}"
|
6
|
+
end
|
7
|
+
%>
|
8
|
+
|
9
|
+
<% if @r_object.errors.blank? %>
|
10
|
+
|
11
|
+
<%
|
12
|
+
locals = {@resource_options[:item_name].to_sym => @r_object, i: -1}
|
13
|
+
if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
|
14
|
+
locals.merge!(@row_partial_locals)
|
15
|
+
end
|
16
|
+
%>
|
17
|
+
|
18
|
+
// Updating the edited row and highlighting it
|
19
|
+
$("<%= row_id %>").replaceWith("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: locals)) %>");
|
20
|
+
$("<%= row_id %>").css("background-color", "#fffddd");
|
21
|
+
|
22
|
+
// Showing the saved data in the modal
|
23
|
+
<% if @resource_options[:show_modal_after_update] %>
|
24
|
+
var heading = "<%= raw @r_object.try(:display_name) %>";
|
25
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/show")) %>";
|
26
|
+
<% if @resource_options[:show_model_size] == :generic %>
|
27
|
+
showGenericModal(heading, bodyContent, true);
|
28
|
+
<% elsif @resource_options[:show_model_size] == :large %>
|
29
|
+
showLargeModal(heading, bodyContent, true);
|
30
|
+
<% end %>
|
31
|
+
<% else %>
|
32
|
+
// Closing the modal if it is opened
|
33
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
34
|
+
closeGenericModal();
|
35
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
36
|
+
closeLargeModal();
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
// Showing Growl Like Message
|
41
|
+
notifySuccess("<%= @notification[:title] %>", "<%= @notification[:message] %>");
|
42
|
+
|
43
|
+
<% else %>
|
44
|
+
|
45
|
+
// Reload the form with errors
|
46
|
+
var heading = "Edit '<%= raw @r_object.try(:display_name) %>'";
|
47
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
48
|
+
<% if @resource_options[:form_model_size] == :generic %>
|
49
|
+
showGenericModal(heading, bodyContent, true);
|
50
|
+
<% elsif @resource_options[:form_model_size] == :large %>
|
51
|
+
showLargeModal(heading, bodyContent, true);
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
// Show Main Error Message on the form
|
55
|
+
<% error_message = content_tag(:div, I18n.t('errors.errors_highlighted'), class: "alert alert-danger mt-20") %>
|
56
|
+
$("#<%= @resource_options[:item_name] %>_form_error").html("<%= escape_javascript(error_message) %>");
|
57
|
+
|
58
|
+
// Initialize WYSIHTML Editor
|
59
|
+
<% if @resource_options[:load_wysihtml5] %>
|
60
|
+
$(".wysihtml5").wysihtml5(
|
61
|
+
{"stylesheets": '/assets/wysiwyg-color.css'}
|
62
|
+
);
|
63
|
+
<% end %>
|
64
|
+
|
65
|
+
// Initialize WYSIHTML Editor
|
66
|
+
<% if @resource_options[:tagsinput] %>
|
67
|
+
$('input.kuppayam-tagsinput').tagsinput();
|
68
|
+
<% end %>
|
69
|
+
|
70
|
+
// Showing Growl Like Message
|
71
|
+
notifyError("<%= escape_javascript(@notification[:title]) %>", "<%= escape_javascript(raw(@notification[:message])) %>");
|
72
|
+
|
73
|
+
<% end %>
|
@@ -1,7 +1,14 @@
|
|
1
1
|
<% if @r_object.errors.blank? %>
|
2
2
|
|
3
|
+
<%
|
4
|
+
locals = {@resource_options[:item_name].to_sym => @r_object, i: -1}
|
5
|
+
if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
|
6
|
+
locals.merge!(@row_partial_locals)
|
7
|
+
end
|
8
|
+
%>
|
9
|
+
|
3
10
|
// Inserting the row on top of the table and highlighting it
|
4
|
-
$('#div_<%= @resource_options[:item_name] %>_index table > tbody').prepend("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals:
|
11
|
+
$('#div_<%= @resource_options[:item_name] %>_index table > tbody').prepend("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/row", locals: locals)) %>");
|
5
12
|
$("#tr_<%= @resource_options[:item_name] %>_<%= @r_object.id %>").css("background-color", "#fffddd");
|
6
13
|
|
7
14
|
<% if @resource_options[:show_modal_after_create] %>
|
@@ -3,8 +3,16 @@ closeGenericModal();
|
|
3
3
|
|
4
4
|
<% if @r_objects.any? %>
|
5
5
|
|
6
|
+
<%
|
7
|
+
if @row_partial_locals && @row_partial_locals.is_a?(Hash) && !@row_partial_locals.empty?
|
8
|
+
locals = @row_partial_locals
|
9
|
+
else
|
10
|
+
locals = {}
|
11
|
+
end
|
12
|
+
%>
|
13
|
+
|
6
14
|
// Refresh the list
|
7
|
-
$('#div_<%= @resource_options[:item_name] %>_index').html("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/index")) %>");
|
15
|
+
$('#div_<%= @resource_options[:item_name] %>_index').html("<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/index", locals: locals)) %>");
|
8
16
|
|
9
17
|
<% else %>
|
10
18
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
// Load the form
|
2
2
|
var heading = "Add <%= @resource_options[:item_name].to_s.titleize %>";
|
3
3
|
var bodyContent = "<%= escape_javascript(render(:partial=>"#{@resource_options[:view_path]}/form")) %>";
|
4
|
+
|
4
5
|
showGenericModal(heading, bodyContent, true);
|
5
6
|
|
6
|
-
// Initialize WYSIHTML Editor
|
7
7
|
$(".wysihtml5").wysihtml5(
|
8
8
|
{"stylesheets": '/assets/wysiwyg-color.css'}
|
9
9
|
);
|