ct_table_for 0.1.11.beta → 0.1.12.beta

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
  SHA1:
3
- metadata.gz: ee29cab7f90724f8ed98f10eb7aca82f657e3554
4
- data.tar.gz: 0fb92b16ea2c8b5e384c391d8a2b415cc65dc2f6
3
+ metadata.gz: b2a7d0d6484646061c28ff85ae59ad56509c564d
4
+ data.tar.gz: 34e0bc8965f42d14261eceeb1f4700b9fff485e6
5
5
  SHA512:
6
- metadata.gz: a6418fb841912081ef03183d543d4362f090c56e4a76d2b47b9cc6895d91688ecd5c7f460ac277fb6388a08792fedf526b3d1d8dff1a459579369baf6dada24d
7
- data.tar.gz: 2cebf0aa7b36e0543ecb423b51adcdc06f6241ddb38a2e47104c2fa3985ea6e8706499125559b24541e7693ef171c9e52b7969d6e880ca600116d8010edeb21c
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(50, separator: " ")
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module CtTableFor
2
- VERSION = '0.1.11.beta'
2
+ VERSION = '0.1.12.beta'
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: 0.1.11.beta
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-06-28 00:00:00.000000000 Z
13
+ date: 2017-07-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails