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 +4 -4
- data/app/helpers/ct_table_for/application_helper.rb +18 -15
- data/lib/ct_table_for/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee4c048a968042ebb3909b69a45ae079082698350af7714678e032a6f59cddb8
|
|
4
|
+
data.tar.gz: bea7445d0dd0cdc74e6b9df76de9d59152bc4fd5fdbddface41e3670db9e43dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
186
|
-
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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>}
|
data/lib/ct_table_for/version.rb
CHANGED
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.
|
|
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-
|
|
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
|
-
|
|
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
|