cm-admin 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.reek.yml +9 -0
- data/.rubocop.yml +2 -0
- data/Gemfile.lock +13 -11
- data/app/assets/stylesheets/cm_admin/components/_input.scss +2 -2
- data/app/controllers/cm_admin/resource_controller.rb +4 -3
- data/app/views/cm_admin/main/_nested_table_form.html.slim +6 -5
- data/app/views/layouts/_left_sidebar_nav.html.slim +2 -2
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_helper.rb +1 -1
- data/lib/cm_admin/view_helpers/navigation_helper.rb +1 -1
- data/package-lock.json +4877 -14029
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 886a7bc2909a6a2a250e5eddf3572b15b97a86a135c7857360504170fae37eb8
|
4
|
+
data.tar.gz: 3a0b0c08d4a2aa3f3257ca3252a1501b8d0c410ac94ae48770f6b0fc80d39fcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48401171329b37a99161420596c036556d017c971ae2287607fe4eab36022ed61a6362201912750d5ef0dcf7b934061fd52495d98c500b7dd330b438ad23e36d
|
7
|
+
data.tar.gz: 122a7cfeb69e6a88c5b59a5f0603172b0cde917fc5e9d7d34b736580890c82693247d2d419e76ad2c6649e8d73ccb3671260a986546ec5423e8692486f5bd8e8
|
data/.gitignore
CHANGED
data/.reek.yml
ADDED
data/.rubocop.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cm-admin (1.1.
|
4
|
+
cm-admin (1.1.3)
|
5
5
|
caxlsx_rails
|
6
6
|
cocoon (~> 1.2.15)
|
7
7
|
csv-importer (~> 0.8.2)
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
ice_nine (~> 0.11.0)
|
88
88
|
thread_safe (~> 0.3, >= 0.3.1)
|
89
89
|
builder (3.2.4)
|
90
|
-
caxlsx (3.4.
|
90
|
+
caxlsx (3.4.1)
|
91
91
|
htmlentities (~> 4.3, >= 4.3.4)
|
92
92
|
marcel (~> 1.0)
|
93
93
|
nokogiri (~> 1.10, >= 1.10.4)
|
@@ -113,7 +113,7 @@ GEM
|
|
113
113
|
i18n (1.11.0)
|
114
114
|
concurrent-ruby (~> 1.0)
|
115
115
|
ice_nine (0.11.2)
|
116
|
-
importmap-rails (1.1
|
116
|
+
importmap-rails (1.2.1)
|
117
117
|
actionpack (>= 6.0.0)
|
118
118
|
railties (>= 6.0.0)
|
119
119
|
json (2.6.2)
|
@@ -130,7 +130,7 @@ GEM
|
|
130
130
|
method_source (1.0.0)
|
131
131
|
mini_mime (1.1.2)
|
132
132
|
minitest (5.16.2)
|
133
|
-
net-imap (0.3.
|
133
|
+
net-imap (0.3.6)
|
134
134
|
date
|
135
135
|
net-protocol
|
136
136
|
net-pop (0.1.2)
|
@@ -140,7 +140,7 @@ GEM
|
|
140
140
|
net-smtp (0.3.3)
|
141
141
|
net-protocol
|
142
142
|
nio4r (2.5.9)
|
143
|
-
nokogiri (1.15.
|
143
|
+
nokogiri (1.15.2-arm64-darwin)
|
144
144
|
racc (~> 1.4)
|
145
145
|
pagy (4.11.0)
|
146
146
|
parallel (1.22.1)
|
@@ -148,7 +148,7 @@ GEM
|
|
148
148
|
ast (~> 2.4.1)
|
149
149
|
pundit (2.2.0)
|
150
150
|
activesupport (>= 3.0.0)
|
151
|
-
racc (1.
|
151
|
+
racc (1.7.1)
|
152
152
|
rack (2.2.6.4)
|
153
153
|
rack-proxy (0.7.6)
|
154
154
|
rack
|
@@ -168,11 +168,13 @@ GEM
|
|
168
168
|
activesupport (= 7.0.3.1)
|
169
169
|
bundler (>= 1.15.0)
|
170
170
|
railties (= 7.0.3.1)
|
171
|
-
rails-dom-testing (2.
|
172
|
-
activesupport (>=
|
171
|
+
rails-dom-testing (2.1.1)
|
172
|
+
activesupport (>= 5.0.0)
|
173
|
+
minitest
|
173
174
|
nokogiri (>= 1.6)
|
174
|
-
rails-html-sanitizer (1.
|
175
|
-
loofah (~> 2.
|
175
|
+
rails-html-sanitizer (1.6.0)
|
176
|
+
loofah (~> 2.21)
|
177
|
+
nokogiri (~> 1.14)
|
176
178
|
railties (7.0.3.1)
|
177
179
|
actionpack (= 7.0.3.1)
|
178
180
|
activesupport (= 7.0.3.1)
|
@@ -226,7 +228,7 @@ GEM
|
|
226
228
|
thor (1.2.2)
|
227
229
|
thread_safe (0.3.6)
|
228
230
|
tilt (2.0.10)
|
229
|
-
timeout (0.
|
231
|
+
timeout (0.4.0)
|
230
232
|
tzinfo (2.0.4)
|
231
233
|
concurrent-ruby (~> 1.0)
|
232
234
|
unicode-display_width (2.3.0)
|
@@ -161,7 +161,7 @@ input.cm-checkbox[type="checkbox"] {
|
|
161
161
|
}
|
162
162
|
&:checked:after {
|
163
163
|
background: $brand-color;
|
164
|
-
content: "\
|
164
|
+
content: "\2713";
|
165
165
|
font-family: FontAwesome !important;
|
166
166
|
color: $white;
|
167
167
|
border: none;
|
@@ -173,7 +173,7 @@ input.cm-checkbox[type="checkbox"] {
|
|
173
173
|
}
|
174
174
|
&:checked:after {
|
175
175
|
background: $grey-light-clr;
|
176
|
-
content: "\
|
176
|
+
content: "\2713";
|
177
177
|
font-family: FontAwesome !important;
|
178
178
|
color: $white;
|
179
179
|
border: none;
|
@@ -237,10 +237,11 @@ module CmAdmin
|
|
237
237
|
}.compact
|
238
238
|
nested_tables = @model.available_fields[:new].map(&:nested_table_fields).map(&:keys).flatten
|
239
239
|
nested_tables += @model.available_fields[:edit].map(&:nested_table_fields).map(&:keys).flatten
|
240
|
-
nested_fields = nested_tables.uniq.map {|
|
240
|
+
nested_fields = nested_tables.uniq.map {|assoc_name|
|
241
|
+
table_name = @model.ar_model.reflections[assoc_name.to_s].klass.table_name
|
241
242
|
Hash[
|
242
|
-
|
243
|
-
|
243
|
+
"#{table_name}_attributes",
|
244
|
+
table_name.to_s.classify.constantize.column_names.reject { |i| CmAdmin::REJECTABLE_FIELDS.include?(i) }.map(&:to_sym) + [:id, :_destroy]
|
244
245
|
]
|
245
246
|
}
|
246
247
|
permittable_fields += nested_fields
|
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
- table_name = @ar_object._reflections[assoc_name.to_s].klass.table_name.to_sym
|
2
|
+
.nested-field-wrapper data-table-name=assoc_name data-model-name=assoc_name.to_s.classify
|
3
|
+
label.nested-field-label = assoc_name.to_s.titleize
|
3
4
|
.accordion.nested-form-accordion
|
4
5
|
= f.fields_for table_name do |record|
|
5
6
|
- if record.object.persisted?
|
6
|
-
= render partial: '/cm_admin/main/nested_fields', locals: { f: record, assoc_name:
|
7
|
-
- if @reflections.select {|x| x if x.name ==
|
7
|
+
= render partial: '/cm_admin/main/nested_fields', locals: { f: record, assoc_name: assoc_name, section: section }
|
8
|
+
- if @reflections.select {|x| x if x.name == assoc_name}.first.macro == :has_many
|
8
9
|
.links
|
9
|
-
= link_to_add_association "+ Add #{
|
10
|
+
= link_to_add_association "+ Add #{assoc_name.to_s.titleize}", f, table_name, partial: '/cm_admin/main/nested_fields', render_options: {locals: { assoc_name: assoc_name, section: section }}, class: 'd-inline-block secondary-btn mt-2'
|
data/lib/cm_admin/version.rb
CHANGED
@@ -76,7 +76,7 @@ module CmAdmin
|
|
76
76
|
def set_nested_form_fields(form_obj, section)
|
77
77
|
content_tag(:div) do
|
78
78
|
section.nested_table_fields.keys.each do |key|
|
79
|
-
concat(render partial: '/cm_admin/main/nested_table_form', locals: {f: form_obj,
|
79
|
+
concat(render partial: '/cm_admin/main/nested_table_form', locals: { f: form_obj, assoc_name: key, section: section })
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|