cm-admin 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c954e879848a1dceb41ea1f58c97f1d229578e1eb1f8c3f2773d78a6b3b9b8bb
4
- data.tar.gz: 4d974946159d6872f3f468927530815db8c6ac1d991a67fc0471d67b989524b6
3
+ metadata.gz: 6ca2b1b912d7ae2bc0925180a861cba806874e54baa273c2176af245e68940c0
4
+ data.tar.gz: d56e8c3155712a502cab04a22aa209877988cc85593d56008155e0daf7d4778b
5
5
  SHA512:
6
- metadata.gz: b2c2cd192998d5cb4d7af930335e426cc7fe2ac82d5909f91bb403015f9bc7c54f395c8da604402f522f151dab47a6d659cc485a117e821e6bbd6844455a0d9d
7
- data.tar.gz: bf677ee70e98d43d320ed964860f4b6a5a4e549a4620e6789be257eb6baa2483635dc321cc691272f4b572f7144768902c36867e99e4af2f503866f97b03702b
6
+ metadata.gz: d71ce2f05820e692c76d40db3fee7f646066a3bff0c1341b2ef78dae62339f6d750bfacc38d4a8d4676ce73b5bb502469487c93a9a32246281d3bdfa14eb2933
7
+ data.tar.gz: 564ddd3e0842b3ce7505e41f4f34a26a55bb3428aac6e7c9960af3bf34cb2c17877f4c251c0c3f6f54981d19a2f33fc87b2a761d6782f55a4a9d231e9ae044b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.1.1)
4
+ cm-admin (1.1.2)
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.0)
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.6)
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.4)
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.0-arm64-darwin)
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.6.2)
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.0.3)
172
- activesupport (>= 4.2.0)
171
+ rails-dom-testing (2.1.1)
172
+ activesupport (>= 5.0.0)
173
+ minitest
173
174
  nokogiri (>= 1.6)
174
- rails-html-sanitizer (1.5.0)
175
- loofah (~> 2.19, >= 2.19.1)
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.3.2)
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)
@@ -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 {|table|
240
+ nested_fields = nested_tables.uniq.map {|assoc_name|
241
+ table_name = @ar_object._reflections[assoc_name.to_s].klass.table_name
241
242
  Hash[
242
- table.to_s + '_attributes',
243
- table.to_s.classify.constantize.column_names.reject { |i| CmAdmin::REJECTABLE_FIELDS.include?(i) }.map(&:to_sym) + [:id, :_destroy]
243
+ table_name.to_s + '_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
- .nested-field-wrapper data-table-name=table_name data-model-name=table_name.to_s.classify
2
- label.nested-field-label = table_name.to_s.titleize
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: table_name, section: section }
7
- - if @reflections.select {|x| x if x.name == table_name}.first.macro == :has_many
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 #{table_name.to_s.titleize}", f, table_name, partial: '/cm_admin/main/nested_fields', render_options: {locals: { assoc_name: table_name, section: section }}, class: 'd-inline-block secondary-btn mt-2'
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'
@@ -16,8 +16,8 @@
16
16
  .sidebar__footer
17
17
  .menu-item
18
18
  .profile-name
19
- span.profile-avatar J
20
- | #{user_full_name}
19
+ span.profile-avatar #{user_full_name.first.titleize}
20
+ | #{user_full_name.titleize}
21
21
  .profile-popup.hidden
22
22
  .profile-info
23
23
  .profile-info__left
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -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, table_name: key, section: section})
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
@@ -14,7 +14,7 @@ module CmAdmin
14
14
  content_tag(:span, class: 'menu-icon') do
15
15
  concat tag.i class: "#{model.icon_name}"
16
16
  end +
17
- model.name.pluralize
17
+ model.name.underscore.titleize.pluralize
18
18
  end
19
19
  end
20
20
  elsif navigation_type == "quick_links"