templus_models 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23116f5eee2d923fe90da09e82073c3f315fc79c
4
- data.tar.gz: 6cb21d0fc34da32c6f8e8b88219026e9b45454a8
3
+ metadata.gz: 800c8874f35daeb9d38c42153253e4e60087568c
4
+ data.tar.gz: e29d7680ec274ac5571df3d90de31904e9b3b62d
5
5
  SHA512:
6
- metadata.gz: af1e04ba6846724085eb15f00ddc7ffc687fb4660413a59bda27b6bda0bd9a87a0421237e72bca17a9301d5feb6a7cdfad434f0e7b0203e80e0426b796d59c2c
7
- data.tar.gz: 678efc4612f50945fbbd9c71ffa6d27920c2227ff867ec54074a9bb03aaba52f7c4c8f1600bbed46810064628e0ba84521e2c93419feb0e778dd01b0cc7eb3c9
6
+ metadata.gz: c1020f4029559eceb571324d6584fd431a4f9e3c5b76f7d723f90a9f1d34c7ebf984a6335aaf7dee18e96051b57f52f8c8b91527c076ac65dd7dfb00e2866571
7
+ data.tar.gz: 06d301f58f08a85dd4462dbd7762be108f375fb08cb7108469e236e426039ae6e376fcaff60eb359cde6a33dbcdfec5d7defeece1bf02d46fbbd709c172c2231
@@ -363,9 +363,9 @@ class RaroCrud
363
363
  @@condition_printing_action[self.to_s.to_sym] = condicao
364
364
  end
365
365
 
366
- def self.acoes(method,desc,proc = nil)
366
+ def self.acoes(method, desc, proc = nil, options = {})
367
367
  @@actions[self.to_s.to_sym] = [] unless @@actions[self.to_s.to_sym]
368
- @@actions[self.to_s.to_sym].push([method,desc,proc])
368
+ @@actions[self.to_s.to_sym].push([method, desc, proc, options])
369
369
  end
370
370
 
371
371
  def self.links(name,options)
@@ -55,9 +55,16 @@
55
55
  <%end%>
56
56
  <td class="row">
57
57
  <div class="col-xs-9">
58
- <%@crud_helper.actions.each do |a|%>
59
- <% if ((a[2].present? && a[2].call(record)) || !a[2].present?) %>
60
- <%= link_to I18n.t(a[1]), action_crud_path(model: @model.name.underscore, id: record.id, acao: a[0]), class: "btn btn-primary btn-xs", data: {push: "partial", target: "#form"}%>
58
+ <% @crud_helper.actions.each do |a| %>
59
+ <% if !a[2].present? || a[2].call(record) %>
60
+
61
+ <% if a[3][:class] %>
62
+ <% link_class = 'btn btn-xs ' + a[3][:class] %>
63
+ <% else %>
64
+ <% link_class = 'btn btn-primary btn-xs' %>
65
+ <% end %>
66
+
67
+ <%= link_to I18n.t(a[1]), action_crud_path(model: @model.name.underscore, id: record.id, acao: a[0]), class: link_class, data: {push: "partial", target: "#form"}%>
61
68
  <% end %>
62
69
  <% end %>
63
70
  <% @crud_helper.actions_links.each do |name, options| %>
@@ -10,7 +10,12 @@
10
10
  <% if @crud_helper.logo_listing_field.present? %>
11
11
  <div class="col-xs-3">
12
12
  <% if @crud_helper.logo_listing_field[:logo_proc].present? %>
13
- <%= render_field_file(@crud_helper.logo_listing_field[:logo_proc].call(@records)) %>
13
+ <% proc_result = @crud_helper.logo_listing_field[:logo_proc].call(@records) %>
14
+ <% if proc_result.is_a?(String) %>
15
+ <%= pdf_image_tag(proc_result, width: '100px') %>
16
+ <% else %>
17
+ <%= render_field_file(proc_result) %>
18
+ <% end %>
14
19
  <% elsif @crud_helper.logo_listing_field[:url].present? %>
15
20
  <%= pdf_image_tag(@crud_helper.logo_listing_field[:url], width: '100px') %>
16
21
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "2.0.5"
2
+ VERSION = "2.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: templus_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Sol