templus_models 2.0.5 → 2.0.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 +4 -4
- data/app/raro_crud/raro_crud.rb +2 -2
- data/app/views/crud/_record.html.erb +10 -3
- data/app/views/crud/listing.pdf.erb +6 -1
- data/lib/templus_models/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 800c8874f35daeb9d38c42153253e4e60087568c
|
4
|
+
data.tar.gz: e29d7680ec274ac5571df3d90de31904e9b3b62d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1020f4029559eceb571324d6584fd431a4f9e3c5b76f7d723f90a9f1d34c7ebf984a6335aaf7dee18e96051b57f52f8c8b91527c076ac65dd7dfb00e2866571
|
7
|
+
data.tar.gz: 06d301f58f08a85dd4462dbd7762be108f375fb08cb7108469e236e426039ae6e376fcaff60eb359cde6a33dbcdfec5d7defeece1bf02d46fbbd709c172c2231
|
data/app/raro_crud/raro_crud.rb
CHANGED
@@ -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
|
-
|
59
|
-
<% if
|
60
|
-
|
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
|
-
|
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 %>
|