zutils 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 470a5dc3dbae6d8f2a29ed79358146d9c308ee20803b0d175ebf8565e4e8b5d7
4
- data.tar.gz: f51a15db31ca14343b65317c47856fb4e1a2b641550711eb639ec18761c6253b
3
+ metadata.gz: 7cd591e309504570d20ec1203ef3ef54d53ca7ebbe549622e315dedd015eaf5e
4
+ data.tar.gz: f91124a491c228c0ce34d23c23f088934518ab6207ad0a69e3f7c0d2b8db584c
5
5
  SHA512:
6
- metadata.gz: 3e77f3b10976238ded762d40289bc841a8914573a62c24318112d5fa63108a790b08aa96093dc6c697b337e486ee93c2400a0862edc713835487c33e52ca4a4f
7
- data.tar.gz: 12be1571ae9c6f4aee0b48266571bba77700624ad9ef4f722da7f929f63fa8c22bb3b80dac9ed26f260645b9a6eaf46b38c48d703d665cbfc070d6e533bfe60b
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>
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana