zutils 0.1.2 → 0.1.3
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/views/shared/_form.html.erb +2 -2
- data/app/views/shared/_index.html.erb +3 -3
- data/app/views/shared/_show.html.erb +29 -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: 54a91acee1737d98173875c8a52aea2427ba8d02fab7cbc86d9d6afcb125ddab
|
4
|
+
data.tar.gz: 0b075a541cfc30e88473ce2c349704fb2624ab30a2dc9a314cf0172bc0b8ff7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09a8297d560a01f474369b7b1733803def3f4e8c8b548f3213f15d58ec5a039c092f17c2a47d616996f71902256c773bf14b6ba27b742048c4495d622dc3499e'
|
7
|
+
data.tar.gz: 8006f6d324b2592edd8f3927b057ad6c5a3410f1c07a74eae072919d9d18286d717ee2033b397ed2e496a964d2c78b559319fb7f2fd71da42b77b413a35906dd
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<% else %>
|
19
19
|
<%= link_to 'Cancelar', eval_with_rescue("#{controller_name}_path"), class: "btn btn-default btn-xs" %>
|
20
20
|
<% end %>
|
21
|
-
<%= f.submit 'Salvar', class:
|
21
|
+
<%= f.submit 'Salvar', class: "btn btn-#{box_class} btn-xs" %>
|
22
22
|
</h3>
|
23
23
|
</div>
|
24
24
|
<div class="box-body">
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<% end %>
|
57
57
|
<% end %>
|
58
58
|
|
59
|
-
<%= f.submit class: "btn btn
|
59
|
+
<%= f.submit class: "btn btn-#{box_class}" %>
|
60
60
|
</div>
|
61
61
|
</div>
|
62
62
|
<% end %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<%= f.input sf[:field], label: sf[:label], required: false, as: sf[:as], collection: sf[:collection], wrapper_html: { class: 'col-md-3' } %>
|
20
20
|
<% end %>
|
21
21
|
<div class="col-md-3 top-25">
|
22
|
-
<%= f.submit "Pesquisar", class:
|
22
|
+
<%= f.submit "Pesquisar", class: "btn btn-#{box_class}" %>
|
23
23
|
</div>
|
24
24
|
<% end %>
|
25
25
|
</div>
|
@@ -54,12 +54,12 @@
|
|
54
54
|
<% if can? :new, controller_name.singularize %>
|
55
55
|
<% if nested_resource == true %>
|
56
56
|
<% if parent_resource %>
|
57
|
-
<%= link_to eval("new_#{parent_resource}_#{controller_name.singularize}_path"), class: "btn btn
|
57
|
+
<%= link_to eval("new_#{parent_resource}_#{controller_name.singularize}_path"), class: "btn btn-<%= box_class %>" do %>
|
58
58
|
<%= t('.new', default: t("helpers.links.new")) %> <%= Kernel.const_get(controller_name.singularize.camelize).model_name.human %> <i class='fa fa-plus'></i>
|
59
59
|
<% end %>
|
60
60
|
<% end %>
|
61
61
|
<% else %>
|
62
|
-
<%= link_to eval("new_#{controller_name.singularize}_path"), class: "btn btn
|
62
|
+
<%= link_to eval("new_#{controller_name.singularize}_path"), class: "btn btn-#{box_class}" do %>
|
63
63
|
<%= t('.new', default: t("helpers.links.new")) %> <%= Kernel.const_get(controller_name.singularize.camelize).model_name.human %> <i class='fa fa-plus'></i>
|
64
64
|
<% end %>
|
65
65
|
<% end %>
|
@@ -21,7 +21,13 @@
|
|
21
21
|
<table class="table table-bordered table-striped no-padding datatables">
|
22
22
|
<% (object.class.column_names - ['id', 'created_at', 'updated_at', 'deleted_at'] - excluded_columns).each do |column| %>
|
23
23
|
<tr>
|
24
|
-
<th width='15%'
|
24
|
+
<th width='15%'>
|
25
|
+
<% if /_id$/ =~ column && object.respond_to?(column.split('_id')[0]) %>
|
26
|
+
<%= object.class.human_attribute_name(column.split("_id")[0]) %>
|
27
|
+
<% else %>
|
28
|
+
<%= object.class.human_attribute_name(column) %>
|
29
|
+
<% end %>
|
30
|
+
</th>
|
25
31
|
<td>
|
26
32
|
<% if object.send(column).class == Date or
|
27
33
|
object.send(column).class == DateTime or
|
@@ -48,7 +54,13 @@
|
|
48
54
|
<thead>
|
49
55
|
<tr>
|
50
56
|
<% value.each do |v| %>
|
51
|
-
<th
|
57
|
+
<th>
|
58
|
+
<% if /_id$/ =~ v && Kernel.const_get(key.to_s.singularize.camelize).new.respond_to?(v.split('_id')[0]) %>
|
59
|
+
<%= Kernel.const_get(key.to_s.singularize.camelize).human_attribute_name(v.split('_id')[0]) %>
|
60
|
+
<% else %>
|
61
|
+
<%= Kernel.const_get(key.to_s.singularize.camelize).human_attribute_name(v) %>
|
62
|
+
<% end %>
|
63
|
+
</th>
|
52
64
|
<% end %>
|
53
65
|
</tr>
|
54
66
|
</thead>
|
@@ -56,10 +68,21 @@
|
|
56
68
|
<% object.send(key.to_s).each do |r| %>
|
57
69
|
<tr>
|
58
70
|
<% value.each do |v| %>
|
59
|
-
<td
|
60
|
-
|
61
|
-
|
62
|
-
|
71
|
+
<td>
|
72
|
+
<% if r.send(v).class == Date or
|
73
|
+
r.send(v).class == DateTime or
|
74
|
+
r.send(v).class == ActiveSupport::TimeWithZone or
|
75
|
+
r.send(v).class == Time %>
|
76
|
+
<%=l r.send(v) %>
|
77
|
+
<% elsif /_id$/ =~ v && r.respond_to?(v.split('_id')[0]) %>
|
78
|
+
<%= r.send(v.split("_id")[0]).name %>
|
79
|
+
<% else %>
|
80
|
+
<%= r.send(v) %>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
83
|
+
</td>
|
84
|
+
<% end %>
|
85
|
+
</tr>
|
63
86
|
</tbody>
|
64
87
|
</table>
|
65
88
|
<% end %>
|
data/lib/zutils/version.rb
CHANGED