snaptable 2.0.5 → 2.1.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/app/views/snaptable/base.html.erb +1 -1
- data/lib/snaptable/constructor/renderer.rb +6 -5
- data/lib/snaptable/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: 6edfbac91d3d9a0930ebc3ed0d430a58b7c3851b
|
4
|
+
data.tar.gz: d06c18668c831f9cf2ae3d8a0f5c63a03cd230a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5706288fb9030274d7469d950e2b60a664a100e11523abf00132705bcff26952e2d9eb455f88732fd24b72e074f360397b6789face063d5ce8a502010cef9cd
|
7
|
+
data.tar.gz: 1fa2661b90067c7ce758d8a7c2f146161191c56f6341105c750671263de8b6bc95b7077f54089ac0a5feca72e029f9898adc15a05c14f10e6b1397b8ce561c6b
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<% presenter.records.each do |record| %>
|
20
20
|
<tr class="<%= cycle('odd', 'even') %>" data-url="<%= record.send(presenter.url) %>">
|
21
21
|
<% presenter.values(record).each do |value| %>
|
22
|
-
<td><%=
|
22
|
+
<td><%= value %></td>
|
23
23
|
<% end %>
|
24
24
|
</tr>
|
25
25
|
<% end %>
|
@@ -39,12 +39,13 @@ module Snaptable
|
|
39
39
|
|
40
40
|
def format(attribute, attr_value)
|
41
41
|
if attr_value.is_a?(Date) || attr_value.is_a?(Time) || attr_value.is_a?(DateTime)
|
42
|
-
l
|
42
|
+
attr_value = l(attr_value, format: :snaptable)
|
43
43
|
elsif !attr_value.nil? && attribute.to_s.in?(enums)
|
44
|
-
t
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
attr_value = t("#{model.model_name.i18n_key}.#{attribute.to_s.pluralize}.#{attr_value}")
|
45
|
+
end
|
46
|
+
attr_value = view_context.strip_tags(attr_value.to_s)
|
47
|
+
attr_value = view_context.truncate(attr_value, length: 40) unless options[:truncate] == false
|
48
|
+
return attr_value
|
48
49
|
end
|
49
50
|
|
50
51
|
def enums
|
data/lib/snaptable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khcr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|