refinerycms-images 2.0.10 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/refinery/admin/images_controller.rb +40 -6
- data/app/helpers/refinery/admin/images_helper.rb +2 -2
- data/app/models/refinery/image.rb +40 -21
- data/app/views/refinery/admin/images/_existing_image.html.erb +1 -1
- data/app/views/refinery/admin/images/_form.html.erb +1 -1
- data/app/views/refinery/admin/images/_grid_view.html.erb +2 -2
- data/app/views/refinery/admin/images/_list_view_image.html.erb +1 -1
- data/app/views/refinery/admin/images/_records.html.erb +4 -6
- data/app/views/refinery/admin/images/insert.html.erb +6 -1
- data/config/locales/bg.yml +1 -2
- data/config/locales/cs.yml +1 -2
- data/config/locales/da.yml +1 -2
- data/config/locales/de.yml +1 -2
- data/config/locales/el.yml +1 -2
- data/config/locales/en.yml +2 -2
- data/config/locales/es.yml +1 -2
- data/config/locales/fi.yml +1 -2
- data/config/locales/fr.yml +1 -2
- data/config/locales/hu.yml +44 -0
- data/config/locales/it.yml +1 -1
- data/config/locales/ja.yml +1 -2
- data/config/locales/ko.yml +1 -2
- data/config/locales/lt.yml +1 -2
- data/config/locales/lv.yml +1 -2
- data/config/locales/nb.yml +1 -2
- data/config/locales/nl.yml +15 -15
- data/config/locales/pl.yml +1 -2
- data/config/locales/pt-BR.yml +1 -2
- data/config/locales/pt.yml +44 -0
- data/config/locales/rs.yml +1 -2
- data/config/locales/ru.yml +1 -2
- data/config/locales/sk.yml +2 -3
- data/config/locales/sl.yml +1 -2
- data/config/locales/sv.yml +1 -2
- data/config/locales/tr.yml +44 -0
- data/config/locales/uk.yml +44 -0
- data/config/locales/vi.yml +1 -2
- data/config/locales/zh-CN.yml +3 -4
- data/config/locales/zh-TW.yml +1 -2
- data/config/routes.rb +3 -3
- data/db/migrate/20120625093918_remove_image_ext_from_refinery_images.rb +9 -0
- data/lib/generators/refinery/images/templates/config/initializers/refinery/images.rb.erb +7 -1
- data/lib/refinery/images/configuration.rb +22 -8
- data/lib/refinery/images/dragonfly.rb +13 -10
- data/lib/refinery/images/engine.rb +1 -2
- data/lib/refinery/images/validators.rb +1 -0
- data/lib/refinery/images/validators/image_update_validator.rb +17 -0
- data/refinerycms-images.gemspec +2 -4
- data/spec/factories/image.rb +4 -0
- data/spec/{requests → features}/refinery/admin/images_spec.rb +65 -7
- data/spec/fixtures/beach-alternate.jpeg +0 -0
- data/spec/fixtures/cape-town-tide-table.pdf +0 -0
- data/spec/models/refinery/image_spec.rb +70 -40
- metadata +18 -22
data/config/locales/ko.yml
CHANGED
data/config/locales/lt.yml
CHANGED
@@ -24,8 +24,7 @@ lt:
|
|
24
24
|
switch_to: Persijungti į %{view_name} vaizdą
|
25
25
|
list: sąrašo
|
26
26
|
grid: tinklelio
|
27
|
-
|
28
|
-
view_live_html: Peržiūrėti paveikslėlį <br/><em>Atsirado naujame lange</em>
|
27
|
+
view_live_html: Peržiūrėti paveikslėlį <br/><em>Atsirado naujame lange</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Pridėti
|
31
30
|
resize_image: Keisti paveikslėlio išmatavimus?
|
data/config/locales/lv.yml
CHANGED
@@ -24,8 +24,7 @@ lv:
|
|
24
24
|
switch_to: Pārslēgt uz %{view_name} skatu
|
25
25
|
list: saraksta
|
26
26
|
grid: režģa
|
27
|
-
|
28
|
-
view_live_html: Skatīt šo bildi <br/><em>Atvērsies jaunā logā</em>
|
27
|
+
view_live_html: Skatīt šo bildi <br/><em>Atvērsies jaunā logā</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Ievietot
|
31
30
|
resize_image: Mainīt bildes izmērus?
|
data/config/locales/nb.yml
CHANGED
@@ -24,8 +24,7 @@ nb:
|
|
24
24
|
switch_to: "Endre til %{view_name} visning"
|
25
25
|
list: liste
|
26
26
|
grid: rutenett
|
27
|
-
|
28
|
-
view_live_html: Vis dette bildet <br/><em>Åpner i et nytt vindu</em>
|
27
|
+
view_live_html: Vis dette bildet <br/><em>Åpner i et nytt vindu</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Sett inn
|
31
30
|
resize_image: "Endre størrelsen på bildet? <em>(Anbefales)</em>"
|
data/config/locales/nl.yml
CHANGED
@@ -3,31 +3,31 @@ nl:
|
|
3
3
|
plugins:
|
4
4
|
refinery_images:
|
5
5
|
title: Afbeeldingen
|
6
|
+
description: Afbeeldingen beheren
|
6
7
|
admin:
|
7
8
|
images:
|
8
|
-
delete:
|
9
|
-
edit:
|
9
|
+
delete: Deze afbeelding definitief verwijderen
|
10
|
+
edit: Deze afbeelding bewerken
|
10
11
|
form:
|
11
12
|
image: Afbeelding
|
12
|
-
use_current_image:
|
13
|
+
use_current_image: Huidige afbeelding gebruiken
|
13
14
|
or: of
|
14
|
-
replace_image:
|
15
|
+
replace_image: " vervangen door deze..."
|
15
16
|
current_image: Huidige afbeelding
|
16
|
-
maximum_image_size:
|
17
|
+
maximum_image_size: De maximale afbeeldingssgrootte is %{bytes}.
|
17
18
|
actions:
|
18
|
-
create_new_image:
|
19
|
+
create_new_image: Nieuwe afbeelding toevoegen
|
19
20
|
records:
|
20
|
-
no_images_yet: Er zijn nog geen afbeeldingen. Klik op "
|
21
|
+
no_images_yet: Er zijn nog geen afbeeldingen. Klik op "Nieuwe afbeelding toevoegen" om uw eerste afbleelding toe te voegen.
|
21
22
|
index:
|
22
23
|
view:
|
23
|
-
switch_to:
|
24
|
+
switch_to: De %{view_name}versie bekijken
|
24
25
|
list: lijst
|
25
|
-
grid:
|
26
|
-
|
27
|
-
view_live_html: Bekijk deze afbeelding <br/><em>(opent een nieuw venster)</em>
|
26
|
+
grid: raster
|
27
|
+
view_live_html: Deze afbeelding bekijken <br/><em>Opent in een nieuw venster</em>
|
28
28
|
existing_image:
|
29
29
|
button_text: Invoegen
|
30
|
-
resize_image:
|
30
|
+
resize_image: De afbeelding schalen?
|
31
31
|
size: Grootte
|
32
32
|
insert:
|
33
33
|
existing_image: Bibliotheek
|
@@ -38,6 +38,6 @@ nl:
|
|
38
38
|
errors:
|
39
39
|
models:
|
40
40
|
refinery/image:
|
41
|
-
blank: U moet een afbeelding kiezen om te uploaden
|
42
|
-
too_big: Afbeeldingen mogen niet groter dan %{size} bytes zijn
|
43
|
-
incorrect_format: Uw afbeelding moet een JPG, PNG of GIF zijn
|
41
|
+
blank: U moet een afbeelding kiezen om te uploaden
|
42
|
+
too_big: Afbeeldingen mogen niet groter dan %{size} bytes zijn
|
43
|
+
incorrect_format: Uw afbeelding moet een JPG, PNG of GIF zijn
|
data/config/locales/pl.yml
CHANGED
@@ -25,8 +25,7 @@ pl:
|
|
25
25
|
switch_to: Przełącz do widoku %{view_name}
|
26
26
|
list: lista
|
27
27
|
grid: siatka
|
28
|
-
|
29
|
-
view_live_html: Obejrzyj ten obraz <br/><em>Otwarcie w nowym oknie</em>
|
28
|
+
view_live_html: Obejrzyj ten obraz <br/><em>Otwarcie w nowym oknie</em>
|
30
29
|
existing_image:
|
31
30
|
button_text: Wstaw
|
32
31
|
resize_image: Zmień rozmiar tego obrazu?
|
data/config/locales/pt-BR.yml
CHANGED
@@ -25,8 +25,7 @@ pt-BR:
|
|
25
25
|
switch_to: Trocar para visão em %{view_name}
|
26
26
|
list: lista
|
27
27
|
grid: grade
|
28
|
-
|
29
|
-
view_live_html: "Ver esta imagem<br/><em>Abre em uma nova janela</em>"
|
28
|
+
view_live_html: "Ver esta imagem<br/><em>Abre em uma nova janela</em>"
|
30
29
|
existing_image:
|
31
30
|
button_text: Inserir
|
32
31
|
resize_image: "Redimencionar a imagem?"
|
@@ -0,0 +1,44 @@
|
|
1
|
+
pt:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinery_images:
|
5
|
+
title: "Imagens"
|
6
|
+
description: "Gerir imagens"
|
7
|
+
admin:
|
8
|
+
images:
|
9
|
+
delete: "Apagar esta imagem definitivamente"
|
10
|
+
edit: "Editar esta imagem"
|
11
|
+
form:
|
12
|
+
image: "Imagem"
|
13
|
+
use_current_image: "Usar imagem actual"
|
14
|
+
or: "ou"
|
15
|
+
replace_image: " substituir por esta..."
|
16
|
+
current_image: "Imagem actual"
|
17
|
+
maximum_image_size: "O tamanho máximo é %{bytes}."
|
18
|
+
actions:
|
19
|
+
create_new_image: Adicionar nova imagem
|
20
|
+
records:
|
21
|
+
no_images_yet: 'Ainda não existem imagens. Clique em "Adicionar nova imagem" para adicionar a primeira.'
|
22
|
+
index:
|
23
|
+
view:
|
24
|
+
switch_to: Mudar a disposição para %{view_name}
|
25
|
+
list: lista
|
26
|
+
grid: grelha
|
27
|
+
view_live_html: Ver esta imagem <br/><em>Abre uma nova janela</em>
|
28
|
+
existing_image:
|
29
|
+
button_text: Inserir
|
30
|
+
resize_image: Redimensionar esta imagem?
|
31
|
+
size: Tamanho
|
32
|
+
insert:
|
33
|
+
existing_image: Imagem existente
|
34
|
+
new_image: Carregar nova imagem
|
35
|
+
activerecord:
|
36
|
+
models:
|
37
|
+
refinery/image: Imagem
|
38
|
+
errors:
|
39
|
+
models:
|
40
|
+
refinery/image:
|
41
|
+
blank: "Deve especificar uma imagem para carregar "
|
42
|
+
too_big: "A imagem deve ser menor do que %{size} bytes de tamanho"
|
43
|
+
incorrect_format: 'A imagem deve ser num dos seguintes formatos: JPG, PNG ou GIF'
|
44
|
+
different_file_name: A nova imagem não pode ter um nome diferente
|
data/config/locales/rs.yml
CHANGED
@@ -24,8 +24,7 @@ rs:
|
|
24
24
|
switch_to: Prebaci na %{view_name}
|
25
25
|
list: listu
|
26
26
|
grid: mrežni prikaz
|
27
|
-
|
28
|
-
view_live_html: Pogledaj ovu sliku <br/><em>Otvara se u novom prozoru</em>
|
27
|
+
view_live_html: Pogledaj ovu sliku <br/><em>Otvara se u novom prozoru</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Unesi
|
31
30
|
resize_image: Promeni veličinu slike?
|
data/config/locales/ru.yml
CHANGED
@@ -24,8 +24,7 @@ ru:
|
|
24
24
|
switch_to: Показать %{view_name}
|
25
25
|
list: списком
|
26
26
|
grid: сеткой
|
27
|
-
|
28
|
-
view_live_html: Показать это изображение <br/><em>Откроется в новом окне</em>
|
27
|
+
view_live_html: Показать это изображение <br/><em>Откроется в новом окне</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Вставить
|
31
30
|
resize_image: Изменить размер изображения?
|
data/config/locales/sk.yml
CHANGED
@@ -24,8 +24,7 @@ sk:
|
|
24
24
|
switch_to: Prepnúť pohľad na %{view_name}
|
25
25
|
list: zoznam
|
26
26
|
grid: tabuľka
|
27
|
-
|
28
|
-
view_live_html: Zobraziť obrázok. <br/><em>Otvorí sa v novom okne.</em>
|
27
|
+
view_live_html: Zobraziť obrázok. <br/><em>Otvorí sa v novom okne.</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Vložiť
|
31
30
|
resize_image: Upraviť veľkosť?
|
@@ -42,4 +41,4 @@ sk:
|
|
42
41
|
blank: Musíte zadať obrázok ktorý chcete nahrať.
|
43
42
|
too_big: Maximálna veľkosť obrázku %{size}MB in size.
|
44
43
|
incorrect_format: 'Obrázok musí byť vo formáte JPG, PNG alebo GIF.'
|
45
|
-
different_file_name: Nový obrázok nesmie mať odlišný názov súboru
|
44
|
+
different_file_name: Nový obrázok nesmie mať odlišný názov súboru
|
data/config/locales/sl.yml
CHANGED
@@ -23,8 +23,7 @@ sl:
|
|
23
23
|
switch_to: Preklopi pogled v %{view_name}
|
24
24
|
list: seznam
|
25
25
|
grid: mrežo
|
26
|
-
|
27
|
-
view_live_html: Poglej sliko <br/><em>Odpre se v novem oknu</em>
|
26
|
+
view_live_html: Poglej sliko <br/><em>Odpre se v novem oknu</em>
|
28
27
|
existing_image:
|
29
28
|
button_text: Vstavi
|
30
29
|
resize_image: Spremeni velikost slike?
|
data/config/locales/sv.yml
CHANGED
@@ -24,8 +24,7 @@ sv:
|
|
24
24
|
switch_to: Byt till %{view_name} vyn
|
25
25
|
list: lista
|
26
26
|
grid: rutnät
|
27
|
-
|
28
|
-
view_live_html: Visa den här bilden <br/><em>Öppnas i nytt fönster</em>
|
27
|
+
view_live_html: Visa den här bilden <br/><em>Öppnas i nytt fönster</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Klistra in
|
31
30
|
resize_image: Ändra storlek på bilden?
|
@@ -0,0 +1,44 @@
|
|
1
|
+
tr:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinery_images:
|
5
|
+
title: Resimler
|
6
|
+
description: Resimleri Yonet
|
7
|
+
admin:
|
8
|
+
images:
|
9
|
+
delete: Bu resim dosyasini sonsuza dek sil.
|
10
|
+
edit: Bu resmi duzenle
|
11
|
+
form:
|
12
|
+
image: Resim
|
13
|
+
use_current_image: Varolan resmi kullan
|
14
|
+
or: veya
|
15
|
+
replace_image: " Bununla degisiklik yap .."
|
16
|
+
current_image: Mevcut Resim
|
17
|
+
maximum_image_size: "Maksimum resim boyutu %{bytes}."
|
18
|
+
actions:
|
19
|
+
create_new_image: Yeni Resim Ekle
|
20
|
+
records:
|
21
|
+
no_images_yet:Henuz bir resim yok. "Yeni Resim Ekle" ye basarak ilk resminizi ekleyin.
|
22
|
+
index:
|
23
|
+
view:
|
24
|
+
switch_to: "%{view_name} gorunumu ac"
|
25
|
+
list: Liste
|
26
|
+
grid: Izgara
|
27
|
+
view_live_html: Bu Resmi goruntule <br/><em>yeni bir pencerede acar</em>
|
28
|
+
existing_image:
|
29
|
+
button_text: Cikart
|
30
|
+
resize_image: Resimi yeniden boyutlandir?
|
31
|
+
size: Ebat
|
32
|
+
insert:
|
33
|
+
existing_image: Kutuphane
|
34
|
+
new_image: Yukle
|
35
|
+
activerecord:
|
36
|
+
models:
|
37
|
+
refinery/image: "resim"
|
38
|
+
errors:
|
39
|
+
models:
|
40
|
+
refinery/image:
|
41
|
+
blank: Yukleme yapabilmek icin bir resim belirtmeniz gerekmektedir
|
42
|
+
too_big: "Resim %{size} den daha kucuk boyutta olmalidir"
|
43
|
+
incorrect_format: 'Sectiginiz secmin formati JPG, PNG, GIF olmak zorunda'
|
44
|
+
different_file_name: Yeni resim baska bir dosya ismi iceremez
|
@@ -0,0 +1,44 @@
|
|
1
|
+
uk:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinery_images:
|
5
|
+
title: Зображення
|
6
|
+
description: Управління зображеннями
|
7
|
+
article: neuter
|
8
|
+
admin:
|
9
|
+
images:
|
10
|
+
delete: Видалити це зображення назавжди
|
11
|
+
edit: Редагувати це зображення
|
12
|
+
form:
|
13
|
+
image: Зображення
|
14
|
+
use_current_image: Використовувати поточне зображення
|
15
|
+
or: або
|
16
|
+
replace_image: " замінити його цим"
|
17
|
+
current_image: Поточне зображення
|
18
|
+
maximum_image_size: "Максимальний розмір зображення — %{bytes}."
|
19
|
+
actions:
|
20
|
+
create_new_image: Створити нове зображення
|
21
|
+
records:
|
22
|
+
no_images_yet: "Зображень поки що немає. Натисніть «Створити нове зображення», щоб додати зображення."
|
23
|
+
index:
|
24
|
+
view:
|
25
|
+
switch_to: Показати %{view_name}
|
26
|
+
list: списком
|
27
|
+
grid: сіткою
|
28
|
+
view_live_html: Показати це зображення <br/><em>Відкриється в новому вікні</em>
|
29
|
+
existing_image:
|
30
|
+
button_text: Вставити
|
31
|
+
resize_image: Змінити розмір зображення?
|
32
|
+
size: Розмір
|
33
|
+
insert:
|
34
|
+
existing_image: Існуюче зображення
|
35
|
+
new_image: Нове зображення
|
36
|
+
activerecord:
|
37
|
+
models:
|
38
|
+
refinery/image: зображення
|
39
|
+
errors:
|
40
|
+
models:
|
41
|
+
refinery/image:
|
42
|
+
blank: Ви повинні вибрати файл для завантаження
|
43
|
+
too_big: "Розмір файлу повинен бути меншим за %{size} МБ"
|
44
|
+
incorrect_format: "Ваше зображення може бути тільки у форматах JPG, PNG чи GIF"
|
data/config/locales/vi.yml
CHANGED
@@ -24,8 +24,7 @@ vi:
|
|
24
24
|
switch_to: Đổi sang kiểu xem %{view_name}
|
25
25
|
list: danh sách
|
26
26
|
grid: lưới
|
27
|
-
|
28
|
-
view_live_html: Xem ảnh này <br/><em>Mở trong cửa sổ mới</em>
|
27
|
+
view_live_html: Xem ảnh này <br/><em>Mở trong cửa sổ mới</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: Chèn
|
31
30
|
resize_image: Đổi kích thước ảnh?
|
data/config/locales/zh-CN.yml
CHANGED
@@ -24,8 +24,7 @@ zh-CN:
|
|
24
24
|
switch_to: 切换到 %{view_name} 视图
|
25
25
|
list: 列表
|
26
26
|
grid: 表格
|
27
|
-
|
28
|
-
view_live_html: 查看此图片 <br/><em>新窗口打开</em>
|
27
|
+
view_live_html: 查看此图片 <br/><em>新窗口打开</em>
|
29
28
|
existing_image:
|
30
29
|
button_text: 插入
|
31
30
|
resize_image: 调整图片尺寸?
|
@@ -39,6 +38,6 @@ zh-CN:
|
|
39
38
|
errors:
|
40
39
|
models:
|
41
40
|
refinery/image:
|
42
|
-
blank:
|
41
|
+
blank: 您没有选择图片,无法上传。
|
43
42
|
too_big: 图片应该小于 %{size} MB 大小
|
44
|
-
incorrect_format: '
|
43
|
+
incorrect_format: '图片格式必须是JPG, PNG 或者 GIF'
|
data/config/locales/zh-TW.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
Refinery::Core::Engine.routes.
|
2
|
-
|
1
|
+
Refinery::Core::Engine.routes.draw do
|
2
|
+
get '/system/images/*dragonfly', :to => Dragonfly[:refinery_images]
|
3
3
|
|
4
|
-
namespace :admin, :path =>
|
4
|
+
namespace :admin, :path => Refinery::Core.backend_route do
|
5
5
|
resources :images, :except => :show do
|
6
6
|
get :insert, :on => :collection
|
7
7
|
end
|
@@ -31,7 +31,7 @@ Refinery::Images.configure do |config|
|
|
31
31
|
# config.s3_bucket_name = ENV['S3_BUCKET']
|
32
32
|
# config.s3_access_key_id = ENV['S3_KEY']
|
33
33
|
# config.s3_secret_access_key = ENV['S3_SECRET']
|
34
|
-
# config.s3_region = ENV['S3_REGION]
|
34
|
+
# config.s3_region = ENV['S3_REGION']
|
35
35
|
|
36
36
|
# Configure Dragonfly
|
37
37
|
# This is where in the middleware stack to insert the Dragonfly middleware
|
@@ -39,7 +39,13 @@ Refinery::Images.configure do |config|
|
|
39
39
|
# config.dragonfly_secret = <%= Refinery::Images.dragonfly_secret.inspect %>
|
40
40
|
# If you decide to trust file extensions replace :ext below with :format
|
41
41
|
# config.dragonfly_url_format = <%= Refinery::Images.dragonfly_url_format.inspect %>
|
42
|
+
# config.dragonfly_url_host = <%= Refinery::Images.dragonfly_url_host.inspect %>
|
42
43
|
# config.datastore_root_path = <%= Refinery::Images.datastore_root_path.inspect %>
|
43
44
|
# config.trust_file_extensions = <%= Refinery::Images.trust_file_extensions.inspect %>
|
44
45
|
|
46
|
+
# Configure Dragonfly custom storage backend
|
47
|
+
# The custom_backend setting by default defers to the core setting for this but can be set just for images.
|
48
|
+
# config.custom_backend_class = <%= Refinery::Images.custom_backend_class.inspect %>
|
49
|
+
# config.custom_backend_opts = <%= Refinery::Images.custom_backend_opts.inspect %>
|
50
|
+
|
45
51
|
end
|
@@ -2,18 +2,20 @@ module Refinery
|
|
2
2
|
module Images
|
3
3
|
include ActiveSupport::Configurable
|
4
4
|
|
5
|
-
config_accessor :dragonfly_insert_before, :dragonfly_secret, :dragonfly_url_format,
|
5
|
+
config_accessor :dragonfly_insert_before, :dragonfly_secret, :dragonfly_url_format, :dragonfly_url_host,
|
6
6
|
:max_image_size, :pages_per_dialog, :pages_per_admin_index,
|
7
7
|
:pages_per_dialog_that_have_size_options, :user_image_sizes,
|
8
8
|
:image_views, :preferred_image_view, :datastore_root_path,
|
9
9
|
:s3_backend, :s3_bucket_name, :s3_region,
|
10
10
|
:s3_access_key_id, :s3_secret_access_key, :trust_file_extensions,
|
11
|
-
:whitelisted_mime_types
|
11
|
+
:whitelisted_mime_types,
|
12
|
+
:custom_backend_class, :custom_backend_opts
|
12
13
|
|
13
14
|
self.dragonfly_insert_before = 'ActionDispatch::Callbacks'
|
14
|
-
self.dragonfly_secret =
|
15
|
+
self.dragonfly_secret = Core.dragonfly_secret
|
15
16
|
# If you decide to trust file extensions replace :ext below with :format
|
16
17
|
self.dragonfly_url_format = '/system/images/:job/:basename.:ext'
|
18
|
+
self.dragonfly_url_host = ''
|
17
19
|
self.trust_file_extensions = false
|
18
20
|
|
19
21
|
self.max_image_size = 5242880
|
@@ -39,23 +41,35 @@ module Refinery
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def s3_backend
|
42
|
-
config.s3_backend.
|
44
|
+
config.s3_backend.presence || Core.s3_backend
|
43
45
|
end
|
44
46
|
|
45
47
|
def s3_bucket_name
|
46
|
-
config.s3_bucket_name.
|
48
|
+
config.s3_bucket_name.presence || Core.s3_bucket_name
|
47
49
|
end
|
48
50
|
|
49
51
|
def s3_access_key_id
|
50
|
-
config.s3_access_key_id.
|
52
|
+
config.s3_access_key_id.presence || Core.s3_access_key_id
|
51
53
|
end
|
52
54
|
|
53
55
|
def s3_secret_access_key
|
54
|
-
config.s3_secret_access_key.
|
56
|
+
config.s3_secret_access_key.presence || Core.s3_secret_access_key
|
55
57
|
end
|
56
58
|
|
57
59
|
def s3_region
|
58
|
-
config.s3_region.
|
60
|
+
config.s3_region.presence || Core.s3_region
|
61
|
+
end
|
62
|
+
|
63
|
+
def custom_backend?
|
64
|
+
config.custom_backend_class.nil? ? Core.dragonfly_custom_backend? : config.custom_backend_class.present?
|
65
|
+
end
|
66
|
+
|
67
|
+
def custom_backend_class
|
68
|
+
config.custom_backend_class.nil? ? Core.dragonfly_custom_backend_class : config.custom_backend_class.constantize
|
69
|
+
end
|
70
|
+
|
71
|
+
def custom_backend_opts
|
72
|
+
config.custom_backend_opts.presence || Core.dragonfly_custom_backend_opts
|
59
73
|
end
|
60
74
|
|
61
75
|
end
|