zutils 1.1.1 → 2.0.1
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/_index.html.erb +2 -1
- data/app/views/shared/_list.html.erb +12 -6
- data/app/views/shared/_show.html.erb +9 -3
- data/lib/zutils/version.rb +1 -1
- data/zutils.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f4676ffa4289aaa630608de27b2156473f7337c0c850598e3f7bb79fb7397ba
|
4
|
+
data.tar.gz: 7c0294692a429bc75b007bbc845b1deaf88164b1384adcc9667ea33baaf266f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c28a400899038fa78a122d3b14e4d029b2ee139cd603d8448d59c9cd1597abe3d1f1a6b64f7ecdf25f480a9d0acb71f02fb7f2d8508164c8600fcc53918cd2b
|
7
|
+
data.tar.gz: 3f3c5ab944e70a2fa4d287c7e6ab3fe7e75b4789a712956cf994efdfa6076d5e5901a4efbc14f71608c750b1440778c2b9b995f7dd4471dfdfbed408f25b774e
|
@@ -17,6 +17,7 @@
|
|
17
17
|
<% hide_footer ||= false %>
|
18
18
|
|
19
19
|
<% hide_read_action ||= false %>
|
20
|
+
<% hide_new_action ||= false %>
|
20
21
|
<% hide_edit_action ||= false %>
|
21
22
|
<% hide_destroy_action ||= false %>
|
22
23
|
|
@@ -68,7 +69,7 @@
|
|
68
69
|
<% unless hide_links %>
|
69
70
|
<% unless controller_name == 'users' %>
|
70
71
|
<div class="box-footer card-footer">
|
71
|
-
<% if can?
|
72
|
+
<% if !hide_new_action && can?(:new, list.klass) %>
|
72
73
|
<% if nested_resource == true %>
|
73
74
|
<% if parent_resource %>
|
74
75
|
<%= link_to eval("new_#{parent_resource.class.model_name.singular}_#{list.klass.model_name.singular}_path(#{parent_resource.id})"), class: "btn btn-#{box_class}" do %>
|
@@ -39,9 +39,11 @@
|
|
39
39
|
<th data-field="<%= column_method || column_name %>" data-align="<%= column_align %>">
|
40
40
|
<% if sort_all || sort_fields.include?(column_name) %>
|
41
41
|
<% if column_name.include?('.') %>
|
42
|
-
<%
|
43
|
-
|
44
|
-
|
42
|
+
<% mname = column_name.split('.')[-2]&.camelize %>
|
43
|
+
<% cname = column_name.split('.')[-1] %>
|
44
|
+
<% model = Kernel.const_get(mname) %>
|
45
|
+
<%= sort_link(@q, column_name.split('.').join('_'),
|
46
|
+
"#{model.model_name.human} (#{model.human_attribute_name(cname)})")
|
45
47
|
%>
|
46
48
|
<% elsif /_id$/ =~ column_name %>
|
47
49
|
<%= sort_link(@q, column_name, list.klass.human_attribute_name(column_name.split("_id")[0])) %>
|
@@ -92,9 +94,13 @@
|
|
92
94
|
|
93
95
|
<td>
|
94
96
|
<% if column_name.include?('.') %>
|
95
|
-
<%
|
96
|
-
|
97
|
-
|
97
|
+
<% if column_method.nil? %>
|
98
|
+
<% o = object %>
|
99
|
+
<% column_name.split('.').each{|m| o = o.send(m) if o } %>
|
100
|
+
<%= o %>
|
101
|
+
<% else %>
|
102
|
+
<%= object.send(column_method) %>
|
103
|
+
<% end %>
|
98
104
|
<% elsif object.send(column_name).class == Date or
|
99
105
|
object.send(column_name).class == DateTime or
|
100
106
|
object.send(column_name).class == ActiveSupport::TimeWithZone or
|
@@ -34,8 +34,14 @@
|
|
34
34
|
<% end %>
|
35
35
|
<% end %>
|
36
36
|
<% if show_actions.include?('edit') && can?(:edit, object) %>
|
37
|
-
|
38
|
-
|
37
|
+
<% if nested_resource %>
|
38
|
+
<%= link_to eval_with_rescue("edit_#{parent_resource.class.model_name.singular}_#{object.class.model_name.singular}_path(#{parent_resource.id},#{object.id})"), class: "btn btn-#{box_class} btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
|
39
|
+
Editar <i class="fa fa-pencil fa-pen"></i>
|
40
|
+
<% end %>
|
41
|
+
<% else %>
|
42
|
+
<%= link_to eval_with_rescue("edit_#{object.class.model_name.singular}_path(#{object.id})"), class: "btn btn-warning btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
|
43
|
+
Editar <i class="fa fa-pencil fa-pen"></i>
|
44
|
+
<% end %>
|
39
45
|
<% end %>
|
40
46
|
<% end %>
|
41
47
|
<% if show_actions.include?('index') %>
|
@@ -165,7 +171,7 @@
|
|
165
171
|
</table>
|
166
172
|
</div>
|
167
173
|
</div>
|
168
|
-
<% else %>
|
174
|
+
<% else %>
|
169
175
|
<div class="box box-<%= box_class %>">
|
170
176
|
<div class="box-header with-border">
|
171
177
|
<h3 class="box-title">
|
data/lib/zutils/version.rb
CHANGED
data/zutils.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
33
|
spec.require_paths = ["lib"]
|
34
34
|
|
35
|
-
spec.add_dependency 'rails', '
|
35
|
+
spec.add_dependency 'rails', '>= 5.0'
|
36
36
|
|
37
37
|
spec.add_development_dependency "bundler", "~> 1.16"
|
38
38
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Viana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
103
|
+
rubygems_version: 3.3.7
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Utilidades gerais para aplicações rails
|