headmin 0.3.2 → 0.3.3
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/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +27 -23
- data/app/assets/images/document.docx +0 -0
- data/app/assets/images/document.pdf +0 -0
- data/app/assets/images/image.jpg +0 -0
- data/app/assets/images/spreadsheet.xls +0 -0
- data/app/assets/images/video.mp4 +0 -0
- data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +2 -2
- data/app/assets/javascripts/headmin/controllers/table_controller.js +28 -13
- data/app/assets/javascripts/headmin/index.js +0 -4
- data/app/assets/javascripts/headmin.js +33 -696
- data/app/assets/stylesheets/headmin/form.scss +4 -4
- data/app/assets/stylesheets/headmin/vendor/tom-select-bootstrap.css +1 -2
- data/app/assets/stylesheets/headmin.css +3 -3
- data/app/controllers/concerns/headmin/authentication.rb +1 -1
- data/app/controllers/concerns/headmin/searchable.rb +1 -1
- data/app/controllers/concerns/headmin/sortable.rb +7 -7
- data/app/helpers/headmin/admin_helper.rb +1 -1
- data/app/helpers/headmin/bootstrap_helper.rb +2 -24
- data/app/helpers/headmin/documentation_helper.rb +1 -1
- data/app/helpers/headmin/filter_helper.rb +1 -1
- data/app/helpers/headmin/form_helper.rb +3 -3
- data/app/helpers/headmin/notification_helper.rb +21 -21
- data/app/helpers/headmin/request_helper.rb +3 -3
- data/app/models/concerns/headmin/block.rb +1 -2
- data/app/models/concerns/headmin/blockable.rb +1 -1
- data/app/models/concerns/headmin/field.rb +1 -1
- data/app/models/concerns/headmin/fieldable.rb +8 -8
- data/app/models/headmin/documentation_renderer.rb +4 -4
- data/app/models/headmin/form/base.rb +1 -2
- data/app/models/headmin/form/text.rb +5 -7
- data/app/models/headmin/thumbnail.rb +61 -0
- data/app/services/block_service.rb +53 -53
- data/app/views/headmin/_thumbnail.html.erb +42 -40
- data/app/views/headmin/dropdown/_item.html.erb +1 -1
- data/app/views/headmin/forms/_checkbox.html.erb +1 -1
- data/app/views/headmin/forms/_file.html.erb +1 -1
- data/app/views/headmin/forms/_repeater.html.erb +1 -1
- data/app/views/headmin/forms/actions/_destroy.html.erb +3 -3
- data/app/views/headmin/forms/fields/_group.html.erb +1 -1
- data/app/views/headmin/nav/item/_devise.html.erb +1 -1
- data/app/views/headmin/table/_actions.html.erb +1 -1
- data/app/views/headmin/views/devise/registrations/_edit.html.erb +2 -2
- data/config/initializers/customize_input_error.rb +4 -4
- data/lib/generators/headmin/blocks_generator.rb +8 -8
- data/lib/generators/headmin/devise_generator.rb +4 -4
- data/lib/generators/headmin/fields_generator.rb +9 -9
- data/lib/generators/templates/controllers/auth/confirmations_controller.rb +1 -1
- data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +1 -1
- data/lib/generators/templates/controllers/auth/passwords_controller.rb +1 -1
- data/lib/generators/templates/controllers/auth/registrations_controller.rb +1 -1
- data/lib/generators/templates/controllers/auth/sessions_controller.rb +1 -1
- data/lib/generators/templates/controllers/auth/unlocks_controller.rb +1 -1
- data/lib/generators/templates/models/block.rb +1 -1
- data/lib/headmin/engine.rb +6 -6
- data/lib/headmin/version.rb +1 -1
- data/package.json +0 -1
- data/yarn.lock +1 -258
- metadata +9 -4
- data/.rubocop.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9030a5fb86be00d17cc66832c36991fe2af18d745c94737a548695ff572b1b6f
|
4
|
+
data.tar.gz: 786656902c0252efd3a2ea7b29df56f0c31b006dbdc1ee7bab4e2573711b617d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 599ca9728a88c3a9cd210429d5864660eef92831602f3f4c1370d0b40a58640e288fc3682caff76463e43e43df86cf56844cc414e53ec260e12308e7be6ea76b
|
7
|
+
data.tar.gz: 8647e86331483620394e4ae0c0cf38c4ccac1ae89843de242a590af2bdb819104ffd0afd89bd77f5e6fb1264a9ead16dc8915c7ecf3dc7b740d52b65b73518a6
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-3.
|
1
|
+
ruby-3.1.0
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
headmin (0.3.
|
4
|
+
headmin (0.3.3)
|
5
5
|
closure_tree (~> 7.4)
|
6
6
|
inline_svg (~> 1.7)
|
7
7
|
redcarpet (~> 3.5)
|
@@ -10,23 +10,22 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activemodel (
|
14
|
-
activesupport (=
|
15
|
-
activerecord (
|
16
|
-
activemodel (=
|
17
|
-
activesupport (=
|
18
|
-
activesupport (
|
13
|
+
activemodel (7.0.1)
|
14
|
+
activesupport (= 7.0.1)
|
15
|
+
activerecord (7.0.1)
|
16
|
+
activemodel (= 7.0.1)
|
17
|
+
activesupport (= 7.0.1)
|
18
|
+
activesupport (7.0.1)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 1.6, < 2)
|
21
21
|
minitest (>= 5.1)
|
22
22
|
tzinfo (~> 2.0)
|
23
|
-
zeitwerk (~> 2.3)
|
24
23
|
ast (2.4.2)
|
25
24
|
closure_tree (7.4.0)
|
26
25
|
activerecord (>= 4.2.10)
|
27
26
|
with_advisory_lock (>= 4.0.0)
|
28
27
|
concurrent-ruby (1.1.9)
|
29
|
-
i18n (1.
|
28
|
+
i18n (1.9.1)
|
30
29
|
concurrent-ruby (~> 1.0)
|
31
30
|
inline_svg (1.8.0)
|
32
31
|
activesupport (>= 3.0)
|
@@ -34,34 +33,39 @@ GEM
|
|
34
33
|
minitest (5.14.4)
|
35
34
|
nokogiri (1.13.1-x86_64-darwin)
|
36
35
|
racc (~> 1.4)
|
37
|
-
parallel (1.
|
38
|
-
parser (3.
|
36
|
+
parallel (1.21.0)
|
37
|
+
parser (3.1.0.0)
|
39
38
|
ast (~> 2.4.1)
|
40
39
|
racc (1.6.0)
|
41
|
-
rainbow (3.
|
40
|
+
rainbow (3.1.1)
|
42
41
|
rake (13.0.3)
|
43
42
|
redcarpet (3.5.1)
|
44
|
-
regexp_parser (2.
|
45
|
-
rexml (3.2.
|
43
|
+
regexp_parser (2.2.0)
|
44
|
+
rexml (3.2.5)
|
46
45
|
rouge (3.27.0)
|
47
|
-
rubocop (1.
|
46
|
+
rubocop (1.25.0)
|
48
47
|
parallel (~> 1.10)
|
49
|
-
parser (>= 3.
|
48
|
+
parser (>= 3.1.0.0)
|
50
49
|
rainbow (>= 2.2.2, < 4.0)
|
51
50
|
regexp_parser (>= 1.8, < 3.0)
|
52
51
|
rexml
|
53
|
-
rubocop-ast (>= 1.
|
52
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
54
53
|
ruby-progressbar (~> 1.7)
|
55
54
|
unicode-display_width (>= 1.4.0, < 3.0)
|
56
|
-
rubocop-ast (1.
|
57
|
-
parser (>=
|
55
|
+
rubocop-ast (1.15.1)
|
56
|
+
parser (>= 3.0.1.1)
|
57
|
+
rubocop-performance (1.13.2)
|
58
|
+
rubocop (>= 1.7.0, < 2.0)
|
59
|
+
rubocop-ast (>= 0.4.0)
|
58
60
|
ruby-progressbar (1.11.0)
|
61
|
+
standard (1.7.0)
|
62
|
+
rubocop (= 1.25.0)
|
63
|
+
rubocop-performance (= 1.13.2)
|
59
64
|
tzinfo (2.0.4)
|
60
65
|
concurrent-ruby (~> 1.0)
|
61
|
-
unicode-display_width (2.
|
66
|
+
unicode-display_width (2.1.0)
|
62
67
|
with_advisory_lock (4.6.0)
|
63
68
|
activerecord (>= 4.2)
|
64
|
-
zeitwerk (2.5.3)
|
65
69
|
|
66
70
|
PLATFORMS
|
67
71
|
x86_64-darwin-19
|
@@ -70,7 +74,7 @@ DEPENDENCIES
|
|
70
74
|
headmin!
|
71
75
|
minitest (~> 5.0)
|
72
76
|
rake (~> 13.0)
|
73
|
-
|
77
|
+
standard (~> 1.7)
|
74
78
|
|
75
79
|
BUNDLED WITH
|
76
|
-
2.
|
80
|
+
2.3.3
|
Binary file
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
@@ -69,9 +69,9 @@ export default class extends Controller {
|
|
69
69
|
const option = this.selectedOption()
|
70
70
|
const confirm = option.dataset.confirm
|
71
71
|
if (confirm) {
|
72
|
-
this.
|
72
|
+
this.formTarget.dataset.turboConfirm = confirm
|
73
73
|
} else {
|
74
|
-
this.
|
74
|
+
this.formTarget.removeAttribute('data-turbo-confirm')
|
75
75
|
}
|
76
76
|
this.enableButton()
|
77
77
|
}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import {Controller} from "@hotwired/stimulus"
|
2
2
|
import Sortable from "sortablejs";
|
3
|
-
import Rails from "@rails/ujs";
|
4
3
|
|
5
4
|
export default class extends Controller {
|
6
5
|
static get values() {
|
@@ -18,23 +17,39 @@ export default class extends Controller {
|
|
18
17
|
new Sortable(this.bodyTarget, {
|
19
18
|
handle: '.table-drag-sort-handle',
|
20
19
|
onEnd: (event) => {
|
21
|
-
|
22
|
-
url: this.urlValue,
|
23
|
-
type: "PATCH",
|
24
|
-
data: this.getIdsDataString(),
|
25
|
-
});
|
20
|
+
this.submitPositions()
|
26
21
|
}
|
27
22
|
})
|
28
23
|
}
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
25
|
+
submitPositions() {
|
26
|
+
fetch(this.urlValue, {
|
27
|
+
method: 'PATCH',
|
28
|
+
body: this.idsFormData(),
|
29
|
+
headers: {
|
30
|
+
'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content
|
31
|
+
},
|
32
|
+
}).then((response) => {
|
33
|
+
return response.text()
|
34
|
+
}).catch((err) => {
|
35
|
+
console.warn('Fetch went wrong', err)
|
36
36
|
})
|
37
|
-
|
37
|
+
}
|
38
|
+
|
39
|
+
positions() {
|
40
|
+
const handles = [...this.tableTarget.querySelectorAll(".table-drag-sort-handle")]
|
41
|
+
return handles.map((handle) => {
|
42
|
+
return handle.dataset.id
|
43
|
+
})
|
44
|
+
}
|
45
|
+
|
46
|
+
idsFormData() {
|
47
|
+
let formData = new FormData()
|
48
|
+
console.log(this.positions())
|
49
|
+
this.positions().forEach(id => {
|
50
|
+
formData.append('ids[]', id)
|
51
|
+
})
|
52
|
+
return formData
|
38
53
|
}
|
39
54
|
|
40
55
|
toggleIds(event) {
|
@@ -14,7 +14,6 @@ import RepeaterController from "./controllers/repeater_controller"
|
|
14
14
|
import SelectController from "./controllers/select_controller"
|
15
15
|
import TableActionsController from "./controllers/table_actions_controller"
|
16
16
|
import TableController from "./controllers/table_controller"
|
17
|
-
import Rails from "@rails/ujs";
|
18
17
|
|
19
18
|
export class Headmin {
|
20
19
|
static start() {
|
@@ -34,8 +33,5 @@ export class Headmin {
|
|
34
33
|
Stimulus.register("select", SelectController)
|
35
34
|
Stimulus.register("table", TableController)
|
36
35
|
Stimulus.register("table-actions", TableActionsController)
|
37
|
-
|
38
|
-
// Init Rails UJS
|
39
|
-
Rails.start()
|
40
36
|
}
|
41
37
|
}
|