refinerycms-resources 0.9.9.1
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.
- data/app/controllers/admin/resources_controller.rb +89 -0
- data/app/models/resource.rb +53 -0
- data/app/views/admin/resources/_existing_resource.html.erb +32 -0
- data/app/views/admin/resources/_form.html.erb +55 -0
- data/app/views/admin/resources/_resource.html.erb +17 -0
- data/app/views/admin/resources/_resources.html.erb +10 -0
- data/app/views/admin/resources/edit.html.erb +1 -0
- data/app/views/admin/resources/index.html.erb +31 -0
- data/app/views/admin/resources/insert.html.erb +54 -0
- data/app/views/admin/resources/new.html.erb +1 -0
- data/config/locales/cs.yml +34 -0
- data/config/locales/da.yml +34 -0
- data/config/locales/de.yml +34 -0
- data/config/locales/el.yml +34 -0
- data/config/locales/en.yml +34 -0
- data/config/locales/es.yml +33 -0
- data/config/locales/fr.yml +34 -0
- data/config/locales/it.yml +43 -0
- data/config/locales/lolcat.yml +34 -0
- data/config/locales/lt.yml +34 -0
- data/config/locales/lv.yml +34 -0
- data/config/locales/nb.yml +34 -0
- data/config/locales/nl.yml +33 -0
- data/config/locales/pl.yml +35 -0
- data/config/locales/pt-BR.yml +34 -0
- data/config/locales/rs.yml +35 -0
- data/config/locales/ru.yml +34 -0
- data/config/locales/sl.yml +33 -0
- data/config/locales/sv.yml +34 -0
- data/config/locales/vi.yml +34 -0
- data/config/locales/zh-CN.yml +34 -0
- data/config/locales/zh-TW.yml +34 -0
- data/config/routes.rb +13 -0
- data/db/migrate/20100913234709_create_refinerycms_resources_schema.rb +21 -0
- data/features/manage_files.feature +43 -0
- data/features/step_definitions/file_steps.rb +21 -0
- data/features/support/paths.rb +17 -0
- data/features/uploads/beach.jpeg +0 -0
- data/features/uploads/refinery_is_awesome.txt +1 -0
- data/lib/gemspec.rb +35 -0
- data/lib/generators/refinerycms_resources_generator.rb +8 -0
- data/lib/refinerycms-resources.rb +68 -0
- data/license.md +21 -0
- data/readme.md +9 -0
- data/refinerycms-resources.gemspec +90 -0
- data/spec/models/resource_spec.rb +91 -0
- data/spec/uploads/refinery_is_awesome.txt +1 -0
- metadata +137 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
lolcat:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: FILEZ
|
5
|
+
description: UPLOAD AN LINK 2 FILEZ
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: REMOOV DIS FILE FOREVR
|
9
|
+
edit: EDIT DIS FILE
|
10
|
+
form:
|
11
|
+
download_current: DOWNLOAD CURRENT FILE
|
12
|
+
or: OR
|
13
|
+
replace: " REPLACE IT WIF DIS WAN..."
|
14
|
+
maximum_file_size: TEH MAXIMUM FILE SIZE IZ %{megabytes} MEGABYTEZ.
|
15
|
+
resource:
|
16
|
+
download: DOWNLOAD DIS FILE (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: UPLOAD NEW FILE
|
19
|
+
no_files_yet: THAR R NO FILEZ YET. CLICK "UPLOAD NEW FILEZ" 2 ADD UR FURST FILE.
|
20
|
+
insert:
|
21
|
+
existing: EXISTIN FILE
|
22
|
+
new: NEW FILE
|
23
|
+
no_files: THAR R NO FILEZ.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: LINK 2 DIS FILE
|
26
|
+
button_text: INSERT
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: FILE
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: U MUST SPECIFY FILE 4 UPLOAD
|
34
|
+
too_long: FILE SHUD BE SMALLR THAN %{count} IN SIZE
|
@@ -0,0 +1,34 @@
|
|
1
|
+
lt:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Failai
|
5
|
+
description: Įkelti ir sukurti nuorodą į failus
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Pašalinti failą visam laikui
|
9
|
+
edit: Redaguoti failą
|
10
|
+
form:
|
11
|
+
download_current: Parsisiųsti failą
|
12
|
+
or: arba
|
13
|
+
replace: " pakeisti jį šiuo..."
|
14
|
+
maximum_file_size: Maksimalus failo dydis yra %{megabytes} megabaitų.
|
15
|
+
resource:
|
16
|
+
download: Parsisiųsti failą (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Įkelti naują failą
|
19
|
+
no_files_yet: Dar nėra failų. Paspauskite "Įkelti naują failą" norėdami pridėti pirmąjį failą.
|
20
|
+
insert:
|
21
|
+
existing: Egzistuojantis failas
|
22
|
+
new: Naujas failas
|
23
|
+
no_files: Nėra failų.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Nuoroda į šį failą
|
26
|
+
button_text: Įterpti
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: failas
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Nurodykite failą įkėlimui
|
34
|
+
too_long: Failas turėtų būti mažesnio dydžio nei %{count}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
lv:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Faili
|
5
|
+
description: Failu augšupielāde un sasaiste
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Dzēst šo failu
|
9
|
+
edit: Labot šo failu
|
10
|
+
form:
|
11
|
+
download_current: Lejupielādēt pašreizējo failu
|
12
|
+
or: vai
|
13
|
+
replace: " aizstāt to ar šo..."
|
14
|
+
maximum_file_size: Maksimāli pieļaujamais faila izmērs ir %{megabytes} megabaiti.
|
15
|
+
resource:
|
16
|
+
download: Lejupielādēt šo failu (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Augšupielādēt failu
|
19
|
+
no_files_yet: Vēl nav neviena faila. Spied "Augšupielādēt failu", lai ielādētu failu.
|
20
|
+
insert:
|
21
|
+
existing: Esošs Fails
|
22
|
+
new: Jauns Fails
|
23
|
+
no_files: Nav neviena faila.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Saite uz šo failu
|
26
|
+
button_text: Ievietot
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: fails
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Jānorāda fails pirms augšupielādes
|
34
|
+
too_long: Faila izmēram jābūt mazākam par %{count}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
nb:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Filer
|
5
|
+
description: Last opp og link til filer
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Fjern denne filen permanent
|
9
|
+
edit: Rediger denne filen
|
10
|
+
form:
|
11
|
+
download_current: Last ned gjeldende fil
|
12
|
+
or: eller
|
13
|
+
replace: " erstatt den med denne..."
|
14
|
+
maximum_file_size: Største tillatte filstørrelse er %{megabytes} MB.
|
15
|
+
resource:
|
16
|
+
download: Last ned denne filen (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Last opp en ny fil
|
19
|
+
no_files_yet: Det er ingen filer her enda. Klikk på "Last opp en ny fil" for å legge til din første fil.
|
20
|
+
insert:
|
21
|
+
existing: Eksisterende fil
|
22
|
+
new: Ny fil
|
23
|
+
no_files: Det er ingen filer.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Link til denne filen
|
26
|
+
button_text: Legg inn
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: fil
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Du må angi en fil som skal lastes opp
|
34
|
+
too_long: Filstørrelsen må være mindre enn %{count}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
nl:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Bestanden
|
5
|
+
admin:
|
6
|
+
resources:
|
7
|
+
delete: Verwijder dit bestand voorgoed
|
8
|
+
edit: Bewerk dit bestand
|
9
|
+
form:
|
10
|
+
download_current: Download het huidige bestand
|
11
|
+
or: of
|
12
|
+
replace: ", vervang het door dit..."
|
13
|
+
maximum_file_size: "The maximum file size is %{megabytes} megabytes."
|
14
|
+
resource:
|
15
|
+
download: Download dit bestand (%{size})
|
16
|
+
index:
|
17
|
+
upload_new: Upload een nieuw bestand.
|
18
|
+
no_files_yet: Er zijn nog geen bestanden. Klik op "Upload een nieuw bestand" om uw eerste bestand toe te voegen.
|
19
|
+
insert:
|
20
|
+
existing: Bestaand bestand
|
21
|
+
new: Nieuw bestand
|
22
|
+
no_files: Er zijn geen bestanden
|
23
|
+
existing_resource:
|
24
|
+
link_to_file: Link naar dit bestand
|
25
|
+
button_text: Invoegen
|
26
|
+
activerecord:
|
27
|
+
models:
|
28
|
+
resource: bestand
|
29
|
+
errors:
|
30
|
+
models:
|
31
|
+
resource:
|
32
|
+
blank: U moet een bestand kiezen dat u wilt uploaden.
|
33
|
+
too_long: Bestanden mogen niet groter dan %{count} zijn.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
pl:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Pliki
|
5
|
+
description: Wgrywaj i linkuj do plików
|
6
|
+
article: masculine
|
7
|
+
admin:
|
8
|
+
resources:
|
9
|
+
delete: Na zawsze usuń ten plik
|
10
|
+
edit: Zmień ten plik
|
11
|
+
form:
|
12
|
+
download_current: Pobierz obecny plik
|
13
|
+
or: or
|
14
|
+
replace: " zastąp go tym..."
|
15
|
+
maximum_file_size: Maksymalny rozmiaj plik to %{megabytes} megabajtów.
|
16
|
+
resource:
|
17
|
+
download: Pobierz ten plik (%{size})
|
18
|
+
index:
|
19
|
+
upload_new: Wgraj nowe pliki
|
20
|
+
no_files_yet: Nie ma jeszcze żadnych plików. Kliknij "Wgraj nowe pliki" aby dodać pierwszy.
|
21
|
+
insert:
|
22
|
+
existing: Istniejący plik
|
23
|
+
new: Nowy plik
|
24
|
+
no_files: Nie ma żadnych plików
|
25
|
+
existing_resource:
|
26
|
+
link_to_file: Linkuj do tego pliku
|
27
|
+
button_text: Wstaw
|
28
|
+
activerecord:
|
29
|
+
models:
|
30
|
+
resource: plik
|
31
|
+
errors:
|
32
|
+
models:
|
33
|
+
resource:
|
34
|
+
blank: Musisz określić plik do wgrania
|
35
|
+
too_long: Plik powinien być mniejszy niż %{count}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
pt-BR:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Arquivos
|
5
|
+
description: Gerenciar arquivos
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Remover este arquivo para sempre
|
9
|
+
edit: Editar este arquivo
|
10
|
+
form:
|
11
|
+
download_current: Baixar arquivo atual
|
12
|
+
or: or
|
13
|
+
replace: " substituir por este..."
|
14
|
+
maximum_file_size: "O tamanho máximo permitido é de %{megabytes} megabytes."
|
15
|
+
resource:
|
16
|
+
download: Baixar este arquivo (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Enviar Novo Arquivo
|
19
|
+
no_files_yet: Ainda não existem arquivos. Clique em "Enviar Novo Arquivo" para adicionar seu primeiro arquivo.
|
20
|
+
insert:
|
21
|
+
existing: O Arquivo já existe.
|
22
|
+
new: Novo Arquivo
|
23
|
+
no_files: TNão há arquivos.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Link para este Arquivo
|
26
|
+
button_text: Inserir
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: Arquivo
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Você deve escolher um arquivo para enviar
|
34
|
+
too_long: "Arquivos devem ser menores que %{count} em tamanho"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
rs:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Fajlovi
|
5
|
+
description: Upload-uj i linkuj fajlove
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Ukloni ovaj fajl zauvek
|
9
|
+
edit: Izmeni fajl
|
10
|
+
form:
|
11
|
+
download_current: Download-uj fajl
|
12
|
+
or: ili
|
13
|
+
replace: " zameni sa ovim..."
|
14
|
+
maximum_file_size: Maksimalna veličina fajla je %{megabytes} megabajta.
|
15
|
+
resource:
|
16
|
+
download: Download-uj fajl (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Upload-uj novi fajl
|
19
|
+
no_files_yet: Ne postoje fajlovi. Klikni "Upload-uj novi fajl" da dodaš.
|
20
|
+
insert:
|
21
|
+
existing: Postojeći fajl
|
22
|
+
new: Novi fajl
|
23
|
+
no_files: Ne postoje fajlovi.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Linkuj na ovaj fajl
|
26
|
+
button_text: Unesi
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: fajl
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Moraš izabrati fajl za upload
|
34
|
+
too_long: Fajl bi trebalo da je manji od %{count}
|
35
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
ru:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Файлы
|
5
|
+
article: masculine
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Удалить этот файл навсегда
|
9
|
+
edit: Редактировать этот файл
|
10
|
+
form:
|
11
|
+
download_current: Скачать текущий файл
|
12
|
+
or: или
|
13
|
+
replace: " заменить его этим"
|
14
|
+
maximum_file_size: "Максимальный размер файла — %{megabytes} МБ."
|
15
|
+
resource:
|
16
|
+
download: "Скачать файл (%{size})"
|
17
|
+
index:
|
18
|
+
upload_new: Загрузить новый файл
|
19
|
+
no_files_yet: "Здесь пока нет файлов. Нажмите «Загрузить новые файлы», чтобы добавить первый файл."
|
20
|
+
insert:
|
21
|
+
existing: Существующий файл
|
22
|
+
new: Новый файл
|
23
|
+
no_files: Файлов нет.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Поставить ссылку на этот файл
|
26
|
+
button_text: Вставить
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: файл
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Вы должны выбрать файл для загрузки
|
34
|
+
too_long: "Файлы должны быть по размеру меньше чем %{count}"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
sl:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Datoteke
|
5
|
+
admin:
|
6
|
+
resources:
|
7
|
+
delete: Odstrani datoteko
|
8
|
+
edit: Uredi datoteko
|
9
|
+
form:
|
10
|
+
download_current: Prenesi tretnutno datoteko
|
11
|
+
or: ali
|
12
|
+
replace: " jo zamenjaj s tole..."
|
13
|
+
maximum_file_size: "Največja dovoljena velikost datoteke je %{megabytes} megabajtov."
|
14
|
+
resource:
|
15
|
+
download: Prenesi datoteko (%{size})
|
16
|
+
index:
|
17
|
+
upload_new: Prenesi Novo Datoteko
|
18
|
+
no_files_yet: Trenutno še ni nobene datoteke. Za prenos prve datoteke kliknite "Prenesi Novo Datoteko".
|
19
|
+
insert:
|
20
|
+
existing: Obstoječo Datoteko
|
21
|
+
new: Novo Datoteko
|
22
|
+
no_files: Trenutno še ni datotek.
|
23
|
+
existing_resource:
|
24
|
+
link_to_file: Povezava do te datoteke
|
25
|
+
button_text: Vstavi
|
26
|
+
activerecord:
|
27
|
+
models:
|
28
|
+
resource: datoteka
|
29
|
+
errors:
|
30
|
+
models:
|
31
|
+
resource:
|
32
|
+
blank: Izbrati morate datoteko za prenos
|
33
|
+
too_long: Velikost datoteke mora biti manjša od %{count}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
sv:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Filer
|
5
|
+
description: Ladda upp och länka till filer
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Ta bort den här filen för alltid
|
9
|
+
edit: Redigera den här filen
|
10
|
+
form:
|
11
|
+
download_current: Ladda ner den här filen
|
12
|
+
or: eller
|
13
|
+
replace: " ersätt med den här..."
|
14
|
+
maximum_file_size: Maximal storlek är %{megabytes} megabytes.
|
15
|
+
resource:
|
16
|
+
download: Ladda ner den här filen (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Ladda upp en fil
|
19
|
+
no_files_yet: Det finns inga filer ännu. Klicka på "Ladda upp en fil" för att ladda upp din första fil.
|
20
|
+
insert:
|
21
|
+
existing: Redan existerande fil
|
22
|
+
new: Ny fil
|
23
|
+
no_files: Det finns inga filer.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Länk till den här filen
|
26
|
+
button_text: Lägg till
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: fil
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Du måste ange en fil att ladda upp
|
34
|
+
too_long: Filen måste vara mindre än %{count} stor
|
@@ -0,0 +1,34 @@
|
|
1
|
+
vi:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: Các tập tin
|
5
|
+
description: Tải lên và liên kết đến tập tin
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: Hủy bỏ tập tin này mãi mãi
|
9
|
+
edit: Sửa tập tin này
|
10
|
+
form:
|
11
|
+
download_current: Tải tập tin hiện tại
|
12
|
+
or: hoặc
|
13
|
+
replace: " thay thế nó bằng này..."
|
14
|
+
maximum_file_size: Kích thước file tối đa là %{megabytes} megabytes.
|
15
|
+
resource:
|
16
|
+
download: Tải về file này (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: Tải lên tập tin mới
|
19
|
+
no_files_yet: Chưa có tập tin nào. Nhấp vào "Tải lên tập tin mới" để thêm tập tin đầu tiên của bạn.
|
20
|
+
insert:
|
21
|
+
existing: Tập tin đang tồn tại
|
22
|
+
new: Tập tin mới
|
23
|
+
no_files: Không có tập tin nào.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: Liên kết đến tập tin này.
|
26
|
+
button_text: Chèn
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: tập tin
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: Bạn phải xác định tập tin để tải lên
|
34
|
+
too_long: Tập tin phải nhỏ hơn %{count} về kích thước
|
@@ -0,0 +1,34 @@
|
|
1
|
+
zh-CN:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: 文件
|
5
|
+
description: 上传与连接文件
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: 永久删除此文件
|
9
|
+
edit: 编辑此文件
|
10
|
+
form:
|
11
|
+
download_current: 下载当前文件
|
12
|
+
or: 或
|
13
|
+
replace: " 用这个来替换..."
|
14
|
+
maximum_file_size: 最大的文件大小是 %{megabytes} MB.
|
15
|
+
resource:
|
16
|
+
download: 下载此文件 (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: 上传新文件
|
19
|
+
no_files_yet: 这里还没有文件. 点击 "上传新文件" 去添加您第一个文件.
|
20
|
+
insert:
|
21
|
+
existing: 已存在的文件
|
22
|
+
new: 新文件
|
23
|
+
no_files: 没有文件.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: 连接到此文件
|
26
|
+
button_text: 插入
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: 文件
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: 您必须选择一个文件来上传
|
34
|
+
too_long: 文件应该小于 %{count} 大小
|
@@ -0,0 +1,34 @@
|
|
1
|
+
zh-TW:
|
2
|
+
plugins:
|
3
|
+
refinery_files:
|
4
|
+
title: 檔案
|
5
|
+
description: 上傳與連結檔案
|
6
|
+
admin:
|
7
|
+
resources:
|
8
|
+
delete: 永遠地移除這個檔案
|
9
|
+
edit: 編輯檔案
|
10
|
+
form:
|
11
|
+
download_current: 下載目前檔案
|
12
|
+
or: 或
|
13
|
+
replace: " 用這個來取代..."
|
14
|
+
maximum_file_size: 檔案大小限制為 %{megabytes} MB.
|
15
|
+
resource:
|
16
|
+
download: 下載這個檔案 (%{size})
|
17
|
+
index:
|
18
|
+
upload_new: 上傳新檔案
|
19
|
+
no_files_yet: 目前沒有任何的檔案. 點選 "上傳新檔案" 來加入您的第一個檔案.
|
20
|
+
insert:
|
21
|
+
existing: 已存在的檔案
|
22
|
+
new: 新檔案
|
23
|
+
no_files: 目前沒有檔案.
|
24
|
+
existing_resource:
|
25
|
+
link_to_file: 此檔案連結
|
26
|
+
button_text: 插入
|
27
|
+
activerecord:
|
28
|
+
models:
|
29
|
+
resource: 檔案
|
30
|
+
errors:
|
31
|
+
models:
|
32
|
+
resource:
|
33
|
+
blank: 您必須選取檔案來上傳
|
34
|
+
too_long: 檔案必須要小於 %{count} 這個大小
|
data/config/routes.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
::Refinery::Application.routes.draw do
|
2
|
+
|
3
|
+
match '/system/resources/*dragonfly', :to => Dragonfly[:resources]
|
4
|
+
|
5
|
+
scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
|
6
|
+
resources :resources, :except => :show do
|
7
|
+
collection do
|
8
|
+
get :insert
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateRefinerycmsResourcesSchema < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table ::Resource.table_name, :force => true do |t|
|
4
|
+
t.string "file_mime_type"
|
5
|
+
t.string "file_name"
|
6
|
+
t.integer "file_size"
|
7
|
+
t.datetime "created_at"
|
8
|
+
t.datetime "updated_at"
|
9
|
+
t.string "file_uid"
|
10
|
+
t.string "file_ext"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
[::Resource].reject{|m|
|
16
|
+
!(defined?(m) and m.respond_to?(:table_name))
|
17
|
+
}.each do |model|
|
18
|
+
drop_table model.table_name
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
@refinerycms @files @files-manage @resources @resources-manage @manage
|
2
|
+
Feature: Manage Files
|
3
|
+
In order to control the content on my website
|
4
|
+
As an administrator
|
5
|
+
I want to create and manage files
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am a logged in refinery user
|
9
|
+
And I have no files
|
10
|
+
|
11
|
+
@files-valid @valid
|
12
|
+
Scenario: Create Valid File
|
13
|
+
When I go to the list of files
|
14
|
+
And I follow "Upload new file"
|
15
|
+
And I attach the file at "refinery_is_awesome.txt"
|
16
|
+
And I press "Save"
|
17
|
+
Then the file "refinery_is_awesome.txt" should have uploaded successfully
|
18
|
+
And I should have 1 file
|
19
|
+
|
20
|
+
@files-edit @edit
|
21
|
+
Scenario: Edit Existing File
|
22
|
+
When I upload the file at "refinery_is_awesome.txt"
|
23
|
+
And I go to the list of files
|
24
|
+
And I follow "Edit this file"
|
25
|
+
And I attach the file at "beach.jpeg"
|
26
|
+
And I press "Save"
|
27
|
+
Then the file "beach.jpeg" should have uploaded successfully
|
28
|
+
And I should have 1 file
|
29
|
+
|
30
|
+
@files-show @show
|
31
|
+
Scenario: Download Existing File
|
32
|
+
When I upload the file at "refinery_is_awesome.txt"
|
33
|
+
And I go to the list of files
|
34
|
+
And I follow "Download this file"
|
35
|
+
Then I should see "http://www.refineryhq.com/"
|
36
|
+
|
37
|
+
@files-delete @delete
|
38
|
+
Scenario: Files Delete
|
39
|
+
When I upload the file at "refinery_is_awesome.txt"
|
40
|
+
And I go to the list of files
|
41
|
+
And I follow "Remove this file forever"
|
42
|
+
Then I should see "'Refinery Is Awesome' was successfully removed."
|
43
|
+
And I should have 0 files
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Given /^I have no files$/ do
|
2
|
+
Resource.delete_all
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I attach the file at "([^\"]*)"$/ do |file_path|
|
6
|
+
attach_file('resource_file', File.join(File.expand_path('../../uploads/', __FILE__), file_path))
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^the file "([^\"]*)" should have uploaded successfully$/ do |file_name|
|
10
|
+
Resource.find_by_file_name(file_name).nil?.should == false
|
11
|
+
end
|
12
|
+
|
13
|
+
And /^I should have ([0-9]+) files?$/ do |number|
|
14
|
+
Resource.count.should == number.to_i
|
15
|
+
end
|
16
|
+
|
17
|
+
When /^I upload the file at "([^\"]*)"$/ do |file_path|
|
18
|
+
visit new_admin_resource_path
|
19
|
+
attach_file('resource_file', File.join(File.expand_path('../../uploads/', __FILE__), file_path))
|
20
|
+
click_button 'Save'
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
module Refinery
|
3
|
+
module Resources
|
4
|
+
def path_to(page_name)
|
5
|
+
case page_name
|
6
|
+
when /the list of files/
|
7
|
+
admin_resources_path
|
8
|
+
|
9
|
+
when /the new file form/
|
10
|
+
new_admin_resource_path
|
11
|
+
else
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
http://www.refineryhq.com/
|
data/lib/gemspec.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
gempath = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
require gempath.join('..', 'base', 'lib', 'base', 'refinery')
|
4
|
+
|
5
|
+
gemspec = <<EOF
|
6
|
+
# DO NOT EDIT THIS FILE DIRECTLY! Instead, use lib/gemspec.rb to generate it.
|
7
|
+
|
8
|
+
Gem::Specification.new do |s|
|
9
|
+
s.name = %q{#{gemname = 'refinerycms-resources'}}
|
10
|
+
s.version = %q{#{::Refinery.version}}
|
11
|
+
s.summary = %q{Resources engine for Refinery CMS}
|
12
|
+
s.description = %q{Handles all file upload and processing functionality in Refinery CMS.}
|
13
|
+
s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
|
14
|
+
s.email = %q{info@refinerycms.com}
|
15
|
+
s.homepage = %q{http://refinerycms.com}
|
16
|
+
s.rubyforge_project = %q{refinerycms}
|
17
|
+
s.authors = ['Resolve Digital', 'Philip Arndt', 'David Jones', 'Steven Heidel']
|
18
|
+
s.license = %q{MIT}
|
19
|
+
s.require_paths = %w(lib)
|
20
|
+
s.executables = %w(#{Pathname.glob(gempath.join('bin/*')).map{|d| d.relative_path_from(gempath)}.sort.join(" ")})
|
21
|
+
|
22
|
+
s.files = [
|
23
|
+
'#{%w( **/{*,.rspec,.gitignore,.yardopts} ).map { |file| Pathname.glob(gempath.join(file)) }.flatten.reject{|f|
|
24
|
+
!f.exist? or f.to_s =~ /\.gem$/ or (f.directory? and f.children.empty?)
|
25
|
+
}.map{|d| d.relative_path_from(gempath)}.uniq.sort.join("',\n '")}'
|
26
|
+
]
|
27
|
+
|
28
|
+
s.add_dependency 'refinerycms-core', '~> #{::Refinery::Version}'
|
29
|
+
s.add_dependency 'dragonfly', '~> 0.8.2'
|
30
|
+
s.add_dependency 'rack-cache', '~> 0.5.2'
|
31
|
+
end
|
32
|
+
EOF
|
33
|
+
|
34
|
+
(gemfile = gempath.join("#{gemname}.gemspec")).open('w') {|f| f.puts(gemspec)}
|
35
|
+
puts `cd #{gempath} && gem build #{gemfile}` if ARGV.any?{|a| a == "BUILD=true"}
|