card-mod-edit 0.11.3 → 0.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/set/all/edit_name.rb +2 -2
- data/set/all/form.rb +7 -0
- data/set/all/form_buttons.rb +8 -2
- data/set/all/new.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4585a2392445ad135ba9d2ca3d5281ac157e60c985a13065ab40fe616833dd1
|
4
|
+
data.tar.gz: 411c89a8efe8b6340e712265a7b57b2b4a32d97cb4a3ce767a06f647baa74891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b593eeb1dcd1c28e11154cf4a2d97708901d5fdaf087441e641767070c74061b9d39bc89368b5f37f82c9f0070070a33d88076ce2fb29d096a4998244769735
|
7
|
+
data.tar.gz: ae37bbd8b63506434029f7acb2627070912a0bf2211ecc0e63140ff2941c8801516dcdc7c6a300ce6d1e9167b6f10b5d01d7f51daf2f580a64cde0269b3b6e51
|
data/set/all/edit_name.rb
CHANGED
@@ -11,7 +11,7 @@ format :html do
|
|
11
11
|
|
12
12
|
def name_form success_view=nil
|
13
13
|
card_form({ action: :update, id: card.id },
|
14
|
-
|
14
|
+
"data-main-success": JSON(redirect: true, view: ""),
|
15
15
|
"data-update-origin": "true",
|
16
16
|
success: edit_name_success(success_view)) do
|
17
17
|
[hidden_edit_name_fields,
|
@@ -22,7 +22,7 @@ format :html do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def edit_name_success view=nil
|
25
|
-
success = {
|
25
|
+
success = { name: "_self", redirect: "" }
|
26
26
|
success[:view] = view if view
|
27
27
|
success
|
28
28
|
end
|
data/set/all/form.rb
CHANGED
@@ -214,9 +214,16 @@ format :html do
|
|
214
214
|
add_class opts, "card-form"
|
215
215
|
add_class opts, "slotter" unless opts[:redirect] || opts[:no_slotter]
|
216
216
|
add_class opts, "autosave" if action == :update
|
217
|
+
interpret_main_success_opts opts
|
217
218
|
opts
|
218
219
|
end
|
219
220
|
|
221
|
+
def interpret_main_success_opts opts
|
222
|
+
return unless (hash = opts.delete :main_success)
|
223
|
+
|
224
|
+
opts["data-main-success"] = JSON hash
|
225
|
+
end
|
226
|
+
|
220
227
|
def card_form_url_and_action action
|
221
228
|
case action
|
222
229
|
when Symbol then [path(action: action), action]
|
data/set/all/form_buttons.rb
CHANGED
@@ -51,7 +51,7 @@ format :html do
|
|
51
51
|
add_class opts, "slotter btn btn-outline-danger ml-auto btn-sm"
|
52
52
|
opts["data-confirm"] = delete_confirm opts
|
53
53
|
opts[:path] = { action: :delete }
|
54
|
-
opts[:path][:success] = delete_success(opts)
|
54
|
+
opts[:path][:success] = delete_success(opts)
|
55
55
|
opts[:remote] = true
|
56
56
|
opts
|
57
57
|
end
|
@@ -61,6 +61,12 @@ format :html do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def delete_success opts
|
64
|
-
opts
|
64
|
+
if opts[:success]
|
65
|
+
opts.delete :success
|
66
|
+
elsif main?
|
67
|
+
{ redirect: true, mark: "*previous" }
|
68
|
+
else
|
69
|
+
{ view: :just_deleted }
|
70
|
+
end
|
65
71
|
end
|
66
72
|
end
|
data/set/all/new.rb
CHANGED
@@ -75,7 +75,7 @@ format :html do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def new_form_opts
|
78
|
-
{ "main-success"
|
78
|
+
{ "data-main-success": JSON(redirect: true) }
|
79
79
|
end
|
80
80
|
|
81
81
|
def new_view_title
|
@@ -90,7 +90,7 @@ format :html do
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def new_success
|
93
|
-
card.rule(:thanks) || "_self"
|
93
|
+
{ mark: (card.rule(:thanks) || "_self") }
|
94
94
|
end
|
95
95
|
|
96
96
|
def new_in_modal_success; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-edit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.101.
|
21
|
+
version: 1.101.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.101.
|
28
|
+
version: 1.101.4
|
29
29
|
description: ''
|
30
30
|
email:
|
31
31
|
- info@decko.org
|