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
@@ -0,0 +1 @@
1
+ <%= render '/refinery/admin/images/form' %>
@@ -1,43 +1,44 @@
1
1
  bg:
2
- plugins:
3
- refinery_images:
4
- title: Изображения
5
- description: Управление на изображения
6
- admin:
7
- images:
8
- delete: Изтриване на това изображение завинаги
9
- edit: Редактиране на това изображение
10
- form:
11
- image: Изображение
12
- use_current_image: Използвайте текущото изображение
13
- or: или
14
- replace_image: " го заменете с ново..."
15
- current_image: Текущо изображение
16
- maximum_image_size: Максималната големина на изображението е %{megabytes} мегабайта.
17
- actions:
18
- create_new_image: Добавяне на ново изображение
19
- records:
20
- no_images_yet: Все още няма изображения. Натиснете "Добавяне на ново изображение", за да качите ново.
21
- index:
22
- view:
23
- switch_to: Преглед като %{view_name}
24
- list: списък
25
- grid: решетка
26
- grid_view:
27
- view_live_html: Преглед на това изображение <br/><em>(ще се отвори в нов прозорец)</em>
28
- existing_image:
29
- button_text: Вмъкване
30
- resize_image: Оразмеряване на изображението?
31
- size: Големина
32
- insert:
33
- existing_image: Галерия
34
- new_image: Качване
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Изображения
6
+ description: Управление на изображения
7
+ admin:
8
+ images:
9
+ delete: Изтриване на това изображение завинаги
10
+ edit: Редактиране на това изображение
11
+ form:
12
+ image: Изображение
13
+ use_current_image: Използвайте текущото изображение
14
+ or: или
15
+ replace_image: " го заменете с ново..."
16
+ current_image: Текущо изображение
17
+ maximum_image_size: Максималната големина на изображението е %{bytes} байта.
18
+ actions:
19
+ create_new_image: Добавяне на ново изображение
20
+ records:
21
+ no_images_yet: Все още няма изображения. Натиснете "Добавяне на ново изображение", за да качите ново.
22
+ index:
23
+ view:
24
+ switch_to: Преглед като %{view_name}
25
+ list: списък
26
+ grid: решетка
27
+ grid_view:
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: Качване
35
36
  activerecord:
36
37
  models:
37
- image: изображение
38
+ refinery/image: изображение
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Трябва да укажете изображение за качване
42
- too_long: Размерът на изображението трябва да бъде по-малък от %{count}
43
+ too_big: Размерът на изображението трябва да бъде по-малък от %{size} байта
43
44
  incorrect_format: 'Вашето изображение трябва да бъде JPG, PNG или GIF'
@@ -1,43 +1,44 @@
1
1
  cs:
2
- plugins:
3
- refinery_images:
4
- title: Obrázky
5
- description: Spravovat obrázky
6
- admin:
7
- images:
8
- delete: Smazat tento obrázek
9
- edit: Upravit tento obrázek
10
- form:
11
- image: Obrázek
12
- use_current_image: Použít vybraný obrázek
13
- or: nebo
14
- replace_image: " nahradit jej tímto..."
15
- current_image: Vybraný obrázek
16
- maximum_image_size: Maximální velikost obrázku je %{megabytes} MB.
17
- actions:
18
- create_new_image: Přidat nový obrázek
19
- records:
20
- no_images_yet: Zatím nebyl nahraný žádný obrázek.
21
- index:
22
- view:
23
- switch_to: "Přepnout pohled na: %{view_name}"
24
- list: seznam
25
- grid: tabulka
26
- grid_view:
27
- view_live_html: Zobrazit tento obrázek <br/><em>Otevře se novém okně</em>
28
- existing_image:
29
- button_text: Vložit
30
- resize_image: Změnít velikost?
31
- size: Velikost
32
- insert:
33
- existing_image: Existující obrázek
34
- new_image: Nový obrázek
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Obrázky
6
+ description: Spravovat obrázky
7
+ admin:
8
+ images:
9
+ delete: Smazat tento obrázek
10
+ edit: Upravit tento obrázek
11
+ form:
12
+ image: Obrázek
13
+ use_current_image: Použít vybraný obrázek
14
+ or: nebo
15
+ replace_image: " nahradit jej tímto..."
16
+ current_image: Vybraný obrázek
17
+ maximum_image_size: Maximální velikost obrázku je %{bytes}.
18
+ actions:
19
+ create_new_image: Přidat nový obrázek
20
+ records:
21
+ no_images_yet: Zatím nebyl nahraný žádný obrázek.
22
+ index:
23
+ view:
24
+ switch_to: "Přepnout pohled na: %{view_name}"
25
+ list: seznam
26
+ grid: tabulka
27
+ grid_view:
28
+ view_live_html: Zobrazit tento obrázek <br/><em>Otevře se novém okně</em>
29
+ existing_image:
30
+ button_text: Vložit
31
+ resize_image: Změnít velikost?
32
+ size: Velikost
33
+ insert:
34
+ existing_image: Existující obrázek
35
+ new_image: Nový obrázek
35
36
  activerecord:
