activeadmin_addons 2.0.0.beta.3 → 2.0.0.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/inputs/selected_list_input.rb +0 -1
- data/app/javascript/activeadmin_addons/addons/toggle_bool.js +14 -0
- data/app/javascript/activeadmin_addons/stylesheets/inputs/date-time-picker-filter.scss +1 -2
- data/lib/activeadmin_addons/addons/toggle_bool_builder.rb +3 -1
- data/lib/activeadmin_addons/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d1d92c2197d4d974df8f2d6e19551aa328ab605c65fe492b84a9a5874e97452
|
4
|
+
data.tar.gz: b144abdc489072a0edd9b61ebbf04b46b27495b26f92cbac0ab539c75943605b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f27037816601052006e102f463e2992da4d5a04d9fa897717bf1f25891e03b0d5b34c852725ba18ad6e1417a4943c58e2a77071d7cc234918d33cecd06c1c26d
|
7
|
+
data.tar.gz: ad92d7c5390027c736081e829a171abc45afdb50c32b504c634540ccf769b29791dbda72eb1f7f42b534edd87e5088766b0d339ca9502efcc15c54c39a932565
|
@@ -26,7 +26,6 @@ class SelectedListInput < ActiveAdminAddons::InputBase
|
|
26
26
|
|
27
27
|
def render_control_wrapper
|
28
28
|
template.content_tag(:div, class: "selected-list-container") do
|
29
|
-
template.content_tag(label_html)
|
30
29
|
template.concat(render_items_list)
|
31
30
|
template.concat(builder.select(build_virtual_attr, [], {}, input_html_options))
|
32
31
|
end
|
@@ -2,6 +2,20 @@ var initializer = function() {
|
|
2
2
|
$('.toggle-bool-switch').click(function(e) {
|
3
3
|
var boolSwitch = $(e.target);
|
4
4
|
|
5
|
+
var value = boolSwitch.data('value');
|
6
|
+
var confirmMessage = boolSwitch.data('confirm_message');
|
7
|
+
var confirmTrigger = boolSwitch.data('confirm_message_trigger') || 'both';
|
8
|
+
|
9
|
+
if (confirmMessage) {
|
10
|
+
var shouldConfirm =
|
11
|
+
(confirmTrigger === 'both') ||
|
12
|
+
(confirmTrigger === 'on' && !value) ||
|
13
|
+
(confirmTrigger === 'off' && value);
|
14
|
+
|
15
|
+
if (shouldConfirm && !confirm(confirmMessage)) {
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
}
|
5
19
|
var objectId = boolSwitch.data('object_id');
|
6
20
|
var model = boolSwitch.data('model');
|
7
21
|
var field = boolSwitch.data('field');
|
@@ -24,7 +24,9 @@ module ActiveAdminAddons
|
|
24
24
|
'data-field' => attribute,
|
25
25
|
'data-value' => data,
|
26
26
|
'data-url' => resource_url,
|
27
|
-
'data-success_message' => options[:success_message]
|
27
|
+
'data-success_message' => options[:success_message],
|
28
|
+
'data-confirm_message' => options[:confirm_message],
|
29
|
+
'data-confirm_message_trigger' => options[:confirm_message_trigger]
|
28
30
|
)
|
29
31
|
end
|
30
32
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin_addons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.beta.
|
4
|
+
version: 2.0.0.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platanus
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|
@@ -506,11 +506,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
506
506
|
version: 2.7.0
|
507
507
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
508
508
|
requirements:
|
509
|
-
- - "
|
509
|
+
- - ">="
|
510
510
|
- !ruby/object:Gem::Version
|
511
|
-
version:
|
511
|
+
version: '0'
|
512
512
|
requirements: []
|
513
|
-
rubygems_version: 3.
|
513
|
+
rubygems_version: 3.5.22
|
514
514
|
signing_key:
|
515
515
|
specification_version: 4
|
516
516
|
summary: Set of addons to help with the activeadmin ui
|