zutils 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/shared/_form.html.erb +9 -6
- data/lib/zutils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd591e309504570d20ec1203ef3ef54d53ca7ebbe549622e315dedd015eaf5e
|
4
|
+
data.tar.gz: f91124a491c228c0ce34d23c23f088934518ab6207ad0a69e3f7c0d2b8db584c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39facea00887ddd807209c1a82383ecab26572e794f9fc0e922ad28edc6857b6619b0bc0741d341e13c63084b3d87d26a1e61c3ea849c0823480165444558cd7
|
7
|
+
data.tar.gz: f5b3b3a380964d2963292bd0d6c9d951a2cf0c22b5dc0f62c71c7abf780955cfcccec30dd30476173b749640a0c65d95c5c320b4ed3bb996a75a3b341f0246c3
|
@@ -24,23 +24,26 @@
|
|
24
24
|
<div class="box-body">
|
25
25
|
<div class="row">
|
26
26
|
<% (form_ordered_fields - ['id', 'created_at', 'updated_at', 'deleted_at'] - excluded_columns).each do |column| %>
|
27
|
-
<% wphtml = "col-md-#{form_fields[column.to_sym] || 12}" %>
|
27
|
+
<% wphtml = "col-md-#{(form_fields[column.to_sym].class == Hash ? form_fields[column.to_sym][:size] : form_fields[column.to_sym] ) || 12}" %>
|
28
|
+
<% hint = (form_fields[column.to_sym].class == Hash ? form_fields[column.to_sym][:hint] : '') %>
|
29
|
+
<% placeholder = (form_fields[column.to_sym].class == Hash ? form_fields[column.to_sym][:placeholder] : '') %>
|
28
30
|
<% if object.class.column_for_attribute(column).type == :text %>
|
29
|
-
<%= f.input column, input_html: { rows: 10, cols: 20 }, wrapper_html: { class: wphtml } %>
|
31
|
+
<%= f.input column, input_html: { rows: 10, cols: 20 }, wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
|
30
32
|
<% elsif [:date, :datetime].include?(object.class.column_for_attribute(column).type) %>
|
31
|
-
<%= f.input column, html5: true, wrapper_html: { class: wphtml } %>
|
33
|
+
<%= f.input column, html5: true, wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
|
32
34
|
<% elsif /_id$/ =~ column && object.respond_to?(column.split('_id')[0]) %>
|
33
35
|
<% if restricted_columns.keys.include?(column.to_sym) %>
|
34
36
|
<%= f.association column.split("_id")[0],
|
35
37
|
label: restricted_columns[column.to_sym][:label],
|
36
38
|
collection: restricted_columns[column.to_sym][:collection],
|
37
|
-
wrapper_html: { class: wphtml }
|
39
|
+
wrapper_html: { class: wphtml },
|
40
|
+
hint: hint, placeholder: placeholder
|
38
41
|
%>
|
39
42
|
<% else %>
|
40
|
-
<%= f.association column.split("_id")[0], wrapper_html: { class: wphtml } %>
|
43
|
+
<%= f.association column.split("_id")[0], wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
|
41
44
|
<% end %>
|
42
45
|
<% else %>
|
43
|
-
<%= f.input column, wrapper_html: { class: wphtml } %>
|
46
|
+
<%= f.input column, wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
|
44
47
|
<% end %>
|
45
48
|
<% end %>
|
46
49
|
</div>
|
data/lib/zutils/version.rb
CHANGED