ct_table_for 0.1.10.beta → 0.1.11.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: 52100b153a2d16f55cb1834c38bb45b2775c15cc
4
- data.tar.gz: 8733db9951e3813d1a6575924c654406c6cf90d7
3
+ metadata.gz: ee29cab7f90724f8ed98f10eb7aca82f657e3554
4
+ data.tar.gz: 0fb92b16ea2c8b5e384c391d8a2b415cc65dc2f6
5
5
  SHA512:
6
- metadata.gz: 7b34690e68907e264230852281ddba97f94e3c4d8ae36020ca2b2f5e991eb66355bcb67037ade27b4f353f594e93ba58a3e3f66019694b311ac207cf534793c4
7
- data.tar.gz: 0e15d6c34095047a9e8895f409f11c6b4215bcf473a116e596e7a4d44d5865209a652ae3f44f5be16813dd49bbf275e6f876f5c7598c0270b08212d2180171d8
6
+ metadata.gz: a6418fb841912081ef03183d543d4362f090c56e4a76d2b47b9cc6895d91688ecd5c7f460ac277fb6388a08792fedf526b3d1d8dff1a459579369baf6dada24d
7
+ data.tar.gz: 2cebf0aa7b36e0543ecb423b51adcdc06f6241ddb38a2e47104c2fa3985ea6e8706499125559b24541e7693ef171c9e52b7969d6e880ca600116d8010edeb21c
@@ -119,7 +119,11 @@ module CtTableFor
119
119
  elsif defined?(Paperclip) and value.is_a?(Paperclip::Attachment)
120
120
  html << table_for_cell_for_image( record, attribute, cell_options: cell_options )
121
121
  else
122
- html << value.to_s.truncate(50, separator: " ")
122
+ if cell_options.include? "l"
123
+ html << table_for_cell_for_locale(model, attribute, value)
124
+ else
125
+ html << value.to_s.truncate(50, separator: " ")
126
+ end
123
127
  end
124
128
  end
125
129
  html << %Q{</td>}
@@ -133,6 +137,10 @@ module CtTableFor
133
137
  html << image_tag(record.send(attribute).url(size), class: CtTableFor.table_for_cell_for_image_image_class, style: "max-height: 100px;")
134
138
  html.html_safe
135
139
  end
140
+
141
+ def table_for_cell_for_locale model, attribute, value, cell_options: {}
142
+ html = model.human_attribute_name("#{attribute.underscore}.#{value.underscore}")
143
+ end
136
144
 
137
145
 
138
146
  def table_for_actions(record, options: {} )
@@ -1,3 +1,3 @@
1
1
  module CtTableFor
2
- VERSION = '0.1.10.beta'
2
+ VERSION = '0.1.11.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.10.beta
4
+ version: 0.1.11.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-05-23 00:00:00.000000000 Z
13
+ date: 2017-06-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails