ct_table_for 0.1.15.beta → 1.0.0
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/README.md +3 -3
- data/app/helpers/ct_table_for/application_helper.rb +14 -3
- data/lib/ct_table_for/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d910fc2f6ba2c9ea56176c54d4b60c41d2b1845d13a19020526a919f31560185
|
4
|
+
data.tar.gz: 4bad6c7c2b9e864e08c8e1bf56a7468b182084c59bb2409f7929c56ac423ae45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f6e7f7af479363af9e82c39a35b9e1432dbf9bfaba43626b36c78e7eb64e86a9ced2eb5e8d9cb1c7ab28e956c0ef92c9713f619dcd711d42e9c555a05109cd7
|
7
|
+
data.tar.gz: 8340c531da7fd72d62f8305f48960498921c028743abc45b65fb11db3707e4ee6ac0a43b94b9c81af60f9dd74f6664637a3f192518471d6b944bdc90b594d5d0
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ And require the necessary javascript in `application.js` if you are using the `c
|
|
44
44
|
|
45
45
|
## Usage
|
46
46
|
|
47
|
-
To get started, just use the `
|
47
|
+
To get started, just use the `table_for` helper. Here's an example:
|
48
48
|
|
49
49
|
```erb
|
50
50
|
<%= table_for Model, @collection %>
|
@@ -88,9 +88,9 @@ end
|
|
88
88
|
```
|
89
89
|
You can also define the breakpoint in your `sass` before importing `table_for`:
|
90
90
|
|
91
|
-
```
|
91
|
+
```scss
|
92
92
|
$table-for-breakpoint: 768px;
|
93
|
-
@import "table_for"
|
93
|
+
@import "table_for";
|
94
94
|
```
|
95
95
|
|
96
96
|
|
@@ -215,11 +215,22 @@ module CtTableFor
|
|
215
215
|
|
216
216
|
def button_for_custom_action record, options, extras
|
217
217
|
parsed_extras = parse_extras(extras)
|
218
|
-
|
219
|
-
|
218
|
+
# `icons` is a Boolean-String option to limit `icon` option
|
219
|
+
label = if parsed_extras[:icons].to_s == "false"
|
220
|
+
parsed_extras[:title].presence || ""
|
221
|
+
else
|
222
|
+
%Q{<i class="#{CtTableFor.table_for_icon_font_base_class} #{CtTableFor.table_for_icon_font_base_class}-#{parsed_extras[:icon]}"></i>}
|
223
|
+
end
|
224
|
+
ancestors_list = parsed_extras[:ancestors].presence || ""
|
225
|
+
ancestors = ancestors_list.split(",").map do |ancestor|
|
226
|
+
record.send(ancestor)
|
220
227
|
end
|
221
228
|
custom_action_class = %Q{#{CtTableFor.table_for_default_action_base_class} #{parsed_extras[:class]}}
|
222
|
-
link_to(label.html_safe,
|
229
|
+
link_to(label.html_safe,
|
230
|
+
polymorphic_path([parsed_extras[:link], *ancestors, record]),
|
231
|
+
class: custom_action_class,
|
232
|
+
method: parsed_extras[:method],
|
233
|
+
title: parsed_extras[:title])
|
223
234
|
end
|
224
235
|
|
225
236
|
def uri?(string)
|
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:
|
4
|
+
version: 1.0.0
|
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-04-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -63,9 +63,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
63
|
version: '0'
|
64
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
71
|
rubygems_version: 2.7.6
|