templus_models 2.0.4 → 2.0.5
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/controllers/crud_controller.rb +0 -1
- data/app/views/crud/_record.html.erb +13 -8
- data/app/views/crud/_records.html.erb +1 -1
- data/lib/templus_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23116f5eee2d923fe90da09e82073c3f315fc79c
|
|
4
|
+
data.tar.gz: 6cb21d0fc34da32c6f8e8b88219026e9b45454a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
64
|
-
<% unless
|
|
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
|
-
|
|
74
|
-
<%=I18n.t(name)%>
|
|
75
|
-
</a>
|
|
81
|
+
<%= link_to t(name), url, class: link_class, data: { push: 'partial', target: '#form' } %>
|
|
76
82
|
<% else %>
|
|
77
|
-
|
|
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
|
-
|
|
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 %>
|
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
|
+
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.
|
|
984
|
+
rubygems_version: 2.6.8
|
|
985
985
|
signing_key:
|
|
986
986
|
specification_version: 4
|
|
987
987
|
summary: Easy CRUD generator for Rails Projects
|