zutils 1.1.2 → 2.0.0

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
  SHA256:
3
- metadata.gz: bff9fb81ac8f0156f7d46644f0da08d0324b413f72ab8a2fc293d2963bafed93
4
- data.tar.gz: a5ab72d937c600876d05e1dcceca038bb08873077e7760170b0a89a486326649
3
+ metadata.gz: 3630171997e63501bdef72428599e01e8433f2561e1d11a9a2f2a758bfd3447a
4
+ data.tar.gz: '08c18d2315835db0721b546e96254d7b51f2c2a081ab8350b4dd921898267b68'
5
5
  SHA512:
6
- metadata.gz: 33345cf00d787c3c7c5ea059c2e6d671071e62b6331492a5f799e9bd6c1493a51dcb577da6bb57f74701c3b1bef37c08c22206ee73ffb04d2798b9ab7c537a70
7
- data.tar.gz: b980a28133573afad4290a1f7e1124182e44fe4a4d12da0c7cdddf727c7873650faf0e4997f16168be76e88fa719db69080eb602eec999b1e3b434843fb0e4a9
6
+ metadata.gz: fb84011a96b37188a7c913fad32ed75d882f3bb405e455180f94bc8eb4e058973c6dbd0a2dceca08fb13a0fd1d737016bf25212948a24763f23171d3ec45b077
7
+ data.tar.gz: 71515648e16702b2b737a4c43787637d21c1d79e411284280f9caac1fde5c2540bbcf9e43d7858d02425d247f0ccf7da9c83d70b5e1831db26c4ca99cecbbb74
@@ -17,6 +17,7 @@
17
17
  <% hide_footer ||= false %>
18
18
 
19
19
  <% hide_read_action ||= false %>
20
+ <% hide_new_action ||= false %>
20
21
  <% hide_edit_action ||= false %>
21
22
  <% hide_destroy_action ||= false %>
22
23
 
@@ -68,7 +69,7 @@
68
69
  <% unless hide_links %>
69
70
  <% unless controller_name == 'users' %>
70
71
  <div class="box-footer card-footer">
71
- <% if can? :new, list.klass %>
72
+ <% if !hide_new_action && can? :new, list.klass %>
72
73
  <% if nested_resource == true %>
73
74
  <% if parent_resource %>
74
75
  <%= link_to eval("new_#{parent_resource.class.model_name.singular}_#{list.klass.model_name.singular}_path(#{parent_resource.id})"), class: "btn btn-#{box_class}" do %>
@@ -34,8 +34,14 @@
34
34
  <% end %>
35
35
  <% end %>
36
36
  <% if show_actions.include?('edit') && can?(:edit, object) %>
37
- <%= link_to eval_with_rescue("edit_#{object.class.model_name.singular}_path(#{object.id})"), class: "btn btn-warning btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
38
- Editar <i class="fa fa-pencil fa-pen"></i>
37
+ <% if nested_resource %>
38
+ <%= link_to eval_with_rescue("edit_#{parent_resource.class.model_name.singular}_#{object.class.model_name.singular}_path(#{parent_resource.id},#{object.id})"), class: "btn btn-#{box_class} btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
39
+ Editar <i class="fa fa-pencil fa-pen"></i>
40
+ <% end %>
41
+ <% else %>
42
+ <%= link_to eval_with_rescue("edit_#{object.class.model_name.singular}_path(#{object.id})"), class: "btn btn-warning btn-xs", data: { toggle: 'tooltip', placement: 'top', title: 'Editar' } do %>
43
+ Editar <i class="fa fa-pencil fa-pen"></i>
44
+ <% end %>
39
45
  <% end %>
40
46
  <% end %>
41
47
  <% if show_actions.include?('index') %>
@@ -165,7 +171,7 @@
165
171
  </table>
166
172
  </div>
167
173
  </div>
168
- <% else %>
174
+ <% else %>
169
175
  <div class="box box-<%= box_class %>">
170
176
  <div class="box-header with-border">
171
177
  <h3 class="box-title">
@@ -1,3 +1,3 @@
1
1
  module Zutils
2
- VERSION = "1.1.2"
2
+ VERSION = "2.0.0"
3
3
  end
data/zutils.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
 
35
- spec.add_dependency 'rails', '~> 6.0'
35
+ spec.add_dependency 'rails', '>= 5.0'
36
36
 
37
37
  spec.add_development_dependency "bundler", "~> 1.16"
38
38
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2022-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '6.0'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.0.3
103
+ rubygems_version: 3.3.7
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Utilidades gerais para aplicações rails