ct_table_for 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b045f046408715dbc1ee98f68810c7844379ae2b5699278750d274cc2d5a1a7
4
- data.tar.gz: cdad607f64f10cb43503a04f6df6ccfb1baf40c35205a12cbbe08e1bf1ec68d6
3
+ metadata.gz: ee4c048a968042ebb3909b69a45ae079082698350af7714678e032a6f59cddb8
4
+ data.tar.gz: bea7445d0dd0cdc74e6b9df76de9d59152bc4fd5fdbddface41e3670db9e43dc
5
5
  SHA512:
6
- metadata.gz: 5528ff153caa87b8bd213e8ad9058ef93a41e91729a3ecbf4b17fdde7e299929851704bb6c09dc5d3bdd2ddff586203bd640ebae669bb2ef7d24fe8f26aed4cc
7
- data.tar.gz: d18ac4aa9e21d414182a13cefcf42a2272b7147993d9b6815f66f169ec26033eea115c2f5a9058ed891202e818a89f943ebe54ca77cc43a7d3f669aba0c66109
6
+ metadata.gz: 3797d1adc5fa0ee49b510a74cbafcd8f8d9be35b0403fad2628ee0d18f6947ad14bb752339a2225ca5de462b8bb34a340d9a1a6fea75e9903c6ba5dd2633a5e4
7
+ data.tar.gz: 411971b3b1452bc20d54714000eee5e73f122520b7941bcbca377aa392cb5758e179348b42cdc767fe312c3f86b61e7b0684497055a0ef4a019062e8970864a7
@@ -182,22 +182,25 @@ module CtTableFor
182
182
  nesting = (options[:actions][:premodel] || []) + [record]
183
183
  buttons = options[:actions][:buttons].map{ |b| b.split("|")}
184
184
  buttons.each do |action, *extras|
185
- return "" if defined?(CanCanCan) and cannot?(action, record)
186
- case action.to_sym
187
- when :show
188
- html << link_to(label_for_action(action, options[:actions][:icons]).html_safe, polymorphic_path(nesting), class: class_for_action(action, options))
189
- when :edit
190
- html << link_to(label_for_action(action, options[:actions][:icons]).html_safe, edit_polymorphic_path(nesting), class: class_for_action(action, options))
191
- when :destroy
192
- html << link_to(label_for_action(action, options[:actions][:icons]).html_safe, polymorphic_path(nesting),
193
- method: :delete, class: class_for_action(action, options), data: { confirm: I18n.t('table_for.messages.are_you_sure').capitalize })
194
- when :custom
195
- html << button_for_custom_action(record, options, extras)
185
+ if defined?(CanCanCan) && cannot?(action.to_sym, record)
186
+ html << ""
196
187
  else
197
- # TODO:
198
- # nesting_custom = nesting + btn_options[0]
199
- # label = icon CtTableFor.table_for_action_icons[:custom] if options[:actions][:icons] != false and defined?(FontAwesome)
200
- # html << link_to(label, polymorphic_path(nesting_custom), class: "btn btn-default btn-sm")
188
+ case action.to_sym
189
+ when :show
190
+ html << link_to(label_for_action(action, options[:actions][:icons]).html_safe, polymorphic_path(nesting), class: class_for_action(action, options))
191
+ when :edit
192
+ html << link_to(label_for_action(action, options[:actions][:icons]).html_safe, edit_polymorphic_path(nesting), class: class_for_action(action, options))
193
+ when :destroy
194
+ html << link_to(label_for_action(action, options[:actions][:icons]).html_safe, polymorphic_path(nesting),
195
+ method: :delete, class: class_for_action(action, options), data: { confirm: I18n.t('table_for.messages.are_you_sure').capitalize })
196
+ when :custom
197
+ html << button_for_custom_action(record, options, extras)
198
+ else
199
+ # TODO:
200
+ # nesting_custom = nesting + btn_options[0]
201
+ # label = icon CtTableFor.table_for_action_icons[:custom] if options[:actions][:icons] != false and defined?(FontAwesome)
202
+ # html << link_to(label, polymorphic_path(nesting_custom), class: "btn btn-default btn-sm")
203
+ end
201
204
  end
202
205
  end
203
206
  html << %Q{</div>}
@@ -1,3 +1,3 @@
1
1
  module CtTableFor
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ct_table_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustí B.R.
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-24 00:00:00.000000000 Z
13
+ date: 2019-07-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -67,8 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubyforge_project:
71
- rubygems_version: 2.7.6
70
+ rubygems_version: 3.0.4
72
71
  signing_key:
73
72
  specification_version: 4
74
73
  summary: Rails table builder that makes it easy to do responsive tables ActiveRecord