tramway-core 1.10.3.1 → 1.11

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
  SHA256:
3
- metadata.gz: 01e624ae5e7f4984017b12d91a44451e40834491af50f42add0d2dbb6121e4b3
4
- data.tar.gz: e679b3bcf9d2f2381060706c5430ad796e07ab4a3dfa7f9d8f434ab3aab72007
3
+ metadata.gz: e17dfbdff34fe334d3e5893a96fb7b673647c1f86b4bd093a60f4ce7d6348350
4
+ data.tar.gz: f1290d0d3ceb587f7b47819548109b71eb46db634cc8b5b42ab9061dfe731564
5
5
  SHA512:
6
- metadata.gz: 7b2f46832c7bad00aecef4ec5f2c7ac799b7cab6f983c683eb603cb45d139bf3bc23232b2e49b952a11848aedc32d04827525cfb2bad3b0be55af0041500bd6d
7
- data.tar.gz: 0e7d461d7329007bc7ffe2dea730854e1e5c246a38e561eecfe7dfaa8a633109fd6ff2e4f77a699b508d485bbad76eb0ad16ee1ecf45377e024269cabd8e9ec8
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
- tags = content_tag(:div) do
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.text
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
@@ -6,6 +6,7 @@ ru:
6
6
  back: Назад
7
7
  sign_out: Выйти
8
8
  actions: Действия
9
+ open: Открыть
9
10
  actions:
10
11
  create: Создать
11
12
  update: Редактировать
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.10.3.1'
3
+ VERSION = '1.11'
4
4
  end
5
5
  end
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.10.3.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-20 00:00:00.000000000 Z
11
+ date: 2019-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform-rails