zutils 2.0.1 → 2.0.2
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/_card_list.html.erb +13 -3
- data/app/views/shared/_list.html.erb +17 -11
- data/lib/zutils/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9f08d16a30e1bc4d207f8fab3684db3361982f4fd3d72d0e75137209acc0920
|
4
|
+
data.tar.gz: e837c4f229fb3cdcc6f06bc9ff8813a3b3f50976ae123c1d923189752d16b50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42bbfdda57f9482337cf52f3c314cfb03d057e54f05f26a8af35056ea4ac473357c18d16400b9a70db350dbfb4ad834fbf470ddff2be5d75a9fc702cf2d14478
|
7
|
+
data.tar.gz: 94cfe6535b4e3e9a180c4f6ef1ba943a936c3115ce9209d22c17ee1ba1538bbcaf6dbb55693b18e7e152cc441c159837e328d8c2099a3ca7147b3998254c991e
|
@@ -38,7 +38,17 @@
|
|
38
38
|
hide_actions: hide_actions
|
39
39
|
%>
|
40
40
|
</div>
|
41
|
-
|
42
|
-
|
41
|
+
</div>
|
42
|
+
<div class="row">
|
43
|
+
<div class="col" >
|
44
|
+
<div class="text-muted text-xs">
|
45
|
+
<%= page_entries_info list, entry_name: '' %>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
<div class="col">
|
49
|
+
<div class="float-right">
|
50
|
+
<%= paginate list, window: 1 %>
|
51
|
+
</div>
|
43
52
|
</div>
|
44
|
-
</div>
|
53
|
+
</div>
|
54
|
+
<br>
|
@@ -32,6 +32,7 @@
|
|
32
32
|
<% column_name = column[:attribute] %>
|
33
33
|
<% column_method = column[:method] %>
|
34
34
|
<% column_align = column[:align] %>
|
35
|
+
<% column_title = column[:title] %>
|
35
36
|
<% end %>
|
36
37
|
|
37
38
|
<% next if /_currency$/ =~ column_name %>
|
@@ -43,32 +44,32 @@
|
|
43
44
|
<% cname = column_name.split('.')[-1] %>
|
44
45
|
<% model = Kernel.const_get(mname) %>
|
45
46
|
<%= sort_link(@q, column_name.split('.').join('_'),
|
46
|
-
"#{model.model_name.human} (#{model.human_attribute_name(cname)})")
|
47
|
+
column_title || "#{model.model_name.human} (#{model.human_attribute_name(cname)})")
|
47
48
|
%>
|
48
49
|
<% elsif /_id$/ =~ column_name %>
|
49
|
-
<%= sort_link(@q, column_name, list.klass.human_attribute_name(column_name.split("_id")[0])) %>
|
50
|
+
<%= sort_link(@q, column_name, column_title || list.klass.human_attribute_name(column_name.split("_id")[0])) %>
|
50
51
|
<% elsif /_cents$/ =~ column_name %>
|
51
|
-
<%= sort_link(@q, column_name, list.klass.human_attribute_name(column_name.split("_cents")[0])) %>
|
52
|
+
<%= sort_link(@q, column_name, column_title || list.klass.human_attribute_name(column_name.split("_cents")[0])) %>
|
52
53
|
<% elsif /_currency$/ =~ column_name %>
|
53
54
|
<!-- faz nada -->
|
54
55
|
<% elsif column_name == 'id' %>
|
55
|
-
<%= sort_link(@q, column_name, '#') %>
|
56
|
+
<%= sort_link(@q, column_name, column_title || '#') %>
|
56
57
|
<% else %>
|
57
|
-
<%= sort_link(@q, column_name, list.klass.human_attribute_name(column_name)) %>
|
58
|
+
<%= sort_link(@q, column_name, column_title || list.klass.human_attribute_name(column_name)) %>
|
58
59
|
<% end %>
|
59
60
|
<% else %>
|
60
61
|
<% if column_name.include?('.') %>
|
61
|
-
<% s_name = column_method || column_name %>
|
62
|
+
<% s_name = column_title || column_method || column_name %>
|
62
63
|
<%= "#{s_name.split('.')[-2]&.camelize} (#{s_name.split('.')[-1]})" %>
|
63
64
|
<% elsif /_id$/ =~ column_name %>
|
64
|
-
<%= list.klass.human_attribute_name(column_name.split("_id")[0]) %>
|
65
|
+
<%= column_title || list.klass.human_attribute_name(column_name.split("_id")[0]) %>
|
65
66
|
<% elsif /_cents$/ =~ column_name %>
|
66
|
-
<%= list.klass.human_attribute_name(column_name.split("_cents")[0]) %>
|
67
|
+
<%= column_title || list.klass.human_attribute_name(column_name.split("_cents")[0]) %>
|
67
68
|
<% elsif /_currency$/ =~ column_name %>
|
68
69
|
<% elsif column_name == 'id' %>
|
69
|
-
#
|
70
|
+
<%= column_title || "#" %>
|
70
71
|
<% else %>
|
71
|
-
<%= list.klass.human_attribute_name(column_name) %>
|
72
|
+
<%= column_title || list.klass.human_attribute_name(column_name) %>
|
72
73
|
<% end %>
|
73
74
|
<% end %>
|
74
75
|
</th>
|
@@ -88,6 +89,7 @@
|
|
88
89
|
<% if column.class == Hash %>
|
89
90
|
<% column_name = column[:attribute] %>
|
90
91
|
<% column_method = column[:method] %>
|
92
|
+
<% column_format = column[:format] %>
|
91
93
|
<% end %>
|
92
94
|
|
93
95
|
<% next if /_currency$/ =~ column_name %>
|
@@ -105,7 +107,11 @@
|
|
105
107
|
object.send(column_name).class == DateTime or
|
106
108
|
object.send(column_name).class == ActiveSupport::TimeWithZone or
|
107
109
|
object.send(column_name).class == Time %>
|
108
|
-
|
110
|
+
<% if column_format %>
|
111
|
+
<%= l(object.send(column_name), format: (column_format.is_a?(Symbol) ? column_format : column_format.to_sym)) %>
|
112
|
+
<% else %>
|
113
|
+
<%=l object.send(column_name) %>
|
114
|
+
<% end %>
|
109
115
|
<% elsif object.send(column_name).respond_to? 'attached?' %>
|
110
116
|
<% if object.send(column_name).class == ActiveStorage::Attached::One %>
|
111
117
|
<% if object.send(column_name).attached? %>
|
data/lib/zutils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Viana
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -85,7 +85,7 @@ homepage: http://gitlab.tjpi.jus.br/
|
|
85
85
|
licenses:
|
86
86
|
- MIT
|
87
87
|
metadata: {}
|
88
|
-
post_install_message:
|
88
|
+
post_install_message:
|
89
89
|
rdoc_options: []
|
90
90
|
require_paths:
|
91
91
|
- lib
|
@@ -100,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
104
|
-
signing_key:
|
103
|
+
rubygems_version: 3.4.15
|
104
|
+
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Utilidades gerais para aplicações rails
|
107
107
|
test_files: []
|