dynamic_scaffold 1.2.2 → 1.3.0

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: 88a9b0ba71da96bb8f41afbac56bb073f33a8ffd9218999772696621b2c17abe
4
- data.tar.gz: c4830cb8843e76fe6edc7fcf2860429ba627dbb69776bc47cf50153061be5108
3
+ metadata.gz: 2cc7a47fdf21680556c682f4e595861cbe3a3d8791328fffa7035cd0a171d7fa
4
+ data.tar.gz: ebcfd2e48af4267a087df753ebe571112d84c3c3702fe0fd7a66cec4a36e111a
5
5
  SHA512:
6
- metadata.gz: 990e4370de42c4267fbb42430af8a1c379a3fc9edcd225ad1112f245f1726f843d36b2f39a6c4a3e6e14381246c4f6b696014f2d99ac51a045ba1f3be01a5a33
7
- data.tar.gz: 746ac3fe2f0fa9f8ee326a2b2d9cee509473b1488bf1d0983d6771c105fd374f4e9b836d66f8df4228c7c056b8816d655cd7f8c7f37c86fa736dffe454bb41b6
6
+ metadata.gz: 2cd01e3b4e60bf76c3dfc8f3fa54f37c774a50eeeeaf1661ed31ab4b2af408029b33b5844fc458ae743d0429b5a0b843f00d436ce07b584445030f98c225d833
7
+ data.tar.gz: 357e00ab95e8522d7f6628182ef62c3cdf1e0842f30f42fbd5c30081654abaf109793f12d5578018168b5706a957b8631be1dfc472e33dc3d8f5548305d83606
data/README.md CHANGED
@@ -276,16 +276,12 @@ class ShopController < ApplicationController
276
276
 
277
277
  # You can also add a note to the form field.
278
278
  config.form.item(:text_field, :name).note do
279
- content_tag :p do
280
- out = []
281
- out << 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, '
282
- out << 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
283
- out << tag(:br)
284
- out << 'Ut enim ad minim veniam, quis nostrud exercitation ullamco '
285
- out << 'laboris nisi ut aliquip ex ea commodo consequat. '
286
- out << tag(:br)
287
- safe_join(out)
288
- end
279
+ concat(tag.p do
280
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, '
281
+ end)
282
+ concat(tag.p do
283
+ 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
284
+ end)
289
285
  end
290
286
  end
291
287
  end
@@ -164,4 +164,12 @@
164
164
  border-top-left-radius: 0;
165
165
  border-bottom-left-radius: 0;
166
166
  }
167
+ }
168
+
169
+ .ds-label{
170
+ font-weight: bold;
171
+ }
172
+
173
+ .ds-form .form-group{
174
+ margin-bottom: 1.5rem;
167
175
  }
@@ -1,4 +1,4 @@
1
- <%= form_with method: method, model: @record, url: url, local: true do |form| %>
1
+ <%= form_with method: method, model: @record, url: url, local: true, class: 'ds-form' do |form| %>
2
2
  <%-dynamic_scaffold.form.items.each do |elem|-%>
3
3
  <%= render 'dynamic_scaffold/bootstrap/form/row', form: form, elem: elem, depth: 0 %>
4
4
  <% end %>
@@ -68,11 +68,18 @@ module DynamicScaffold
68
68
  end
69
69
 
70
70
  def render_label(view, depth)
71
+ label_attrs = @label_attributes.dup
72
+ if label_attrs[:class].present?
73
+ label_attrs[:class] = "ds-label #{label_attrs[:class]}"
74
+ else
75
+ label_attrs[:class] = 'ds-label'
76
+ end
77
+
71
78
  if @label_block.present?
72
79
  label = view.instance_exec(
73
80
  proxy_field.label,
74
81
  depth,
75
- @label_attributes,
82
+ label_attrs,
76
83
  &@label_block
77
84
  )
78
85
  return label unless label.nil?
@@ -82,13 +89,13 @@ module DynamicScaffold
82
89
  # label = view.instance_exec(
83
90
  # proxy_field.label,
84
91
  # depth,
85
- # @label_attributes,
92
+ # label_attrs,
86
93
  # &DynamicScaffold.config.form.label
87
94
  # )
88
95
  # return label unless label.nil?
89
96
  # end
90
97
 
91
- view.tag.label(proxy_field.label, @label_attributes)
98
+ view.tag.label(proxy_field.label, label_attrs)
92
99
  end
93
100
 
94
101
  def extract_parameters(permitting)
@@ -1,3 +1,3 @@
1
1
  module DynamicScaffold
2
- VERSION = '1.2.2'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masamoto Miyata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2020-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: classnames-rails-view