refinerycms-images 0.9.9.21 → 0.9.9.22
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/images_controller.rb +2 -2
- data/app/views/admin/images/_actions.html.erb +2 -2
- data/app/views/admin/images/_existing_image.html.erb +1 -1
- data/config/locales/fi.yml +4 -4
- data/lib/gemspec.rb +1 -1
- data/lib/refinerycms-images.rb +17 -16
- data/refinerycms-images.gemspec +4 -4
- metadata +7 -6
@@ -13,14 +13,14 @@ module Admin
|
|
13
13
|
def new
|
14
14
|
@image = Image.new if @image.nil?
|
15
15
|
|
16
|
-
@url_override =
|
16
|
+
@url_override = admin_images_path(:dialog => from_dialog?)
|
17
17
|
end
|
18
18
|
|
19
19
|
# This renders the image insert dialog
|
20
20
|
def insert
|
21
21
|
self.new if @image.nil?
|
22
22
|
|
23
|
-
@url_override =
|
23
|
+
@url_override = admin_images_path(request.query_parameters.merge(:insert => true))
|
24
24
|
|
25
25
|
if params[:conditions].present?
|
26
26
|
extra_condition = params[:conditions].split(',')
|
@@ -3,13 +3,13 @@
|
|
3
3
|
<%= render :partial => "/shared/admin/search", :locals => {:url => admin_images_url} %>
|
4
4
|
</li>
|
5
5
|
<li>
|
6
|
-
<%= link_to t('.create_new_image'),
|
6
|
+
<%= link_to t('.create_new_image'), new_admin_image_path(:dialog => true, :width => 600, :height => 300),
|
7
7
|
:class => "add_icon" %>
|
8
8
|
</li>
|
9
9
|
<% other_image_views.each do |image_view| %>
|
10
10
|
<li>
|
11
11
|
<%= link_to t('switch_to', :scope => 'admin.images.index.view', :view_name => t("#{image_view}", :scope => 'admin.images.index.view')),
|
12
|
-
|
12
|
+
admin_images_path(:view => image_view, :page => params[:page]),
|
13
13
|
:class => "reorder_icon" %>
|
14
14
|
</li>
|
15
15
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id='existing_image_area' class='dialog_area' <%= "style='display:none;'" if @image.errors.any? %>>
|
2
2
|
<%= render :partial => '/shared/admin/search',
|
3
|
-
:locals => {:url =>
|
3
|
+
:locals => {:url => insert_admin_images_path(params.dup.delete(:image))} %>
|
4
4
|
<input type='hidden' name='selected_image' id='selected_image' />
|
5
5
|
<div id='existing_image_area_content' class='clearfix'>
|
6
6
|
<% if @images.any? %>
|
data/config/locales/fi.yml
CHANGED
@@ -20,9 +20,9 @@ fi:
|
|
20
20
|
no_images_yet: Kuvia ei ole vielä lisätty. Paina "Lisää uusi kuva-" nappia lisätäksesi ensimmäisen kuvan.
|
21
21
|
index:
|
22
22
|
view:
|
23
|
-
switch_to: "
|
24
|
-
list:
|
25
|
-
grid:
|
23
|
+
switch_to: "%{view_name}näkymä"
|
24
|
+
list: Lista
|
25
|
+
grid: Ruudukko
|
26
26
|
grid_view:
|
27
27
|
view_live_html: Katsele tätä kuvaa <br/><em>Avautuu uudessa ikkunassa</em>
|
28
28
|
existing_image:
|
@@ -34,7 +34,7 @@ fi:
|
|
34
34
|
new_image: Lisää
|
35
35
|
activerecord:
|
36
36
|
models:
|
37
|
-
image:
|
37
|
+
image: kuva
|
38
38
|
errors:
|
39
39
|
models:
|
40
40
|
image:
|
data/lib/gemspec.rb
CHANGED
data/lib/refinerycms-images.rb
CHANGED
@@ -23,31 +23,32 @@ module Refinery
|
|
23
23
|
app_images.configure_with(:imagemagick)
|
24
24
|
app_images.configure_with(:rails) do |c|
|
25
25
|
c.datastore.root_path = Rails.root.join('public', 'system', 'images').to_s
|
26
|
-
|
26
|
+
# This url_format it so that dragonfly urls work in traditional
|
27
|
+
# situations where the filename and extension are required, e.g. lightbox.
|
28
|
+
# What this does is takes the url that is about to be produced e.g.
|
29
|
+
# /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
|
30
|
+
# and adds the filename onto the end (say the image was 'refinery_is_awesome.jpg')
|
31
|
+
# /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
|
32
|
+
c.url_format = '/system/images/:job/:basename.:format'
|
27
33
|
c.secret = RefinerySetting.find_or_set(:dragonfly_secret,
|
28
34
|
Array.new(24) { rand(256) }.pack('C*').unpack('H*').first)
|
29
35
|
end
|
30
|
-
|
36
|
+
|
37
|
+
if Refinery.s3_backend
|
38
|
+
app_images.configure_with(:heroku, ENV['S3_BUCKET'])
|
39
|
+
# Dragonfly doesn't set the S3 region, so we have to do this manually
|
40
|
+
app_images.datastore.configure do |d|
|
41
|
+
d.region = ENV['S3_REGION'] if ENV['S3_REGION'] # otherwise defaults to 'us-east-1'
|
42
|
+
end
|
43
|
+
end
|
31
44
|
|
32
45
|
app_images.define_macro(ActiveRecord::Base, :image_accessor)
|
33
|
-
app_images.analyser.register(Dragonfly::
|
46
|
+
app_images.analyser.register(Dragonfly::ImageMagick::Analyser)
|
34
47
|
app_images.analyser.register(Dragonfly::Analysis::FileCommandAnalyser)
|
35
48
|
|
36
|
-
# This url_suffix makes it so that dragonfly urls work in traditional
|
37
|
-
# situations where the filename and extension are required, e.g. lightbox.
|
38
|
-
# What this does is takes the url that is about to be produced e.g.
|
39
|
-
# /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
|
40
|
-
# and adds the filename onto the end (say the image was 'refinery_is_awesome.jpg')
|
41
|
-
# /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
|
42
|
-
# Officially the way to do it, from: http://markevans.github.com/dragonfly/file.URLs.html
|
43
|
-
app_images.url_suffix = proc{|job|
|
44
|
-
object_file_name = job.uid_basename.gsub(%r{^(\d{4}|\d{2})[_/]\d{2}[_/]\d{2}[_/]\d{2,3}[_/](\d{2}/\d{2}/\d{3}/)?}, '')
|
45
|
-
"/#{object_file_name}#{job.encoded_extname || job.uid_extname}"
|
46
|
-
}
|
47
|
-
|
48
49
|
### Extend active record ###
|
49
50
|
|
50
|
-
app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :images
|
51
|
+
app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :images
|
51
52
|
|
52
53
|
app.config.middleware.insert_before 'Dragonfly::Middleware', 'Rack::Cache', {
|
53
54
|
:verbose => Rails.env.development?,
|
data/refinerycms-images.gemspec
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinerycms-images}
|
5
|
-
s.version = %q{0.9.9.
|
5
|
+
s.version = %q{0.9.9.22}
|
6
6
|
s.summary = %q{Images engine for Refinery CMS}
|
7
7
|
s.description = %q{Handles all image upload and processing functionality in Refinery CMS.}
|
8
|
-
s.date = %q{2011-05-
|
8
|
+
s.date = %q{2011-05-22}
|
9
9
|
s.email = %q{info@refinerycms.com}
|
10
10
|
s.homepage = %q{http://refinerycms.com}
|
11
11
|
s.rubyforge_project = %q{refinerycms}
|
@@ -95,7 +95,7 @@ Gem::Specification.new do |s|
|
|
95
95
|
'spec/uploads/beach.jpeg'
|
96
96
|
]
|
97
97
|
|
98
|
-
s.add_dependency 'refinerycms-core', '= 0.9.9.
|
99
|
-
s.add_dependency 'dragonfly', '~> 0.
|
98
|
+
s.add_dependency 'refinerycms-core', '= 0.9.9.22'
|
99
|
+
s.add_dependency 'dragonfly', '~> 0.9.0'
|
100
100
|
s.add_dependency 'rack-cache', '>= 0.5.3'
|
101
101
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: refinerycms-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.9.
|
5
|
+
version: 0.9.9.22
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Resolve Digital
|
@@ -13,7 +13,8 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2011-05-
|
16
|
+
date: 2011-05-22 00:00:00 +12:00
|
17
|
+
default_executable:
|
17
18
|
dependencies:
|
18
19
|
- !ruby/object:Gem::Dependency
|
19
20
|
name: refinerycms-core
|
@@ -23,7 +24,7 @@ dependencies:
|
|
23
24
|
requirements:
|
24
25
|
- - "="
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.9.9.
|
27
|
+
version: 0.9.9.22
|
27
28
|
type: :runtime
|
28
29
|
version_requirements: *id001
|
29
30
|
- !ruby/object:Gem::Dependency
|
@@ -34,7 +35,7 @@ dependencies:
|
|
34
35
|
requirements:
|
35
36
|
- - ~>
|
36
37
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.
|
38
|
+
version: 0.9.0
|
38
39
|
type: :runtime
|
39
40
|
version_requirements: *id002
|
40
41
|
- !ruby/object:Gem::Dependency
|
@@ -113,6 +114,7 @@ files:
|
|
113
114
|
- refinerycms-images.gemspec
|
114
115
|
- spec/models/image_spec.rb
|
115
116
|
- spec/uploads/beach.jpeg
|
117
|
+
has_rdoc: true
|
116
118
|
homepage: http://refinerycms.com
|
117
119
|
licenses:
|
118
120
|
- MIT
|
@@ -136,10 +138,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
138
|
requirements: []
|
137
139
|
|
138
140
|
rubyforge_project: refinerycms
|
139
|
-
rubygems_version: 1.
|
141
|
+
rubygems_version: 1.6.2
|
140
142
|
signing_key:
|
141
143
|
specification_version: 3
|
142
144
|
summary: Images engine for Refinery CMS
|
143
145
|
test_files: []
|
144
146
|
|
145
|
-
has_rdoc:
|