worker-field-nested_has_many 0.6.0 → 0.7.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/app/assets/stylesheets/administrate-field-nested_has_many/base.scss +58 -9
- data/app/views/fields/nested_has_many/_ajax_price_product.erb +26 -0
- data/app/views/fields/nested_has_many/_ajax_price_quotation.erb +0 -0
- data/app/views/fields/nested_has_many/_fields.html.erb +41 -11
- data/app/views/fields/nested_has_many/_form.html.erb +3 -3
- data/worker-field-nested_has_many.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c65acdb893002363334f1f12b85532aaddd62bfeb74dd7fd7c6e38b5a9707689
|
4
|
+
data.tar.gz: 9514cc4b955c8fa134d0871bb51ad628430555cc3acbf54686fdad6f3860cb02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2aabb18bcb07c3b1a3813ee985a877e2890b106f623066b67578aecbbd3141b61a398e540e06a3636ec264e82fccec4725ddfca58f7f38fd39b003c612d15e0
|
7
|
+
data.tar.gz: de3004f519cd7a587673f48d135fba4d733f4a527b3b4e7409f3c05c221edd7c120962d6b23fe2dd486d0cad55093f968afec15a19b750edc79d3c991526517c
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
.add_has_many.div_button_add_line_items{
|
17
17
|
position: absolute;
|
18
|
-
bottom: -
|
18
|
+
bottom: -70px;
|
19
19
|
}
|
20
20
|
.add_has_many.div_button_add_working_zones{
|
21
21
|
position: absolute;
|
@@ -23,9 +23,9 @@
|
|
23
23
|
left: -30px;
|
24
24
|
}
|
25
25
|
div#button_remove_associated_WorkingZone {
|
26
|
-
position:
|
27
|
-
bottom:
|
28
|
-
left:
|
26
|
+
position: relative;
|
27
|
+
bottom: -144px;
|
28
|
+
left: 70px;
|
29
29
|
}
|
30
30
|
|
31
31
|
.field-unit--nested{
|
@@ -50,25 +50,67 @@ div#button_remove_associated_WorkingZone {
|
|
50
50
|
.nested-fields {
|
51
51
|
@include administrate-clearfix;
|
52
52
|
width: 43%;
|
53
|
-
border: 1px solid #a8a8a83d;
|
54
|
-
border-radius:
|
53
|
+
// border: 1px solid #a8a8a83d;
|
54
|
+
border-radius: 10px;
|
55
55
|
margin: 1rem;
|
56
56
|
padding: 1rem 1rem 1rem 1rem;
|
57
57
|
display: flex;
|
58
58
|
flex-direction: column;
|
59
|
-
|
59
|
+
// WTF TODO:
|
60
|
+
// justify-content: space-between;
|
60
61
|
min-height: 300px;
|
61
62
|
.working_zone_container, .line_item_container{
|
62
63
|
.field-unit__label {
|
63
64
|
width: calc(15% - 1rem);
|
64
65
|
}
|
65
66
|
}
|
67
|
+
|
68
|
+
// $grid-breakpoints: (
|
69
|
+
// // Extra small screen / phone
|
70
|
+
// xs: 0,
|
71
|
+
// // Small screen / phone
|
72
|
+
// sm: 576px,
|
73
|
+
// // Medium screen / tablet
|
74
|
+
// md: 768px,
|
75
|
+
// // Large screen / desktop
|
76
|
+
// lg: 992px,
|
77
|
+
// // Extra large screen / wide desktop
|
78
|
+
// xl: 1200px,
|
79
|
+
// // very Extra large screen / wide desktop Imac / TV
|
80
|
+
// xxl: 1801px
|
81
|
+
// );
|
82
|
+
//
|
83
|
+
// @include media-breakpoint-down(sm) {
|
84
|
+
// width: 46%;
|
85
|
+
// }
|
86
|
+
// @include media-breakpoint-down(xs) {
|
87
|
+
// width: 100%;
|
88
|
+
// }
|
66
89
|
&.line_items{
|
67
90
|
position: relative;
|
68
|
-
min-height:
|
91
|
+
min-height: 550px;
|
69
92
|
padding: 0.7rem;
|
70
93
|
margin: 0.2rem 0.5rem;
|
71
|
-
width:
|
94
|
+
width: 100%;
|
95
|
+
// margin-left:1rem;
|
96
|
+
// box-shadow: 0 0px 20px rgba(0, 0, 0, 0.06), 0 0px 13px rgba(0,1,0,0.06);
|
97
|
+
box-shadow: 0 12px 40px -12px rgba(56, 40, 77, 0.3), 0px -10px 40px -12px rgba(56,40,77,.3);
|
98
|
+
border-radius: 10px;
|
99
|
+
border: 0px;
|
100
|
+
// @media only screen and (min-width: 576px) {
|
101
|
+
// width: 46%;
|
102
|
+
// }
|
103
|
+
// @media only screen and (min-width: 576px) {
|
104
|
+
// width: 46%;
|
105
|
+
// }
|
106
|
+
@media only screen and (min-width: 992px) {
|
107
|
+
width: 46%;
|
108
|
+
margin-left: 1.6rem;
|
109
|
+
}
|
110
|
+
@media only screen and (min-width: 1801px) {
|
111
|
+
width: 30%;
|
112
|
+
margin-left: 1.6rem;
|
113
|
+
}
|
72
114
|
}
|
73
115
|
}
|
74
116
|
|
@@ -80,3 +122,10 @@ div#button_remove_associated_WorkingZone {
|
|
80
122
|
.executer-button{
|
81
123
|
display: none;
|
82
124
|
}
|
125
|
+
|
126
|
+
// set backgroud for working zone
|
127
|
+
.nested-fields.working_zones {
|
128
|
+
background-color: #fdfdfd;
|
129
|
+
box-shadow: 0 12px 40px -12px rgba(56,40,77,.3);
|
130
|
+
// box-shadow: 0 0px 20px rgba(0, 0, 0, 0.06), 0 0px 13px rgba(0, 1, 0, 0.06);
|
131
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div class="field-unit ajax_price_div mt-0 mb-0" style="min-height:36px;width: 70%;margin-left: 25%;margin-right: 5%;">
|
2
|
+
<div class="field-unit__field d-flex justify-content-end align-items-center" style="width:100%!important;margin-left: 0rem !important;width:100%!important;margin-left: 0rem !important;min-height:68px">
|
3
|
+
<div class="d-flex flex-column">
|
4
|
+
<div class="btn btn-warning btn-sm d-flex hidden" style="font-weight: 600;opacity: 1;font-size: 12px;">
|
5
|
+
<span class="ajax_db_price_span" style="text-decoration: line-through">123 </span>
|
6
|
+
<span class="ml-1" style="text-decoration: line-through"> € / unit</span>
|
7
|
+
</div>
|
8
|
+
<div class="btn btn-rework btn-sm d-flex hidden" style="font-weight: 600;opacity: 1;font-size: 12px;">
|
9
|
+
<span class="ajax_price_per_unit_span"></span>
|
10
|
+
<span class="ml-1"> € / unit</span>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<div class="d-flex flex-column">
|
14
|
+
<div class="btn btn-rework btn-sm d-flex hidden" style="font-weight: 600;opacity: 1;font-size: 12px;">
|
15
|
+
<span class="mr-2">Total</span>
|
16
|
+
<span class="ajax_price_span"></span>
|
17
|
+
</div>
|
18
|
+
<div class="btn btn-rework btn-sm d-flex hidden" style="font-weight: 600;opacity: 1;font-size: 12px;">
|
19
|
+
<span class="ajax_price_pro_discount_span"></span>
|
20
|
+
<span class="mr-2">%</span>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
</div>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
</div>
|
File without changes
|
@@ -1,11 +1,21 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
<% if request.env["PATH_INFO"] == "/admin/quotations/new" || "/admin/quotations" %>
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
<div class="nested-fields <%= field.attribute %>" >
|
6
|
+
|
7
|
+
<!-- to display price through Ajax -->
|
8
|
+
<% if field.attribute.to_s == "line_items"%>
|
9
|
+
<%= render(
|
10
|
+
partial: "fields/nested_has_many/ajax_price_product"
|
11
|
+
) %>
|
12
|
+
<%end %>
|
13
|
+
<!-- end to display price through Ajax -->
|
14
|
+
|
15
|
+
<div class="<%= field.attribute.to_s.singularize %>_container <%= field.attribute %> pt-3">
|
6
16
|
<% field.nested_fields_for_builder(f).each do |attribute| -%>
|
7
17
|
<% if attribute.html_class.to_s != "boolean"%>
|
8
|
-
<div class="field-unit field-unit--<%= attribute.html_class %>">
|
18
|
+
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit__<%= attribute.name %>">
|
9
19
|
<%= render_field attribute, f: f %>
|
10
20
|
</div>
|
11
21
|
<% else %>
|
@@ -14,24 +24,44 @@
|
|
14
24
|
<% end -%>
|
15
25
|
|
16
26
|
</div>
|
27
|
+
|
17
28
|
<div class="lineItem_button_action">
|
29
|
+
|
18
30
|
<div class="sophieTolouba_<%= field.attribute.to_s %>">
|
31
|
+
|
32
|
+
|
19
33
|
<% if field.attribute.to_s == "line_items"%>
|
34
|
+
|
20
35
|
<div class="button remove-field__option_buton executer-button" >
|
21
36
|
<span>Ajouter des options</span>
|
22
37
|
</div>
|
38
|
+
|
23
39
|
<% end %>
|
24
|
-
<div class="btn-warning button remove-field remove_field_<%= field.attribute %>" id= "button_remove_associated_<%=field.associated_class_name%>">
|
25
|
-
<% if field.attribute.to_s == "working_zones"%>
|
26
|
-
<%= link_to_remove_association ('remove''<i class="ml-3 tim-icons icon-settings"></i>').html_safe, f %>
|
27
|
-
<% end %>
|
28
|
-
<% if field.attribute.to_s == "line_items"%>
|
29
|
-
<%= link_to_remove_association ('remove''<i class="ml-3 tim-icons icon-app"></i>').html_safe, f %>
|
30
|
-
<% end %>
|
31
40
|
|
32
|
-
|
41
|
+
|
42
|
+
<% if field.attribute.to_s == "working_zones"%>
|
43
|
+
|
44
|
+
<div class="btn-warning button remove-field remove_field_<%= field.attribute %>" id= "button_remove_associated_<%=field.associated_class_name%>">
|
45
|
+
|
46
|
+
<%= link_to_remove_association ('<i style="font-weight: 800;" class="mr-3 tim-icons icon-simple-delete"></i>''zone').html_safe, f %>
|
47
|
+
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<% end %>
|
51
|
+
|
52
|
+
|
53
|
+
<% if field.attribute.to_s == "line_items"%>
|
54
|
+
|
55
|
+
<div class="btn-warning button btn-simple btn-simple remove_field_<%= field.attribute %> remove_current_line_item" id= "button_remove_associated_<%=field.associated_class_name%>">
|
56
|
+
|
57
|
+
<%= link_to_remove_association ('<i style="font-weight: 800;" class="mr-3 tim-icons icon-simple-delete"></i>''produit').html_safe, f %>
|
58
|
+
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<% end %>
|
33
62
|
|
34
63
|
</div>
|
64
|
+
|
35
65
|
</div>
|
36
66
|
</div>
|
37
67
|
<% else %>
|
@@ -16,10 +16,10 @@
|
|
16
16
|
<div class = "add_has_many div_button_add_<%= field.attribute %>">
|
17
17
|
<% if field.attribute.to_s == "line_items"%>
|
18
18
|
<%= link_to_add_association(
|
19
|
-
('
|
19
|
+
('<i style="font-weight: 800;" class="mr-3 tim-icons icon-simple-add"></i>''produit').html_safe,
|
20
20
|
f,
|
21
21
|
field.association_name,
|
22
|
-
class: "button btn-rework button_add_associated_#{field.associated_class_name}",
|
22
|
+
class: "button btn-rework btn-simple button_add_associated_#{field.associated_class_name}",
|
23
23
|
# class: "button button_add_associated_#{field.associated_class_name}",
|
24
24
|
# # id usefull for the JS inside New quotation
|
25
25
|
# id: "button_add_associated_#{field.associated_class_name}",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<% end %>
|
30
30
|
<% if field.attribute.to_s == "working_zones"%>
|
31
31
|
<%= link_to_add_association(
|
32
|
-
('
|
32
|
+
('<i style="font-weight: 800;" class="mr-3 tim-icons icon-simple-add"></i>''zone').html_safe,
|
33
33
|
f,
|
34
34
|
field.association_name,
|
35
35
|
class: "btn-rework button button_add_associated_#{field.associated_class_name}",
|
@@ -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.7.0"
|
7
7
|
gem.authors = ["v baxter"]
|
8
8
|
gem.email = ["vincent.viricel@gmail.com"]
|
9
9
|
|
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.7.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-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|
@@ -108,6 +108,8 @@ files:
|
|
108
108
|
- app/assets/javascripts/administrate-field-nested_has_many/application.js
|
109
109
|
- app/assets/stylesheets/administrate-field-nested_has_many/application.css
|
110
110
|
- app/assets/stylesheets/administrate-field-nested_has_many/base.scss
|
111
|
+
- app/views/fields/nested_has_many/_ajax_price_product.erb
|
112
|
+
- app/views/fields/nested_has_many/_ajax_price_quotation.erb
|
111
113
|
- app/views/fields/nested_has_many/_fields.html.erb
|
112
114
|
- app/views/fields/nested_has_many/_form.html.erb
|
113
115
|
- app/views/fields/nested_has_many/_index.html.erb
|