36
37
  models:
37
- image: obrázek
38
+ refinery/image: obrázek
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Musíte zadat obrázek který chcete nahrát
42
- too_long: Maximální velikost obrázku je %{count}
43
+ too_big: Maximální velikost obrázku je %{size} MB
43
44
  incorrect_format: 'Obrázek musí být ve formátu JPG, PNG nebo GIF'
@@ -1,43 +1,44 @@
1
1
  da:
2
- plugins:
3
- refinery_images:
4
- title: Billeder
5
- description: Vedligehold billeder
6
- admin:
7
- images:
8
- delete: Slet billedet
9
- edit: Redigér billede
10
- form:
11
- image: Billede
12
- use_current_image: Behold nuværende billede
13
- or: eller
14
- replace_image: " erstat med dette..."
15
- current_image: Nuværende billede
16
- maximum_image_size: Billedet må maksimalt fylde %{megabytes} megabytes.
17
- actions:
18
- create_new_image: Tilføj et nyt billede
19
- records:
20
- no_images_yet: Der er ingen billeder endnu. Klik "Tilføj et nyt billede" for at oprette det første.
21
- index:
22
- view:
23
- switch_to: Skift til %{view_name}visning
24
- list: liste
25
- grid: gitter
26
- grid_view:
27
- view_live_html: Vis billede<br/><em>(åbner i nyt vindue)</em>
28
- existing_image:
29
- button_text: Indsæt
30
- resize_image: Skalér billedet?
31
- size: Størrelse
32
- insert:
33
- existing_image: Arkiv
34
- new_image: Upload
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Billeder
6
+ description: Vedligehold billeder
7
+ admin:
8
+ images:
9
+ delete: Slet billedet
10
+ edit: Redigér billede
11
+ form:
12
+ image: Billede
13
+ use_current_image: Behold nuværende billede
14
+ or: eller
15
+ replace_image: " erstat med dette..."
16
+ current_image: Nuværende billede
17
+ maximum_image_size: Billedet må maksimalt fylde %{bytes}.
18
+ actions:
19
+ create_new_image: Tilføj et nyt billede
20
+ records:
21
+ no_images_yet: Der er ingen billeder endnu. Klik "Tilføj et nyt billede" for at oprette det første.
22
+ index:
23
+ view:
24
+ switch_to: Skift til %{view_name}visning
25
+ list: liste
26
+ grid: gitter
27
+ grid_view:
28
+ view_live_html: Vis billede<br/><em>(åbner i nyt vindue)</em>
29
+ existing_image:
30
+ button_text: Indsæt
31
+ resize_image: Skalér billedet?
32
+ size: Størrelse
33
+ insert:
34
+ existing_image: Arkiv
35
+ new_image: Upload
35
36
  activerecord:
36
37
  models:
37
- image: billede
38
+ refinery/image: billede
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Du skal angive et billede, der skal uploades
42
- too_long: Filer må højest være på %{count}
43
+ too_big: Filer må højest være på %{size} bytes
43
44
  incorrect_format: 'Dit billede skal være enten JPG, PNG eller GIF format'
@@ -1,43 +1,44 @@
1
1
  de:
2
- plugins:
3
- refinery_images:
4
- title: Bilder
5
- description: Verwaltet Bilder
6
- admin:
7
- images:
8
- delete: Dieses Bild für immer löschen
9
- edit: Dieses Bild bearbeiten
10
- form:
11
- image: Bild
12
- use_current_image: Aktuelles Bild verwenden
13
- or: oder
14
- replace_image: " mit diesem ersetzen..."
15
- current_image: Aktuelles Bild
16
- maximum_image_size: Die maximale Größe eines Bildes beträgt %{megabytes} Megabytes.
17
- actions:
18
- create_new_image: Neues Bild anlegen
19
- records:
20
- no_images_yet: Es sind noch keine Bilder vorhanden. Klicken Sie auf "Neues Bild anlegen", um Ihr estes Bild hinzuzufügen.
21
- index:
22
- view:
23
- switch_to: Zur %{view_name}-Ansicht wechseln
24
- list: Listen
25
- grid: Gitter
26
- grid_view:
27
- view_live_html: Dieses Bild betrachten <br/><em>Öffnet sich in einem neuen Fenster</em>
28
- existing_image:
29
- button_text: Einfügen
30
- resize_image: Bild in der Größe ändern?
31
- size: Größe
32
- insert:
33
- existing_image: Vorhandenes Bild
34
- new_image: Neues Bild
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Bilder
6
+ description: Verwaltet Bilder
7
+ admin:
8
+ images:
9
+ delete: Dieses Bild für immer löschen
10
+ edit: Dieses Bild bearbeiten
11
+ form:
12
+ image: Bild
13
+ use_current_image: Aktuelles Bild verwenden
14
+ or: oder
15
+ replace_image: " mit diesem ersetzen..."
16
+ current_image: Aktuelles Bild
17
+ maximum_image_size: Die maximale Größe eines Bildes beträgt %{bytes}.
18
+ actions:
19
+ create_new_image: Neues Bild anlegen
20
+ records:
21
+ no_images_yet: Es sind noch keine Bilder vorhanden. Klicken Sie auf "Neues Bild anlegen", um Ihr estes Bild hinzuzufügen.
22
+ index:
23
+ view:
24
+ switch_to: Zur %{view_name}-Ansicht wechseln
25
+ list: Listen
26
+ grid: Gitter
27
+ grid_view:
28
+ view_live_html: Dieses Bild betrachten <br/><em>Öffnet sich in einem neuen Fenster</em>
29
+ existing_image:
30
+ button_text: Einfügen
31
+ resize_image: Bild in der Größe ändern?
32
+ size: Größe
33
+ insert:
34
+ existing_image: Vorhandenes Bild
35
+ new_image: Neues Bild
35
36
  activerecord:
36
37
  models:
37
- image: Bild
38
+ refinery/image: Bild
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Sie müssen ein Bild zum Hochladen angeben
42
- too_long: Bild sollte kleiner als %{count} sein
43
+ too_big: Bild sollte kleiner als %{size} Megabytes sein
43
44
  incorrect_format: 'Ihr Bild sollte ein JPG, PNG oder GIF sein'
@@ -1,43 +1,44 @@
1
1
  el:
2
- plugins:
3
- refinery_images:
4
- title: Εικόνες
5
- description: Διαχείριση Εικόνων
6
- admin:
7
- images:
8
- delete: Διαγραφή εικόνας
9
- edit: Επεξεργασία εικόνας
10
- form:
11
- image: Εικόνα
12
- use_current_image: Χρήση τρέχουσας εικόνας
13
- or: or
14
- replace_image: " αλλαγή με αυτήν..."
15
- current_image: Τρέχουσα εικόνα
16
- maximum_image_size: Το μέγιστο μέγεθος εικόνας είναι %{megabytes} megabytes.
17
- actions:
18
- create_new_image: Προσθήκη νέας εικόνας
19
- records:
20
- no_images_yet: Δεν υπάρχουν εικόνες. Κάντε κλικ στο "Προσθήκη εικόνας" για να προσθέτε την πρώτη εικόνα.
21
- index:
22
- view:
23
- switch_to: Αλλαγή σε %{view_name} view
24
- list: λίστα
25
- grid: πλέγμα
26
- grid_view:
27
- view_live_html: Δείτε την εικόνα <br/><em>Ανοίγει σε νέο παράθυρο</em>
28
- existing_image:
29
- button_text: Εισαγωγή
30
- resize_image: Αλλαγή μεγέθους;
31
- size: Μέγεθος
32
- insert:
33
- existing_image: Βιβλιοθήκη
34
- new_image: Ανέβασμα
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Εικόνες
6
+ description: Διαχείριση Εικόνων
7
+ admin:
8
+ images:
9
+ delete: Διαγραφή εικόνας
10
+ edit: Επεξεργασία εικόνας
11
+ form:
12
+ image: Εικόνα
13
+ use_current_image: Χρήση τρέχουσας εικόνας
14
+ or: or
15
+ replace_image: " αλλαγή με αυτήν..."
16
+ current_image: Τρέχουσα εικόνα
17
+ maximum_image_size: Το μέγιστο μέγεθος εικόνας είναι %{bytes}.
18
+ actions:
19
+ create_new_image: Προσθήκη νέας εικόνας
20
+ records:
21
+ no_images_yet: Δεν υπάρχουν εικόνες. Κάντε κλικ στο "Προσθήκη εικόνας" για να προσθέτε την πρώτη εικόνα.
22
+ index:
23
+ view:
24
+ switch_to: Αλλαγή σε %{view_name} view
25
+ list: λίστα
26
+ grid: πλέγμα
27
+ grid_view:
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: Ανέβασμα
35
36
  activerecord:
36
37
  models:
37
- image: εικόνα
38
+ refinery/image: εικόνα
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: Πρέπει να επιλέξετε εικόνα για ανέβασμα
42
- too_long: Η εικόνα πρέπει να είναι μικρότερη από %{count} σε μέγεθος
43
+ too_big: Η εικόνα πρέπει να είναι μικρότερη από %{size} bytes σε μέγεθος
43
44
  incorrect_format: 'Η εικόνα σας πρέπει να είναι JPG, PNG ή GIF'
@@ -1,43 +1,44 @@
1
1
  en:
2
- plugins:
3
- refinery_images:
4
- title: Images
5
- description: Manage images
6
- admin:
7
- images:
8
- delete: Remove this image forever
9
- edit: Edit this image
10
- form:
11
- image: Image
12
- use_current_image: Use current image
13
- or: or
14
- replace_image: " replace it with this one..."
15
- current_image: Current Image
16
- maximum_image_size: The maximum image size is %{megabytes} megabytes.
17
- actions:
18
- create_new_image: Add new image
19
- records:
20
- no_images_yet: There are no images yet. Click "Add new image" to add your first image.
21
- index:
22
- view:
23
- switch_to: Switch to %{view_name} view
24
- list: list
25
- grid: grid
26
- grid_view:
27
- view_live_html: View this image <br/><em>Opens in a new window</em>
28
- existing_image:
29
- button_text: Insert
30
- resize_image: Resize the image?
31
- size: Size
32
- insert:
33
- existing_image: Library
34
- new_image: Upload
2
+ refinery:
3
+ plugins:
4
+ refinery_images:
5
+ title: Images
6
+ description: Manage images
7
+ admin:
8
+ images:
9
+ delete: Remove this image forever
10
+ edit: Edit this image
11
+ form:
12
+ image: Image
13
+ use_current_image: Use current image
14
+ or: or
15
+ replace_image: " replace it with this one..."
16
+ current_image: Current Image
17
+ maximum_image_size: The maximum image size is %{bytes}.
18
+ actions:
19
+ create_new_image: Add new image
20
+ records:
21
+ no_images_yet: There are no images yet. Click "Add new image" to add your first image.
22
+ index:
23
+ view:
24
+ switch_to: Switch to %{view_name} view
25
+ list: list
26
+ grid: grid
27
+ grid_view:
28
+ view_live_html: View this image <br/><em>Opens in a new window</em>
29
+ existing_image:
30
+ button_text: Insert
31
+ resize_image: Resize the image?
32
+ size: Size
33
+ insert:
34
+ existing_image: Library
35
+ new_image: Upload
35
36
  activerecord:
36
37
  models:
37
- image: image
38
+ refinery/image: image
38
39
  errors:
39
40
  models:
40
- image:
41
+ refinery/image:
41
42
  blank: You must specify an image for upload
42
- too_long: Image should be smaller than %{count} in size
43
+ too_big: Image should be smaller than %{size} bytes in size
43
44
  incorrect_format: 'Your image must be either a JPG, PNG or GIF'