worker-field-nested_has_many 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/assets/stylesheets/administrate-field-nested_has_many/base.scss +1 -1
- data/app/views/fields/nested_has_many/_fields.html.erb +49 -35
- data/app/views/fields/nested_has_many/_form.html.erb +39 -10
- data/worker-field-nested_has_many.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffb44ebe02507d6b83478323398d7a0f14ccb522c25a4a6077ff324e168f204b
|
4
|
+
data.tar.gz: 7cc99761f49cfd385dfa357d2b1db224c36da3c36192637c31a830ee4dfaaa6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -1,46 +1,60 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
9
|
-
|
10
|
-
<%= render_field attribute, f: f %>
|
11
|
-
<% end -%>
|
12
|
-
<% end -%>
|
13
|
+
<% end -%>
|
14
|
+
<% end -%>
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
],
|
25
|
+
remote: :true,
|
26
|
+
:'data-dismiss' => "modal",
|
27
|
+
:'data-toggle' => "modal",
|
28
|
+
:'data-target' => "#exampleModal",
|
29
|
+
# method: :get,
|
30
|
+
) %>
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
60
|
+
<% end %>
|
@@ -1,6 +1,37 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
-
|
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:
|
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
|
-
</
|
27
|
-
|
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.
|
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.
|
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-
|
11
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|