tramway-core 1.10.3.1 → 1.11
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e17dfbdff34fe334d3e5893a96fb7b673647c1f86b4bd093a60f4ce7d6348350
|
4
|
+
data.tar.gz: f1290d0d3ceb587f7b47819548109b71eb46db634cc8b5b42ab9061dfe731564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0edbe1414b47bce6d44871f5806c5863d6c2908af1ad292534057e013fd1106adc6472ff5b23707ce4d52484e53653957348ce789e6b541b83577092c0099f4a
|
7
|
+
data.tar.gz: a273b7e04fcedf836d3b378091cf4b83f08dd87a66d44f2319c48a5c4adfbd852b8a54313168113de04cbd11174253986d260d132910f39f88aa94036bf96a86
|
@@ -106,15 +106,9 @@ class Tramway::Core::ApplicationDecorator
|
|
106
106
|
elsif value.class.in? [ ActiveSupport::TimeWithZone, DateTime, Time ]
|
107
107
|
hash.merge! attribute[0] => datetime_view(attribute[1])
|
108
108
|
elsif value.class.superclass == ApplicationUploader
|
109
|
-
|
110
|
-
if value.url.match(/jpg|JPG|png|PNG$/)
|
111
|
-
concat image_tag value.try(:small) ? value.small.url : value.url
|
112
|
-
end
|
113
|
-
concat link_to(fa_icon(:download), value.url, class: 'btn btn-success')
|
114
|
-
end
|
115
|
-
hash.merge! attribute[0] => tags
|
109
|
+
hash.merge! attribute[0] => image_view(attribute[1])
|
116
110
|
elsif value.is_a? Enumerize::Value
|
117
|
-
hash.merge! attribute[0] => value
|
111
|
+
hash.merge! attribute[0] => enumerize_view(value)
|
118
112
|
else
|
119
113
|
hash.merge! attribute[0] => value
|
120
114
|
end
|
@@ -10,4 +10,17 @@ module Tramway::Core::Concerns::AttributesDecoratorHelper
|
|
10
10
|
def state_machine_view(object, attribute_name)
|
11
11
|
object.send "human_#{attribute_name}_name"
|
12
12
|
end
|
13
|
+
|
14
|
+
def image_view(value)
|
15
|
+
content_tag(:div) do
|
16
|
+
if value.url.match(/jpg|JPG|png|PNG$/)
|
17
|
+
concat image_tag value.try(:small) ? value.small.url : value.url
|
18
|
+
end
|
19
|
+
concat link_to(fa_icon(:download), value.url, class: 'btn btn-success')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def enumerize_view(value)
|
24
|
+
value.text
|
25
|
+
end
|
13
26
|
end
|
data/lib/tramway/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reform-rails
|