cm-admin 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/cm_admin/form_validation.js +34 -35
- data/app/assets/javascripts/cm_admin/shared_scaffolds.js +5 -1
- data/app/assets/stylesheets/cm_admin/base/scaffold.scss +1 -1
- data/app/assets/stylesheets/cm_admin/base/sidebar.scss +1 -1
- data/app/views/cm_admin/main/_actions_dropdown.html.slim +1 -1
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/page_info_helper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86d033fefa5d556af30d7127b65993513423c82a5358774eba875ab17d8946a1
|
4
|
+
data.tar.gz: 466f4769e70f2d6133873d5931cb4d6fbf826629b8ad3b837ff06b5fe36c49ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d5f05bc6a9a5e02226c95e8a487210b391272e4d8bf871327fbc013359f9f4e25e50d0bb68b57c08607573e57fb92e142282f0176bb3e7ad5473047904f97c7
|
7
|
+
data.tar.gz: 0b6f062d86781a11903361f97bd2d3de607d500ff675b0ce1acebfbdb0548cd4842033d54066ba058aacd7f57ec6570383570ae5f6a7d1eb8e263884f0e6d535
|
data/Gemfile.lock
CHANGED
@@ -1,37 +1,36 @@
|
|
1
|
-
$(document).on('
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
13
|
-
});
|
14
|
-
$("." + form_class + " select.required").each(function() {
|
15
|
-
$(this).removeClass('error');
|
16
|
-
if ($(this).val().trim().length === 0) {
|
17
|
-
$(this).parent().find('.select2').addClass('error');
|
18
|
-
window.scrollTo(top);
|
19
|
-
submit.push(true);
|
20
|
-
}
|
21
|
-
});
|
22
|
-
$('.nested_input_validation').each(function() {
|
23
|
-
var class_name;
|
24
|
-
class_name = $(this).data('class-name');
|
25
|
-
$(this).parents(':nth(1)').find('.' + class_name).addClass('hidden');
|
26
|
-
if ($(this).val().trim().length === 0) {
|
27
|
-
$(this).parents(':nth(1)').find('.' + class_name).removeClass('hidden');
|
28
|
-
window.scrollTo(top);
|
29
|
-
submit.push(true);
|
30
|
-
}
|
31
|
-
});
|
32
|
-
if (submit.length === 0) {
|
33
|
-
$('.' + form_class).submit();
|
34
|
-
return $('.form_submit').button('loading');
|
1
|
+
$(document).on('click', '.form_submit', function(e) {
|
2
|
+
console.log('Came here')
|
3
|
+
e.preventDefault();
|
4
|
+
var submit = [];
|
5
|
+
var form_class = $(this).data('form-class');
|
6
|
+
$("." + form_class + " input.required, ." + form_class + " textarea.required").each(function() {
|
7
|
+
$(this).removeClass('error');
|
8
|
+
if ($(this).val().trim().length === 0) {
|
9
|
+
$(this).addClass('error');
|
10
|
+
$(this)[0].scrollIntoView(true);
|
11
|
+
submit.push(true);
|
35
12
|
}
|
36
13
|
});
|
37
|
-
|
14
|
+
$("." + form_class + " select.required").each(function() {
|
15
|
+
$(this).removeClass('error');
|
16
|
+
if ($(this).val().trim().length === 0) {
|
17
|
+
$(this).parent().find('.select2').addClass('error');
|
18
|
+
$(this)[0].scrollIntoView(true);
|
19
|
+
submit.push(true);
|
20
|
+
}
|
21
|
+
});
|
22
|
+
$('.nested_input_validation').each(function() {
|
23
|
+
var class_name;
|
24
|
+
class_name = $(this).data('class-name');
|
25
|
+
$(this).parents(':nth(1)').find('.' + class_name).addClass('hidden');
|
26
|
+
if ($(this).val().trim().length === 0) {
|
27
|
+
$(this).parents(':nth(1)').find('.' + class_name).removeClass('hidden');
|
28
|
+
$(this)[0].scrollIntoView(true);
|
29
|
+
submit.push(true);
|
30
|
+
}
|
31
|
+
});
|
32
|
+
if (submit.length === 0) {
|
33
|
+
$('.' + form_class).submit();
|
34
|
+
return $('.form_submit').button('loading');
|
35
|
+
}
|
36
|
+
});
|
@@ -22,7 +22,11 @@ $(document).on('click', '.row-action-cell', function(e) {
|
|
22
22
|
$('.row-action-cell').removeClass('opacity-1')
|
23
23
|
$(this).addClass('opacity-1');
|
24
24
|
}
|
25
|
-
$(this).find('.table-export-popup').
|
25
|
+
if ($(this).find('.table-export-popup').hasClass('hidden')) {
|
26
|
+
return $(this).find('.table-export-popup').removeClass('hidden');
|
27
|
+
} else {
|
28
|
+
return $(this).find('.table-export-popup').addClass('hidden');
|
29
|
+
}
|
26
30
|
});
|
27
31
|
|
28
32
|
|
@@ -34,7 +34,7 @@
|
|
34
34
|
- if custom_action.display_if.call(ar_object)
|
35
35
|
- case custom_action.display_type
|
36
36
|
- when :button
|
37
|
-
=
|
37
|
+
= button_to cm_admin.send("#{cm_model.name.underscore}_index_path") + '/' + custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
|
38
38
|
.popup-option
|
39
39
|
span
|
40
40
|
i class="#{custom_action.icon_name}"
|
data/lib/cm_admin/version.rb
CHANGED
@@ -73,9 +73,9 @@ module CmAdmin
|
|
73
73
|
|
74
74
|
def custom_action_button(custom_action, current_action_name)
|
75
75
|
if current_action_name == "index"
|
76
|
-
|
76
|
+
button_to custom_action_title(custom_action), @model.ar_model.table_name + '/' + custom_action.path, class: 'secondary-btn ml-2', method: custom_action.verb
|
77
77
|
elsif current_action_name == "show"
|
78
|
-
|
78
|
+
button_to custom_action_title(custom_action), custom_action.path.gsub(':id', params[:id]), class: 'secondary-btn ml-2', method: custom_action.verb
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cm-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sajinmp
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-05-
|
13
|
+
date: 2023-05-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|