ct_table_for 0.1.11.beta → 0.1.12.beta
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 -1
- data/app/helpers/ct_table_for/application_helper.rb +7 -1
- data/lib/ct_table_for/engine.rb +6 -0
- data/lib/ct_table_for/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: b2a7d0d6484646061c28ff85ae59ad56509c564d
|
4
|
+
data.tar.gz: 34e0bc8965f42d14261eceeb1f4700b9fff485e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 249d7282ad3527f3e7ba12a85a78f1f26ad657849235130d538d338d8ad94535ebc27620e8bc8abe3458fb18286525ee8c84580003a338f523481b839e4144ed
|
7
|
+
data.tar.gz: bed34560a91d7dee7ecf5276e17fea7ea617537da3378eaac01de667e314b0120ed667038ddbc81860a75cd3a56f4ed63bd3cf5707b74847973537486a086e6f
|
data/README.md
CHANGED
@@ -57,7 +57,9 @@ CtTableFor.setup do |config|
|
|
57
57
|
config.table_for_action_icons = {show: "eye", edit: "pencil", destroy: "trash"}
|
58
58
|
config.table_for_numeric_percentage_precision = 2
|
59
59
|
config.table_for_cell_for_image_image_class = "img-responsive"
|
60
|
-
|
60
|
+
config.table_for_truncate_length = 50
|
61
|
+
config.table_for_truncate_separator = " "
|
62
|
+
config.table_for_truncate_omission = "..."
|
61
63
|
end
|
62
64
|
```
|
63
65
|
You can also define the breakpoint in your `sass` before importing `table_for`:
|
@@ -121,8 +121,14 @@ module CtTableFor
|
|
121
121
|
else
|
122
122
|
if cell_options.include? "l"
|
123
123
|
html << table_for_cell_for_locale(model, attribute, value)
|
124
|
+
elsif cell_options.include? "no_truncate"
|
125
|
+
html << value.to_s
|
124
126
|
else
|
125
|
-
html << value.to_s.truncate(
|
127
|
+
html << value.to_s.truncate(
|
128
|
+
CtTableFor.table_for_truncate_length,
|
129
|
+
separator: CtTableFor.table_for_truncate_separator,
|
130
|
+
omission: CtTableFor.table_for_truncate_omission
|
131
|
+
)
|
126
132
|
end
|
127
133
|
end
|
128
134
|
end
|
data/lib/ct_table_for/engine.rb
CHANGED
@@ -7,6 +7,9 @@ module CtTableFor
|
|
7
7
|
mattr_accessor :table_for_action_icons
|
8
8
|
mattr_accessor :table_for_numeric_percentage_precision
|
9
9
|
mattr_accessor :table_for_cell_for_image_image_class
|
10
|
+
mattr_accessor :table_for_truncate_length
|
11
|
+
mattr_accessor :table_for_truncate_separator
|
12
|
+
mattr_accessor :table_for_truncate_omission
|
10
13
|
|
11
14
|
self.table_for_wrapper_default_class = "table-responsive"
|
12
15
|
self.table_for_default_class = "table table-striped table-bordered table-condensed table-hover"
|
@@ -15,6 +18,9 @@ module CtTableFor
|
|
15
18
|
self.table_for_action_icons = {show: "eye", edit: "pencil", destroy: "trash", custom: "gear"}
|
16
19
|
self.table_for_numeric_percentage_precision = 2
|
17
20
|
self.table_for_cell_for_image_image_class = "img-responsive"
|
21
|
+
self.table_for_truncate_length = 50
|
22
|
+
self.table_for_truncate_separator = " "
|
23
|
+
self.table_for_truncate_omission = "..."
|
18
24
|
end
|
19
25
|
|
20
26
|
# this function maps the vars from your app into your engine
|
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: 0.1.
|
4
|
+
version: 0.1.12.beta
|
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: 2017-
|
13
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|