zutils 0.4.5 → 0.4.6

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: e1e2951ef16b864b5c89d7e59c3218cb039d1a2a346e0beb06a86e8af897fa2b
4
- data.tar.gz: 504f657bb23981540599fa840021a0b7d051306f425728b21948dba1fdac8f1e
3
+ metadata.gz: 6beea5424128dbf620233a3cbd415ad4732220215ffe74bff75ab095f777106a
4
+ data.tar.gz: 5bd6426ac8b964b35d6d4ca52de4d9ea36b6be23d1cfb388af9377e9c1696008
5
5
  SHA512:
6
- metadata.gz: e6c01ff42e72d2f2c5a6324848397133153024852c8505e1b23e0a148fdb0d982306f9f918ae15fec1ee60d6ed8386b8f252896cfb456a4cf66fcbfed7034701
7
- data.tar.gz: 78a06d0e450914380028662375e453f5fd59a41885683077d8940377409225c8f1f8ecf9e1f7615e666feea9683d125720053c5fdbc9aa7f967fb81ca4902ae1
6
+ metadata.gz: e316d9566eb8b9602d7c9fd36e1d29834dbf47c58c95a38a59019a90c8b76bb671ef4c224a4fc393b191e104899dc0df08337a2b5c2a88fca27599a028d44f5c
7
+ data.tar.gz: 122220f43640e052caea1cc38ec76f3954d95b14a099066f17b167886010554269c133fa8b6ab4316611f2831459cbe68d00efb5fa619b64d33c021d9bc57308
@@ -44,7 +44,8 @@
44
44
  <%= render 'shared/list', list: list, exceptions: exceptions, excluded_columns: excluded_columns,
45
45
  additional_columns: additional_columns, sort_fields: sort_fields, sort_all: sort_all,
46
46
  additional_actions: additional_actions, hide_actions: hide_actions, table_class: table_class,
47
- show_columns: show_columns, hide_read_action: hide_read_action, hide_edit_action: hide_edit_action, hide_destroy_action: hide_destroy_action
47
+ show_columns: show_columns, hide_read_action: hide_read_action, hide_edit_action: hide_edit_action,
48
+ hide_destroy_action: hide_destroy_action, box_class: box_class
48
49
  %>
49
50
  <% if defined? list.total_pages %>
50
51
  <div class='col-md-4'>
@@ -51,12 +51,21 @@
51
51
  <% show_columns.each do |column| %>
52
52
  <% next if /_currency$/ =~ column %>
53
53
  <td>
54
- <% if object.respond_to?(column) && (
55
- object.send(column).class == Date or
54
+ <% if column.include?('.') %>
55
+ <% o = object %>
56
+ <% column.split('.').each{|m| o = o.send(m) if o } %>
57
+ <%= o %>
58
+ <% elsif object.send(column).class == Date or
56
59
  object.send(column).class == DateTime or
57
60
  object.send(column).class == ActiveSupport::TimeWithZone or
58
- object.send(column).class == Time) %>
61
+ object.send(column).class == Time %>
59
62
  <%=l object.send(column) %>
63
+ <% elsif object.send(column).respond_to? 'attached?' %>
64
+ <% if object.send(column).class == ActiveStorage::Attached::One %>
65
+ <%= link_to rails_blob_path(object.send(column)), class: "btn btn-#{box_class} btn-xs", target: '_blank' do %>
66
+ <i class="fa fa-file-o"></i> Arquivo
67
+ <% end %>
68
+ <% end %>
60
69
  <% elsif /_id$/ =~ column && object.respond_to?(column.split('_id')[0]) %>
61
70
  <%= object.send(column.split("_id")[0])&.name %>
62
71
  <% elsif /_cents$/ =~ column %>
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
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: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails