refinerycms-images 1.0.11 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/app/controllers/refinery/admin/images_controller.rb +110 -0
  2. data/app/helpers/refinery/admin/images_helper.rb +24 -0
  3. data/app/models/refinery/image.rb +96 -0
  4. data/app/views/refinery/admin/images/_actions.html.erb +15 -0
  5. data/app/views/{admin → refinery/admin}/images/_existing_image.html.erb +13 -26
  6. data/app/views/{admin → refinery/admin}/images/_form.html.erb +11 -15
  7. data/app/views/{admin → refinery/admin}/images/_grid_view.html.erb +7 -5
  8. data/app/views/refinery/admin/images/_images.html.erb +2 -0
  9. data/app/views/{admin → refinery/admin}/images/_list_view.html.erb +0 -0
  10. data/app/views/{admin → refinery/admin}/images/_list_view_image.html.erb +7 -5
  11. data/app/views/refinery/admin/images/_records.html.erb +18 -0
  12. data/app/views/refinery/admin/images/edit.html.erb +1 -0
  13. data/app/views/refinery/admin/images/index.html.erb +6 -0
  14. data/app/views/{admin → refinery/admin}/images/insert.html.erb +10 -13
  15. data/app/views/refinery/admin/images/new.html.erb +1 -0
  16. data/config/locales/bg.yml +37 -36
  17. data/config/locales/cs.yml +37 -36
  18. data/config/locales/da.yml +37 -36
  19. data/config/locales/de.yml +37 -36
  20. data/config/locales/el.yml +37 -36
  21. data/config/locales/en.yml +37 -36
  22. data/config/locales/es.yml +38 -37
  23. data/config/locales/fi.yml +37 -36
  24. data/config/locales/fr.yml +37 -36
  25. data/config/locales/it.yml +47 -45
  26. data/config/locales/ja.yml +44 -0
  27. data/config/locales/ko.yml +44 -0
  28. data/config/locales/lt.yml +37 -36
  29. data/config/locales/lv.yml +37 -36
  30. data/config/locales/nb.yml +37 -37
  31. data/config/locales/nl.yml +36 -35
  32. data/config/locales/pl.yml +38 -37
  33. data/config/locales/pt-BR.yml +38 -37
  34. data/config/locales/rs.yml +37 -37
  35. data/config/locales/ru.yml +37 -36
  36. data/config/locales/sk.yml +37 -36
  37. data/config/locales/sl.yml +36 -35
  38. data/config/locales/sv.yml +37 -36
  39. data/config/locales/vi.yml +37 -36
  40. data/config/locales/zh-CN.yml +37 -36
  41. data/config/locales/zh-TW.yml +37 -36
  42. data/config/routes.rb +4 -7
  43. data/db/migrate/20100913234707_create_refinerycms_images_schema.rb +10 -18
  44. data/lib/generators/refinery/images/images_generator.rb +10 -0
  45. data/lib/generators/refinery/images/templates/config/initializers/refinery/images.rb.erb +41 -0
  46. data/lib/refinery/images.rb +25 -0
  47. data/lib/refinery/images/configuration.rb +54 -0
  48. data/lib/refinery/images/dragonfly.rb +54 -0
  49. data/lib/refinery/images/engine.rb +38 -0
  50. data/lib/refinery/images/validators.rb +7 -0
  51. data/lib/refinery/images/validators/image_size_validator.rb +19 -0
  52. data/lib/refinerycms-images.rb +1 -76
  53. data/refinerycms-images.gemspec +14 -91
  54. data/spec/factories/image.rb +5 -0
  55. data/{features/uploads → spec/fixtures}/beach.jpeg +0 -0
  56. data/spec/fixtures/fathead.png +0 -0
  57. data/spec/fixtures/image-with-dashes.jpg +0 -0
  58. data/spec/lib/generators/refinery/images/images_generator_spec.rb +29 -0
  59. data/spec/models/refinery/image_spec.rb +158 -0
  60. data/spec/requests/refinery/admin/images_spec.rb +103 -0
  61. metadata +116 -106
  62. data/app/controllers/admin/images_controller.rb +0 -106
  63. data/app/helpers/admin/images_helper.rb +0 -27
  64. data/app/models/image.rb +0 -116
  65. data/app/views/admin/images/_actions.html.erb +0 -16
  66. data/app/views/admin/images/_images.html.erb +0 -2
  67. data/app/views/admin/images/_records.html.erb +0 -18
  68. data/app/views/admin/images/edit.html.erb +0 -1
  69. data/app/views/admin/images/index.html.erb +0 -6
  70. data/app/views/admin/images/new.html.erb +0 -1
  71. data/config/locales/jp.yml +0 -43
  72. data/config/locales/lolcat.yml +0 -43
  73. data/features/manage_images.feature +0 -49
  74. data/features/step_definitions/image_steps.rb +0 -40
  75. data/features/support/factories.rb +0 -7
  76. data/features/support/paths.rb +0 -17
  77. data/features/uploads/id-rather-be-here.jpg +0 -0
  78. data/features/uploads/refinery_is_awesome.txt +0 -1
  79. data/lib/gemspec.rb +0 -38
  80. data/lib/generators/refinerycms_images_generator.rb +0 -8
  81. data/spec/models/image_spec.rb +0 -115
  82. data/spec/uploads/beach.jpeg +0 -0
@@ -1,43 +1,44 @@
1
1
  lv:
2
- plugins:
3
- refinery_images:
4
- title: Bildes
5
- article: s
6
- description: Bilžu pārvaldīšana
7
- admin:
8
- images:
9
- delete: Dzēst šo bildi
10
- edit: Labot šo bildi
11
- form:
12
- use_current_image: Lietot pašreizējo bildi
13
- or: vai
14
- replace_image: " aizstāt to ar šo..."
15
- current_image: Pašreizējā Bilde
16
- maximum_image_size: Maksimāli pieļaujamais bildes izmērs ir %{megabytes} megabaiti.
17
- actions:
18
- create_new_image: Augšupielādēt bildi
19
- records:
20
- no_images_yet: Vēl nav nevienas bildes. Spied "Augšupielādēt bildi", lai ielādētu bildi.
21
- index:
22
- view:
23
- switch_to: Pārslēgt uz %{view_name} skatu
24
- list: saraksta
25
- grid: režģa
26
- grid_view:
27
- view_live_html: Skatīt šo bildi <br/><em>Atvērsies jaunā logā</em>
28
- existing_image:
29
- button_text: Ievietot
30
- resize_image: Mainīt bildes izmērus?
31
- size: Izmērs
32
- insert:
33
- existing_image: Esoša Bilde
34
- new_image: Jauna Bilde
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Bildes
6
+ article: s
7
+ description: Bilžu pārvaldīšana
8
+ admin:
9
+ images:
10
+ delete: Dzēst šo bildi
11
+ edit: Labot šo bildi
12
+ form:
13
+ use_current_image: Lietot pašreizējo bildi
14
+ or: vai
15
+ replace_image: " aizstāt to ar šo..."
16
+ current_image: Pašreizējā Bilde
17
+ maximum_image_size: Maksimāli pieļaujamais bildes izmērs ir %{bytes}.
18
+ actions:
19
+ create_new_image: Augšupielādēt bildi
20
+ records:
21
+ no_images_yet: Vēl nav nevienas bildes. Spied "Augšupielādēt bildi", lai ielādētu bildi.
22
+ index:
23
+ view:
24
+ switch_to: Pārslēgt uz %{view_name} skatu
25
+ list: saraksta
26
+ grid: režģa
27
+ grid_view:
28
+ view_live_html: Skatīt šo bildi <br/><em>Atvērsies jaunā logā</em>
29
+ existing_image:
30
+ button_text: Ievietot
31
+ resize_image: Mainīt bildes izmērus?
32
+ size: Izmērs
33
+ insert:
34
+ existing_image: Esoša Bilde
35
+ new_image: Jauna Bilde
35
36
  activerecord:
36
37
  models:
37
- image: bilde
38
+ refinery/image: bilde
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Jānorāda bilde pirms augšupielādes
42
- too_long: Bildes izmēram jābūt mazākam par %{count}
43
+ too_big: Bildes izmēram jābūt mazākam par %{size} megabaitiem
43
44
  incorrect_format: "Bilde drīkst būt tikai sekojošos formātos: JPG, PNG vai GIF"
@@ -1,44 +1,44 @@
1
1
  nb:
2
- plugins:
3
- refinery_images:
4
- title: Bilder
5
- description: Behandle bilder
6
- admin:
7
- images:
8
- delete: Fjern dette bildet permanent
9
- edit: Rediger dette bildet
10
- form:
11
- image: Bilde
12
- use_current_image: Bruk gjeldende bilde
13
- or: eller
14
- replace_image: Erstatt det med dette ...
15
- current_image: Gjeldende bilde
16
- maximum_image_size: "Den største tillatte størrelsen på et bilde er %{megabytes} MB."
17
- actions:
18
- create_new_image: Lag et nytt bilde
19
- records:
20
- no_images_yet: Det er ingen bilder her enda. Trykk på "Lag et nytt bilde" for å legge til ditt første bilde.
21
- index:
22
- view:
23
- switch_to: "Endre til %{view_name} visning"
24
- list: liste
25
- grid: rutenett
26
- grid_view:
27
- view_live_html: Vis dette bildet <br/><em>Åpner i et nytt vindu</em>
28
- existing_image:
29
- button_text: Sett inn
30
- resize_image: "Endre størrelsen på bildet? <em>(Anbefales)</em>"
31
- size: Størrelse
32
- insert:
33
- existing_image: Eksisterende bilde
34
- new_image: Nytt bilde
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Bilder
6
+ description: Behandle bilder
7
+ admin:
8
+ images:
9
+ delete: Fjern dette bildet permanent
10
+ edit: Rediger dette bildet
11
+ form:
12
+ image: Bilde
13
+ use_current_image: Bruk gjeldende bilde
14
+ or: eller
15
+ replace_image: Erstatt det med dette ...
16
+ current_image: Gjeldende bilde
17
+ maximum_image_size: "Den største tillatte størrelsen på et bilde er %{bytes}."
18
+ actions:
19
+ create_new_image: Lag et nytt bilde
20
+ records:
21
+ no_images_yet: Det er ingen bilder her enda. Trykk på "Lag et nytt bilde" for å legge til ditt første bilde.
22
+ index:
23
+ view:
24
+ switch_to: "Endre til %{view_name} visning"
25
+ list: liste
26
+ grid: rutenett
27
+ grid_view:
28
+ view_live_html: Vis dette bildet <br/><em>Åpner i et nytt vindu</em>
29
+ existing_image:
30
+ button_text: Sett inn
31
+ resize_image: "Endre størrelsen på bildet? <em>(Anbefales)</em>"
32
+ size: Størrelse
33
+ insert:
34
+ existing_image: Eksisterende bilde
35
+ new_image: Nytt bilde
35
36
  activerecord:
36
37
  models:
37
- image: bilde
38
+ refinery/image: bilde
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Du må angi bildet som skal lastet opp
42
- too_long: Bildet må være mindre enn %{count}
43
+ too_big: Bildet må være mindre enn %{size} MB
43
44
  incorrect_format: 'Bildefilen må være av filtypen JPG, PNG eller GIF'
44
-
@@ -1,42 +1,43 @@
1
1
  nl:
2
- plugins:
3
- refinery_images:
4
- title: Afbeeldingen
5
- admin:
6
- images:
7
- delete: Verwijder deze afbeelding permanent
8
- edit: Bewerk deze afbeelding
9
- form:
10
- image: Afbeelding
11
- use_current_image: Gebruik huidige afbeelding
12
- or: of
13
- replace_image: Vervang de afbeelding door deze
14
- current_image: Huidige afbeelding
15
- maximum_image_size: "The maximum image size is %{megabytes} megabytes."
16
- actions:
17
- create_new_image: Upload een nieuwe afbeelding
18
- records:
19
- no_images_yet: Er zijn nog geen afbeeldingen. Klik op "Upload een nieuwe afbeelding" om uw eerste afbleelding toe te voegen.
20
- index:
21
- view:
22
- switch_to: Bekijk de %{view_name} versie
23
- list: lijst
24
- grid: tabel
25
- grid_view:
26
- view_live_html: Bekijk deze afbeelding <br/><em>(opent een nieuw venster)</em>
27
- existing_image:
28
- button_text: Invoegen
29
- resize_image: Schaal de afbeelding
30
- size: Grootte
31
- insert:
32
- existing_image: Bibliotheek
33
- new_image: Uploaden
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Afbeeldingen
6
+ admin:
7
+ images:
8
+ delete: Verwijder deze afbeelding permanent
9
+ edit: Bewerk deze afbeelding
10
+ form:
11
+ image: Afbeelding
12
+ use_current_image: Gebruik huidige afbeelding
13
+ or: of
14
+ replace_image: Vervang de afbeelding door deze
15
+ current_image: Huidige afbeelding
16
+ maximum_image_size: "The maximum image size is %{bytes}."
17
+ actions:
18
+ create_new_image: Upload een nieuwe afbeelding
19
+ records:
20
+ no_images_yet: Er zijn nog geen afbeeldingen. Klik op "Upload een nieuwe afbeelding" om uw eerste afbleelding toe te voegen.
21
+ index:
22
+ view:
23
+ switch_to: Bekijk de %{view_name} versie
24
+ list: lijst
25
+ grid: tabel
26
+ grid_view:
27
+ view_live_html: Bekijk deze afbeelding <br/><em>(opent een nieuw venster)</em>
28
+ existing_image:
29
+ button_text: Invoegen
30
+ resize_image: Schaal de afbeelding
31
+ size: Grootte
32
+ insert:
33
+ existing_image: Bibliotheek
34
+ new_image: Uploaden
34
35
  activerecord:
35
36
  models:
36
- image: afbeelding
37
+ refinery/image: afbeelding
37
38
  errors:
38
39
  models:
39
- image:
40
+ refinery/image:
40
41
  blank: U moet een afbeelding kiezen om te uploaden.
41
- too_long: Afbeeldingen mogen niet groter dan %{count} zijn.
42
+ too_big: Afbeeldingen mogen niet groter dan %{size} bytes zijn.
42
43
  incorrect_format: Uw afbeelding moet een JPG, PNG of GIF zijn.
@@ -1,44 +1,45 @@
1
1
  pl:
