templus_models 2.0.4 → 2.0.5

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: 7fb0cc95c5bfa019c9542e783b7f340cc2d732f0
4
- data.tar.gz: 175ca61205b9b4f4588c8994538977c241af5029
3
+ metadata.gz: 23116f5eee2d923fe90da09e82073c3f315fc79c
4
+ data.tar.gz: 6cb21d0fc34da32c6f8e8b88219026e9b45454a8
5
5
  SHA512:
6
- metadata.gz: f46f9241987ea445ae2fafc85872f74d3bc46a4a784e1edb73d5b757def6c2570eb2e45191a49331a70d9ae85b271d803d14e74e6fd88f26a9213b6a21d61bf9
7
- data.tar.gz: 1fdb2615e5d8772e7dc1aa07f198ae8bca1c8479a96a77ed4327e839918903190a31975feb8bb73566ac829e32fe2362964e5637c977596e4800c1199583316f
6
+ metadata.gz: af1e04ba6846724085eb15f00ddc7ffc687fb4660413a59bda27b6bda0bd9a87a0421237e72bca17a9301d5feb6a7cdfad434f0e7b0203e80e0426b796d59c2c
7
+ data.tar.gz: 678efc4612f50945fbbd9c71ffa6d27920c2227ff867ec54074a9bb03aaba52f7c4c8f1600bbed46810064628e0ba84521e2c93419feb0e778dd01b0cc7eb3c9
@@ -162,7 +162,6 @@ class CrudController < ApplicationController
162
162
  format.xls { headers["Content-Disposition"] = "attachment; filename=#{report_name}.xls" }
163
163
  format.pdf do
164
164
  html = render_to_string('crud/listing.pdf.erb')
165
- File.write('/Users/pedropires/Desktop/test.html', html)
166
165
  options = {
167
166
  encoding: 'UTF-8',
168
167
  page_size: 'A4',
@@ -60,24 +60,29 @@
60
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"}%>
61
61
  <% end %>
62
62
  <% end %>
63
- <%@crud_helper.actions_links.each do |name, options|%>
64
- <% unless (options[:can].present? && !record.instance_eval(&options[:can])) %>
63
+ <% @crud_helper.actions_links.each do |name, options| %>
64
+ <% unless options[:can].present? && !record.instance_eval(&options[:can]) %>
65
65
  <% if options[:url].present? %>
66
66
  <% url = options[:url] %>
67
+
67
68
  <% if options[:id] %>
68
69
  <% url += options[:url].include?("?") ? "&id=#{record.id}" : "?id=#{record.id}" %>
69
70
  <% else url.include?(":id") %>
70
71
  <% url = url.gsub(":id", "#{record.id}") %>
71
72
  <% end %>
73
+
74
+ <% if options[:class] %>
75
+ <% link_class = 'btn btn-xs ' + options[:class] %>
76
+ <% else %>
77
+ <% link_class = 'btn btn-success btn-xs' %>
78
+ <% end %>
79
+
72
80
  <% if options[:wiselink].present? && options[:wiselink] %>
73
- <a href="<%= url %>" class="btn btn-success btn-xs" data-push="partial" data-target="#form">
74
- <%=I18n.t(name)%>
75
- </a>
81
+ <%= link_to t(name), url, class: link_class, data: { push: 'partial', target: '#form' } %>
76
82
  <% else %>
77
- <a href="<%= url %>" class="btn btn-success btn-xs">
78
- <%=I18n.t(name)%>
79
- </a>
83
+ <%= link_to t(name), url, class: link_class %>
80
84
  <% end %>
85
+
81
86
  <% elsif options[:associacao].present? %>
82
87
  <%= link_to name, crud_associacao_models_path(model: @model.name.underscore, id: record.id, associacao: options[:associacao].to_s), class: "btn btn-success btn-xs", data: {push: "partial", target: "#form"} %>
83
88
  <% elsif options[:partial].present? %>
@@ -6,7 +6,7 @@
6
6
  <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
7
7
  <thead>
8
8
  <tr>
9
- <%@crud_helper.index_fields.each do |att| %>
9
+ <% @crud_helper.index_fields.each do |att| %>
10
10
  <% if !att[:visible_if].nil?%>
11
11
  <% if ((att[:visible_if].class == Proc && !att[:visible_if].call(att)) || (att[:visible_if].class != Proc && !att[:visible_if])) %>
12
12
  <% next %>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
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.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Sol
@@ -981,7 +981,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
981
981
  version: '0'
982
982
  requirements: []
983
983
  rubyforge_project:
984
- rubygems_version: 2.5.1
984
+ rubygems_version: 2.6.8
985
985
  signing_key:
986
986
  specification_version: 4
987
987
  summary: Easy CRUD generator for Rails Projects