lolita-file-upload 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -1,7 +1,12 @@
1
1
  class FileUploader < CarrierWave::Uploader::Base
2
+ include CarrierWave::MiniMagick
2
3
  storage :file
3
4
  after :remove, :delete_empty_upstream_dirs
4
5
 
6
+ version :normalized do
7
+ process :resize_to_fit => [600,600]
8
+ end
9
+
5
10
  def timestamp
6
11
  time=if model
7
12
  model.created_at || Time.now
@@ -1,6 +1,7 @@
1
1
  <td style="margin-top: 3px; border-bottom: 2px solid #E1E1E1; width: 600px;font-weight: bold; color: #737373; font-size: 14px; padding: 7px 20px; vertical-align: middle;">
2
2
  <% if file.send(tab.uploader).to_s =~ /(jpg|jpeg|png|gif)$/i %>
3
- <%= link_to image_tag(file.send(tab.uploader).url, :style=>"width:300px; height 160px;"), file.send(tab.uploader).url %>
3
+ <% url = file.send(tab.uploader).normalized.url.blank? ? file.send(tab.uploader).url : file.send(tab.uploader).normalized.url
4
+ <%= link_to image_tag(url, :style=>"width:300px; height 160px;"), url %>
4
5
  <% else %>
5
6
  <%= link_to file.send(tab.uploader).url, file.send(tab.uploader).url %>
6
7
  <% end %>
@@ -27,7 +27,8 @@
27
27
  - files = tab.association_type == :one ? [resource.send(tab.association.name)].compact : resource.send(tab.association.name)
28
28
  - files.each do |file|
29
29
  - if file.send(tab.uploader).to_s =~ /(jpg|jpeg|png|gif)$/i
30
- = image_tag(file.send(tab.uploader).url)
30
+ - url = file.send(tab.uploader).normalized.url.blank? ? file.send(tab.uploader).url : file.send(tab.uploader).normalized.url
31
+ = image_tag(url)
31
32
  - else
32
33
  = link_to file.send(tab.uploader).url, file.send(tab.uploader).url
33
34
  %button{:onclick=>"$('#fixed-gallery').hide();"}Aizvērt
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lolita-file-upload}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ITHouse", "Arturs Meisters"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolita-file-upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: lolita
18
- requirement: &72861840 !ruby/object:Gem::Requirement
18
+ requirement: &83402170 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.1.9
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *72861840
26
+ version_requirements: *83402170
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: carrierwave
29
- requirement: &72861390 !ruby/object:Gem::Requirement
29
+ requirement: &83401600 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 0.5.2
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *72861390
37
+ version_requirements: *83401600
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: cucumber
40
- requirement: &72861100 !ruby/object:Gem::Requirement
40
+ requirement: &83400670 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ~>
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0.10'
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *72861100
48
+ version_requirements: *83400670
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: cucumber-rails
51
- requirement: &72860730 !ruby/object:Gem::Requirement
51
+ requirement: &83399990 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 0.5.2
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *72860730
59
+ version_requirements: *83399990
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: bundler
62
- requirement: &72860220 !ruby/object:Gem::Requirement
62
+ requirement: &83399420 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '1.0'
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *72860220
70
+ version_requirements: *83399420
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: jeweler
73
- requirement: &72859630 !ruby/object:Gem::Requirement
73
+ requirement: &83398860 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,7 +78,7 @@ dependencies:
78
78
  version: '1.5'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *72859630
81
+ version_requirements: *83398860
82
82
  description: File upload gem for Lolita with with fulll integration - models, controller,
83
83
  views
84
84
  email: support@ithouse.lv
@@ -188,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  segments:
190
190
  - 0
191
- hash: 115590957
191
+ hash: -355083647
192
192
  required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements: