kono_utils_bootstrap_view4 0.1.2 → 0.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: d44de3f9d7df14eb1afe8cb5f2390f9ac2ac42ad3baaea68e99e3be3278c9a54
4
- data.tar.gz: 4bc4fcc67bd4ebde637e0e554762b25a493d8933b3cfc5aa48c698adb15bfc84
3
+ metadata.gz: f7ca729271063a5d64a3e7cfdbbb0095a05360786f7d31047bfb7e88d164f4db
4
+ data.tar.gz: 6aa833e452752195fb3bb74e360fe615e2d8aa396f039f3057fc6c13a7dcea0b
5
5
  SHA512:
6
- metadata.gz: b7e459e9bf577f3928ec0680c9a451dbba9a04247f4c076872f8557ef92bacd672a0e121fe3c0809d352db9468bc72a24b82a490457adbab7708677a3a37fea8
7
- data.tar.gz: 7406b7b710a1971c99c543280fc574f299c18fc530b22069e76d18f9110692cf8a6e7fb86a4305f9afa638eaa09c64d44db4ee2157a3dc5da027846429aec82d
6
+ metadata.gz: 13ae8eed2972563231f7bb70a656f716370a3101041883e17b3d6385c9d1356d83fc91f9dfcd1735c915e17f2c95a2a1ff232994bfaa472ad3e3199a3af1e8b4
7
+ data.tar.gz: 6a65665f415d3a3713265ee44c3217765e48a1040bd152e190478f646e397c0d35b2dd4c5fe9fc5deb69952355f8971f39997ff719c0d9fda7529450cd52ff28
@@ -24,6 +24,13 @@ module KonoUtils
24
24
  [model, _form_options]
25
25
  end
26
26
 
27
+ ##
28
+ # Elenco di concept di bottoni da generare nella form per il submit
29
+ # @param [SimpleForm::FormBuilder] form_builder
30
+ def submit_buttons(form_builder:)
31
+ [concept("cell/forms/submit", nil, context: {form: form_builder})]
32
+ end
33
+
27
34
  protected
28
35
 
29
36
  def form_id
@@ -5,6 +5,7 @@ module KonoUtils
5
5
  # ha sempre un metodo form che viene ricevuto dal contesto della form
6
6
  class Forms::Base < Base
7
7
 
8
+ # @return [SimpleForm::FormBuilder]
8
9
  def form
9
10
  context[:form]
10
11
  end
@@ -11,6 +11,12 @@ module KonoUtils
11
11
  :search_buttons_container
12
12
  end
13
13
 
14
+ # @param [SimpleForm::FormBuilder] form_builder
15
+ # @return [Array<Concept>]
16
+ def submit_buttons(form_builder:)
17
+ super + [concept("cell/buttons/reset_search", model.search_form_builder.to_model)]
18
+ end
19
+
14
20
  end
15
21
  end
16
22
  end
@@ -1,9 +1,11 @@
1
1
  <%= simple_form_for(*forms_options) do |f| %>
2
2
 
3
- <%= concept("cell/forms/container", model, context: {form: f}, layout: container_layout) %>
3
+ <%= concept("cell/forms/container", model, context: { form: f }, layout: container_layout) %>
4
4
 
5
5
  <%= hidden_field_tag "kono_utils[form_id]", form_id %>
6
6
 
7
- <%= concept("cell/forms/submit", nil, context: {form: f}) %>
7
+ <% submit_buttons(form_builder:f).each do |btn| %>
8
+ <%= btn %>
9
+ <% end %>
8
10
 
9
11
  <% end %>
@@ -7,8 +7,9 @@
7
7
  <div class="row">
8
8
  <div class="col-md">
9
9
  <div class="float-right">
10
- <%= concept("cell/forms/submit", nil, context: {form: f}) %>
11
- <%= concept("cell/buttons/reset_search", model.search_form_builder.to_model) %>
10
+ <% submit_buttons(form_builder:f).each do |btn| %>
11
+ <%= btn %>
12
+ <% end %>
12
13
  </div>
13
14
  </div>
14
15
  </div>
@@ -1,3 +1,3 @@
1
1
  module KonoUtilsBootstrapView4
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kono_utils_bootstrap_view4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails