worker-field-nested_has_many 0.1.0 → 0.2.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: 684ca5b27cf9d28d4356549f8e81194d1de2e96e2a222d5a01e1058fc3ad8af6
4
- data.tar.gz: d16141b7192c74d57f3c10e6f93e48c667c2738727ba1888424c620ab8cc49b1
3
+ metadata.gz: ffb44ebe02507d6b83478323398d7a0f14ccb522c25a4a6077ff324e168f204b
4
+ data.tar.gz: 7cc99761f49cfd385dfa357d2b1db224c36da3c36192637c31a830ee4dfaaa6d
5
5
  SHA512:
6
- metadata.gz: '08514a214257b5c70a140be6d46ed5335c96efc5729b6d81a71f69374aab5e05781f0a83df49985cce93cb600658a785b9c90285a4aa86d2a7b663348e396145'
7
- data.tar.gz: 4d44b7515dbb46ffe3c1084063c465bd79df75d34079331df34fd316c7d77432cff383ab6d93ccd5ed822205ffdc74d0725f77600b151166582ad8e670c082de
6
+ metadata.gz: 97dfcdc57a0405e843f9259e6382f928e2dda035c09d8b27a4844b6fa52623a4c2978f9a5fc0ca5747e8a64f3d2497515dd9c57ab1b87027a8acbce8c9bbe2ad
7
+ data.tar.gz: 99d305d7296bd4f423e1247006094c535e94323abb2e080f90cb79e1228fc405e30691aea3f3ab81fb9fb5fc70664b6c525269c06f662363a40d7d805c9181f5
data/README.md CHANGED
@@ -11,7 +11,15 @@ https://github.com/nickcharlton/administrate-field-nested_has_many
11
11
  gem "administrate-field-nested_has_many"
12
12
  ```
13
13
 
14
+
15
+
14
16
  # Thanks
15
17
 
16
18
  A huge thank you to all the person who work on the original one.
17
19
  A huge thank you to Nick Charlton & Grayson Wright !!
20
+
21
+ # you are beginner with Gem ?
22
+
23
+ here some links...
24
+ => create a gem https://goo.gl/kSkKvq
25
+ => and when you want to update it https://goo.gl/UoAsJg
@@ -40,7 +40,7 @@
40
40
  flex-direction: column;
41
41
  justify-content: space-between;
42
42
  min-height: 300px;
43
- .bibibibib{
43
+ .working_zone_container, .line_item_container{
44
44
  .field-unit__label {
45
45
  width: calc(15% - 1rem);
46
46
  }
@@ -1,46 +1,60 @@
1
1
 
2
- <div class="nested-fields <%= field.attribute %>">
3
- <div class="bibibibib">
4
- <% field.nested_fields_for_builder(f).each do |attribute| -%>
5
- <% if attribute.html_class.to_s != "boolean"%>
6
- <div class="field-unit field-unit--<%= attribute.html_class %>">
2
+
3
+ <% if request.env["PATH_INFO"] == "/admin/quotations/new" %>
4
+ <div class="nested-fields <%= field.attribute %>"><%# #todo %>
5
+ <div class="<%= field.attribute.to_s.singularize %>_container <%= field.attribute %>"><%# #todo %>
6
+ <% field.nested_fields_for_builder(f).each do |attribute| -%>
7
+ <% if attribute.html_class.to_s != "boolean"%>
8
+ <div class="field-unit field-unit--<%= attribute.html_class %>">
9
+ <%= render_field attribute, f: f %>
10
+ </div>
11
+ <% else %>
7
12
  <%= render_field attribute, f: f %>
8
- </div>
9
- <% else %>
10
- <%= render_field attribute, f: f %>
11
- <% end -%>
12
- <% end -%>
13
+ <% end -%>
14
+ <% end -%>
13
15
 
14
- </div>
15
- <!-- <div class="button remove-field button remove-field__option_buton">
16
- <%#= link_to(
17
- t("add option"),
18
- [:showproductoption,
16
+ </div>
17
+ <!-- <div class="button remove-field button remove-field__option_buton">
18
+ <%#= link_to(
19
+ t("add option"),
20
+ [:showproductoption,
19
21
  # order_number: "toto",
20
22
  # quotation_id: "#{page.resource.id}",
21
23
  # user_id: "#{page.resource.user_id}"
22
- ],
23
- remote: :true,
24
- :'data-dismiss' => "modal",
25
- :'data-toggle' => "modal",
26
- :'data-target' => "#exampleModal",
27
- # method: :get,
28
- ) %>
24
+ ],
25
+ remote: :true,
26
+ :'data-dismiss' => "modal",
27
+ :'data-toggle' => "modal",
28
+ :'data-target' => "#exampleModal",
29
+ # method: :get,
30
+ ) %>
29
31
 
30
- </div> -->
31
- <!-- <div class="button remove-field button remove-field__option_buton" >
32
- <%#= link_to showproductoption_path, remote: true,:'data-dismiss' =>'modal', :'data-toggle' => 'modal', :'data-target' => '#exampleModal' do%>
33
- <div class="specialite">réseau</div>
32
+ </div> -->
33
+ <!-- <div class="button remove-field button remove-field__option_buton" >
34
+ <%#= link_to showproductoption_path, remote: true,:'data-dismiss' =>'modal', :'data-toggle' => 'modal', :'data-target' => '#exampleModal' do%>
35
+ <div class="specialite">réseau</div>
34
36
  <%# end %>
35
- </div> -->
36
- <% if field.attribute.to_s == "line_items"%>
37
- <div class="button remove-field button remove-field__option_buton executer-button" >
38
- <div class="specialite">Ajouter des options</div>
37
+ </div> -->
38
+ <% if field.attribute.to_s == "line_items"%>
39
+ <div class="button remove-field remove-field__option_buton executer-button disabled" >
40
+ <span>Ajouter des options</span>
41
+ <!-- <div class="specialite">Ajouter des options</div> -->
42
+ </div>
43
+ <% end %>
44
+ <!-- <a href='#' id='executer-button' class='btn btn-default'>Executer</a> -->
45
+ <div class="button remove-field">
46
+ <%= link_to_remove_association I18n.t("administrate.fields.nested_has_many.remove", resource: field.associated_class_name.titleize), f %>
47
+
48
+ </div>
39
49
  </div>
40
- <% end %>
41
- <!-- <a href='#' id='executer-button' class='btn btn-default'>Executer</a> -->
42
- <div class="button remove-field">
43
- <%= link_to_remove_association I18n.t("administrate.fields.nested_has_many.remove", resource: field.associated_class_name.titleize), f %>
50
+ <% else %>
51
+ <div class="nested-fields">
52
+ <% field.nested_fields_for_builder(f).each do |attribute| -%>
53
+ <div class="field-unit field-unit--<%= attribute.html_class %>">
54
+ <%= render_field attribute, f: f %>
55
+ </div>
56
+ <% end -%>
44
57
 
58
+ <%= link_to_remove_association I18n.t("administrate.fields.nested_has_many.remove", resource: field.associated_class_name.titleize), f %>
45
59
  </div>
46
- </div>
60
+ <% end %>
@@ -1,6 +1,37 @@
1
- <fieldset class="field-unit--nested <%= field.attribute %>">
2
- <div class="container-flex">
3
- <!-- <legend><%= f.label field.attribute %></legend> -->
1
+
2
+ <% if request.env["PATH_INFO"] == "/admin/quotations/new" %>
3
+
4
+ <fieldset class="field-unit--nested fieldset_<%= field.attribute %>">
5
+ <div class="container-flex">
6
+ <!-- <legend><%= f.label field.attribute %></legend> -->
7
+ <%= f.fields_for field.association_name do |nested_form| %>
8
+ <%= render(
9
+ partial: "fields/nested_has_many/fields",
10
+ locals: {
11
+ f: nested_form,
12
+ field: field,
13
+ },
14
+ ) %>
15
+ <% end %>
16
+ <div class = "add_has_many">
17
+ <%= link_to_add_association(
18
+ I18n.t("administrate.fields.nested_has_many.add", resource: field.associated_class_name.titleize),
19
+ f,
20
+ field.association_name,
21
+ class: "button toto button_add_associated_#{field.associated_class_name}",
22
+ # class: "button toto button_add_associated_#{field.associated_class_name}",
23
+ # # id usefull for the JS inside New quotation
24
+ # id: "button_add_associated_#{field.associated_class_name}",
25
+ partial: "fields/nested_has_many/fields",
26
+ render_options: { locals: { field: field } },
27
+ ) %>
28
+ </div>
29
+ </div>
30
+ </fieldset>
31
+
32
+ <% else %>
33
+ <fieldset class="field-unit--nested">
34
+ <legend><%= f.label field.attribute %></legend>
4
35
  <%= f.fields_for field.association_name do |nested_form| %>
5
36
  <%= render(
6
37
  partial: "fields/nested_has_many/fields",
@@ -10,18 +41,16 @@
10
41
  },
11
42
  ) %>
12
43
  <% end %>
13
- <div class = "add_has_many">
44
+
45
+ <div>
14
46
  <%= link_to_add_association(
15
47
  I18n.t("administrate.fields.nested_has_many.add", resource: field.associated_class_name.titleize),
16
48
  f,
17
49
  field.association_name,
18
- class: "button toto button_add_associated_#{field.associated_class_name}",
19
- # class: "button toto button_add_associated_#{field.associated_class_name}",
20
- # # id usefull for the JS inside New quotation
21
- # id: "button_add_associated_#{field.associated_class_name}",
50
+ class: 'button',
22
51
  partial: "fields/nested_has_many/fields",
23
52
  render_options: { locals: { field: field } },
24
53
  ) %>
25
54
  </div>
26
- </div>
27
- </fieldset>
55
+ </fieldset>
56
+ <% end %>
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "worker-field-nested_has_many"
5
5
  # gem.version = Worker::Field::NestedHasMany::VERSION
6
- gem.version = "0.1.0"
6
+ gem.version = "0.2.0"
7
7
  gem.authors = ["v baxter"]
8
8
  gem.email = ["vincent.viricel@gmail.com"]
9
9
 
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
22
22
  gem.add_development_dependency 'rake', '~> 10.0'
23
23
  gem.add_development_dependency 'rspec', '~> 3.4'
24
24
  gem.add_development_dependency 'i18n-tasks', '~> 0.9.28'
25
-
25
+
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worker-field-nested_has_many
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - v baxter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-28 00:00:00.000000000 Z
11
+ date: 2019-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate