tramway-core 1.0.4 → 1.0.5

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: f210d16378e75f559af9d82c4d91e7773ac4d41eeefd1517566d7de58065d54c
4
- data.tar.gz: 053a94a32d41e4e18297d51d798f29ff4f56ba7a3b19fb9ee4ad63cb623b74b8
3
+ metadata.gz: 9480538773d03ccc2e175fc274664c80886860d76f957ae267baed4efaec104f
4
+ data.tar.gz: c1a1a28165932bafe348b06bb048e4166a3bc3aef7610e9a241fa3f7b7805fad
5
5
  SHA512:
6
- metadata.gz: b5a41fe68961d1911fbc688af0e8e1b4c3b18f5e1113b8a694225a7df067c621b16bce2ed8ca0978c8a2a27488463a113a633287e813e24f7323c1c7fc3e3a2a
7
- data.tar.gz: 284ba15ae8efd8b6f271db77b7acda396a33c6d90e3b7d2188d0c9200dc934210bfcbf7e9e3f3fe810a08e925230548c6ce4678133d3789fb46f603a59c03365
6
+ metadata.gz: 2712bbde78b0520facab711c6a5b2479a017cf492e23c0cba002490eb1109834e132b473aae6042fb581c41a660100c80c052f877fbd64ae1f0ce31b803f81c8
7
+ data.tar.gz: 29eed81461d08e45b35343d5930fa17e4be411fa84c9fd09a2653cba83bef0e242fe6508d56d506476990ba5989741e1ecdc636534f0adcd2b32fa4fc6a2d829
@@ -49,7 +49,9 @@ class Tramway::Core::ApplicationDecorator
49
49
  hash.merge! attribute[0] => I18n.l(attribute[1])
50
50
  elsif value.class.superclass == ApplicationUploader
51
51
  tags = content_tag(:div) do
52
- concat image_tag value.small.url if value.url.match(/jpg|JPG|png|PNG$/)
52
+ if value.url.match(/jpg|JPG|png|PNG$/)
53
+ concat image_tag value.try(:small) ? value.small.url : value.url
54
+ end
53
55
  concat link_to(fa_icon(:download), value.url, class: 'btn btn-success')
54
56
  end
55
57
  hash.merge! attribute[0] => tags
@@ -1,6 +1,4 @@
1
1
  class FileUploader < ApplicationUploader
2
- include ImageSizes
3
-
4
2
  def extension_white_list
5
3
  %w(pdf doc docx xls csv xlsx jpg)
6
4
  end
@@ -13,7 +13,13 @@ class PhotoUploader < ApplicationUploader
13
13
  end
14
14
  end
15
15
 
16
- include ImageSizes
16
+ version :medium do
17
+ process :resize_to_fill => [400, 400]
18
+ end
19
+
20
+ version :small do
21
+ process :resize_to_fill => [100, 100]
22
+ end
17
23
 
18
24
  # FIXME move to tramway-landing uploader
19
25
  version :card do
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.0.4'
3
+ VERSION = '1.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
@@ -227,7 +227,6 @@ files:
227
227
  - app/uploaders/application_uploader.rb
228
228
  - app/uploaders/file_uploader.rb
229
229
  - app/uploaders/image_defaults.rb
230
- - app/uploaders/image_sizes.rb
231
230
  - app/uploaders/photo_uploader.rb
232
231
  - app/views/tramway/core/shared/_messages.html.haml
233
232
  - config/locales/ru/dates.yml
@@ -1,13 +0,0 @@
1
- module ImageSizes
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- version :medium do
6
- process :resize_to_fill => [400, 400]
7
- end
8
-
9
- version :small do
10
- process :resize_to_fill => [100, 100]
11
- end
12
- end
13
- end