2
- plugins:
3
- refinery_images:
4
- title: Obrazy
5
- description: Zarządzaj obrazami
6
- article: masculine
7
- admin:
8
- images:
9
- delete: Na zawsze usuń ten obraz
10
- edit: Zmień ten obraz
11
- form:
12
- image: Obraz
13
- use_current_image: Użyj obecnego obrazu
14
- or: lub
15
- replace_image: " zastąp go tym..."
16
- current_image: Obecny obraz
17
- maximum_image_size: Maksymalny rozmiar obrazu to %{megabytes} megabajtów.
18
- actions:
19
- create_new_image: Dodaj nowy obraz
20
- records:
21
- no_images_yet: Nie ma jeszcze żadnych obrazów. Kliknij "Dodaj nowy obraz" aby dodać pierwszy.
22
- index:
23
- view:
24
- switch_to: Przełącz do widoku %{view_name}
25
- list: lista
26
- grid: siatka
27
- grid_view:
28
- view_live_html: Obejrzyj ten obraz <br/><em>Otwarcie w nowym oknie</em>
29
- existing_image:
30
- button_text: Wstaw
31
- resize_image: Zmień rozmiar tego obrazu?
32
- size: Rozmiar
33
- insert:
34
- existing_image: Istniejący obraz
35
- new_image: Nowy obraz
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Obrazy
6
+ description: Zarządzaj obrazami
7
+ article: masculine
8
+ admin:
9
+ images:
10
+ delete: Na zawsze usuń ten obraz
11
+ edit: Zmień ten obraz
12
+ form:
13
+ image: Obraz
14
+ use_current_image: Użyj obecnego obrazu
15
+ or: lub
16
+ replace_image: " zastąp go tym..."
17
+ current_image: Obecny obraz
18
+ maximum_image_size: Maksymalny rozmiar obrazu to %{bytes}.
19
+ actions:
20
+ create_new_image: Dodaj nowy obraz
21
+ records:
22
+ no_images_yet: Nie ma jeszcze żadnych obrazów. Kliknij "Dodaj nowy obraz" aby dodać pierwszy.
23
+ index:
24
+ view:
25
+ switch_to: Przełącz do widoku %{view_name}
26
+ list: lista
27
+ grid: siatka
28
+ grid_view:
29
+ view_live_html: Obejrzyj ten obraz <br/><em>Otwarcie w nowym oknie</em>
30
+ existing_image:
31
+ button_text: Wstaw
32
+ resize_image: Zmień rozmiar tego obrazu?
33
+ size: Rozmiar
34
+ insert:
35
+ existing_image: Istniejący obraz
36
+ new_image: Nowy obraz
36
37
  activerecord:
37
38
  models:
38
- image: obraz
39
+ refinery/image: obraz
39
40
  errors:
40
41
  models:
41
- image:
42
+ refinery/image:
42
43
  blank: Musisz określić obraz do wgrania
43
- too_long: Obraz powinien być mniejszy niż %{count}
44
+ too_big: Obraz powinien być mniejszy niż %{size} megabajtów
44
45
  incorrect_format: 'Obraz musi być plikiem typu JPG, PNG lub GIF'
@@ -1,44 +1,45 @@
1
1
  pt-BR:
2
- plugins:
3
- refinery_images:
4
- title: Imagens
5
- article: a
6
- description: Gerenciar imagens
7
- admin:
8
- images:
9
- delete: Remover esta imagem para sempre
10
- edit: Editar esta imagem
11
- form:
12
- image: Imagem
13
- use_current_image: Usar imagem atual
14
- or: ou
15
- replace_image: " substituir por esta..."
16
- current_image: Imagem atual
17
- maximum_image_size: "O tamanho máximo permitido é de %{megabytes} megabytes."
18
- actions:
19
- create_new_image: Criar Nova Imagem
20
- records:
21
- no_images_yet: Ainda não existem imagens. Clique em "Criar Nova Imagem" para adicionar sua primeira imagem.
22
- index:
23
- view:
24
- switch_to: Trocar para visão em %{view_name}
25
- list: lista
26
- grid: grade
27
- grid_view:
28
- view_live_html: "Ver esta imagem<br/><em>Abre em uma nova janela</em>"
29
- existing_image:
30
- button_text: Inserir
31
- resize_image: "Redimencionar a imagem?"
32
- size: Tamanho
33
- insert:
34
- existing_image: Do Arquivo
35
- new_image: Nova Imagem
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Imagens
6
+ article: a
7
+ description: Gerenciar imagens
8
+ admin:
9
+ images:
10
+ delete: Remover esta imagem para sempre
11
+ edit: Editar esta imagem
12
+ form:
13
+ image: Imagem
14
+ use_current_image: Usar imagem atual
15
+ or: ou
16
+ replace_image: " substituir por esta..."
17
+ current_image: Imagem atual
18
+ maximum_image_size: "O tamanho máximo permitido é de %{bytes}."
19
+ actions:
20
+ create_new_image: Criar Nova Imagem
21
+ records:
22
+ no_images_yet: Ainda não existem imagens. Clique em "Criar Nova Imagem" para adicionar sua primeira imagem.
23
+ index:
24
+ view:
25
+ switch_to: Trocar para visão em %{view_name}
26
+ list: lista
27
+ grid: grade
28
+ grid_view:
29
+ view_live_html: "Ver esta imagem<br/><em>Abre em uma nova janela</em>"
30
+ existing_image:
31
+ button_text: Inserir
32
+ resize_image: "Redimencionar a imagem?"
33
+ size: Tamanho
34
+ insert:
35
+ existing_image: Do Arquivo
36
+ new_image: Nova Imagem
36
37
  activerecord:
37
38
  models:
38
- image: Imagem
39
+ refinery/image: Imagem
39
40
  errors:
40
41
  models:
41
- image:
42
+ refinery/image:
42
43
  blank: Você deve escolher uma imagem para enviar
43
- too_long: "Imagem deve possuir menos de %{count} de tamanho"
44
+ too_big: "Imagem deve possuir menos de %{size} bytes de tamanho"
44
45
  incorrect_format: 'Sua imagem deve ser uma JPG, PNG ou GIF'
@@ -1,44 +1,44 @@
1
1
  rs:
2
- plugins:
3
- refinery_images:
4
- title: Slike
5
- description: Menjaj slike
6
- admin:
7
- images:
8
- delete: Ukloni ovu sliku zauvek
9
- edit: Izmeni sliku
10
- form:
11
- image: Slika
12
- use_current_image: Koristi trenutnu sliku
13
- or: ili
14
- replace_image: " zameni sa ovom..."
15
- current_image: Trenutna slika
16
- maximum_image_size: Maksimalna veličina slike je %{megabytes} megabajta.
17
- actions:
18
- create_new_image: Dodaj novu sliku
19
- records:
20
- no_images_yet: Ne postoje slike. Klikni "Dodaj novu sliku" da dodaš.
21
- index:
22
- view:
23
- switch_to: Prebaci na %{view_name}
24
- list: listu
25
- grid: mrežni prikaz
26
- grid_view:
27
- view_live_html: Pogledaj ovu sliku <br/><em>Otvara se u novom prozoru</em>
28
- existing_image:
29
- button_text: Unesi
30
- resize_image: Promeni veličinu slike?
31
- size: Veličina
32
- insert:
33
- existing_image: Trenutne slike
34
- new_image: Upload
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Slike
6
+ description: Menjaj slike
7
+ admin:
8
+ images:
9
+ delete: Ukloni ovu sliku zauvek
10
+ edit: Izmeni sliku
11
+ form:
12
+ image: Slika
13
+ use_current_image: Koristi trenutnu sliku
14
+ or: ili
15
+ replace_image: " zameni sa ovom..."
16
+ current_image: Trenutna slika
17
+ maximum_image_size: Maksimalna veličina slike je %{bytes}.
18
+ actions:
19
+ create_new_image: Dodaj novu sliku
20
+ records:
21
+ no_images_yet: Ne postoje slike. Klikni "Dodaj novu sliku" da dodaš.
22
+ index:
23
+ view:
24
+ switch_to: Prebaci na %{view_name}
25
+ list: listu
26
+ grid: mrežni prikaz
27
+ grid_view:
28
+ view_live_html: Pogledaj ovu sliku <br/><em>Otvara se u novom prozoru</em>
29
+ existing_image:
30
+ button_text: Unesi
31
+ resize_image: Promeni veličinu slike?
32
+ size: Veličina
33
+ insert:
34
+ existing_image: Trenutne slike
35
+ new_image: Upload
35
36
  activerecord:
36
37
  models:
37
- image: slika
38
+ refinery/image: slika
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Moraš izabrati sliku za upload
42
- too_long: Slika bi trebalo da bude manja od %{count}
43
+ too_big: Slika bi trebalo da bude manja od %{size} megabajta
43
44
  incorrect_format: 'Slika mora biti u JPG, PNG ili GIF formatu'
44
-