spree_multi_slideshow 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README.md +14 -12
  2. data/app/assets/images/store/bx_loader.gif +0 -0
  3. data/app/assets/images/store/controls.png +0 -0
  4. data/app/assets/javascripts/admin/slide_settings.js.erb +41 -0
  5. data/app/assets/javascripts/admin/slides/index.js.coffee +15 -0
  6. data/app/assets/javascripts/admin/slides/new.js.coffee +7 -0
  7. data/app/assets/javascripts/admin/spree_multi_slideshow.js +3 -1
  8. data/app/assets/javascripts/store/spree_multi_slideshow.js +1284 -1
  9. data/app/assets/stylesheets/store/spree_multi_slideshow.css +197 -3
  10. data/app/controllers/spree/admin/slide_settings_controller.rb +50 -0
  11. data/app/controllers/spree/admin/slides_controller.rb +15 -14
  12. data/app/controllers/spree/admin/slideshows_controller.rb +31 -0
  13. data/app/helpers/spree/slideshows_helper.rb +68 -0
  14. data/app/models/spree/app_configuration_decorator.rb +25 -0
  15. data/app/models/spree/product_decorator.rb +3 -0
  16. data/app/models/spree/slide.rb +23 -25
  17. data/app/models/spree/slideshow.rb +17 -0
  18. data/app/models/spree/taxon_decorator.rb +3 -0
  19. data/app/overrides/slideshow_admin_tab.rb +10 -0
  20. data/app/views/spree/admin/shared/_slideshow_sub_menu.html.erb +6 -0
  21. data/app/views/spree/admin/shared/_slideshow_tabs.html.erb +21 -0
  22. data/app/views/spree/admin/slide_settings/edit.html.erb +74 -0
  23. data/app/views/spree/admin/slides/_form.html.erb +29 -9
  24. data/app/views/spree/admin/slides/edit.html.erb +26 -16
  25. data/app/views/spree/admin/slides/index.html.erb +47 -31
  26. data/app/views/spree/admin/slides/new.html.erb +12 -9
  27. data/app/views/spree/admin/slideshows/_form.html.erb +59 -0
  28. data/app/views/spree/admin/slideshows/edit.html.erb +17 -0
  29. data/app/views/spree/admin/slideshows/index.html.erb +51 -0
  30. data/app/views/spree/admin/slideshows/new.html.erb +80 -0
  31. data/app/views/spree/admin/slideshows/new.js.erb +2 -0
  32. data/config/locales/en.yml +53 -85
  33. data/config/locales/it.yml +56 -90
  34. data/config/routes.rb +3 -1
  35. data/db/migrate/20120116081431_create_slideshows.rb +17 -0
  36. data/db/migrate/20120116083546_create_slides.rb +5 -4
  37. data/db/migrate/20120323164044_multi_slideshow_namespace.rb +1 -1
  38. data/lib/generators/spree_multi_slideshow/install/install_generator.rb +1 -21
  39. data/lib/spree_multi_slideshow.rb +0 -2
  40. metadata +26 -73
  41. data/app/assets/images/store/slides/bg-gallery.png +0 -0
  42. data/app/assets/images/store/slides/bg-text02.png +0 -0
  43. data/app/assets/images/store/slides/sprite01.png +0 -0
  44. data/app/assets/javascripts/admin/slides/index.js +0 -10
  45. data/app/assets/javascripts/admin/slides/new.js +0 -5
  46. data/app/assets/javascripts/store/fadeGallery.js +0 -229
  47. data/app/assets/stylesheets/admin/spree_multi_slideshow.css +0 -16
  48. data/app/assets/stylesheets/store/carousel_slideshow.css.scss +0 -73
  49. data/app/controllers/spree/admin/slideshow_types_controller.rb +0 -11
  50. data/app/controllers/spree/slides_controller.rb +0 -5
  51. data/app/controllers/spree/slideshow_types_controller.rb +0 -5
  52. data/app/helpers/spree/slides_helper.rb +0 -4
  53. data/app/helpers/spree/slideshow_types_helper.rb +0 -53
  54. data/app/models/spree/slideshow_type.rb +0 -18
  55. data/app/overrides/slideshow_type_admin_tab.rb +0 -4
  56. data/app/views/spree/admin/shared/_slideshow_type_tabs.html.erb +0 -16
  57. data/app/views/spree/admin/slideshow_types/_form.html.erb +0 -8
  58. data/app/views/spree/admin/slideshow_types/edit.html.erb +0 -8
  59. data/app/views/spree/admin/slideshow_types/index.html.erb +0 -32
  60. data/app/views/spree/admin/slideshow_types/new.html.erb +0 -7
  61. data/db/migrate/20120116081431_create_slideshow_types.rb +0 -15
@@ -0,0 +1,80 @@
1
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @slideshow } %>
2
+
3
+ <%= form_for [:admin, @slideshow], :html => { :multipart => true } do |f| %>
4
+
5
+ <fieldset data-hook="new_slideshow">
6
+
7
+ <legend align="center"><%= t(:new_slideshow) %></legend>
8
+
9
+ <%= f.field_container :category do %>
10
+ <%= f.label :category, t(:category) %> <span class="required">*</span><br />
11
+ <%= f.text_field :category, :class => 'fullwidth title' %>
12
+ <%= f.error_message_on :category %>
13
+ <% end %>
14
+
15
+ <div data-hook="new_slideshow_attrs" class="row">
16
+
17
+ <div class="four columns">
18
+ <%= f.field_container :enable_navigation do %>
19
+ <%= f.label :enable_navigation, t(:enable_navigation) %><br />
20
+ <%= f.check_box :enable_navigation %>
21
+ <%= f.error_message_on :enable_navigation %>
22
+ <% end %>
23
+ </div>
24
+
25
+ <div class="four columns">
26
+ <%= f.field_container :enable_pagination do %>
27
+ <%= f.label :enable_pagination, t(:enable_pagination) %><br />
28
+ <%= f.check_box :enable_pagination %>
29
+ <%= f.error_message_on :enable_pagination %>
30
+ <% end %>
31
+ </div>
32
+
33
+ <div class="four columns">
34
+ <%= f.field_container :enabled do %>
35
+ <%= f.label :enabled, t(:enabled) %><br />
36
+ <%= f.check_box :enabled %>
37
+ <%= f.error_message_on :enabled %>
38
+ <% end %>
39
+ </div>
40
+
41
+ <div class="omega four columns">
42
+ <%= f.field_container :auto_start do %>
43
+ <%= f.label :auto_start, t(:auto_start) %><br />
44
+ <%= f.check_box :auto_start %>
45
+ <%= f.error_message_on :auto_start %>
46
+ <% end %>
47
+ </div>
48
+
49
+ <div class="ten columns">
50
+ <div class="three columns">
51
+ <%= f.field_container :infinite_loop do %>
52
+ <%= f.label :infinite_loop, t(:infinite_loop) %><br />
53
+ <%= f.check_box :infinite_loop %>
54
+ <%= f.error_message_on :infinite_loop %>
55
+ <% end %>
56
+ </div>
57
+
58
+ <div class="three columns">
59
+ <%= f.field_container :mode do %>
60
+ <%= f.label :mode, t(:mode) %><br />
61
+ <%= f.select(:mode, @slideshow.mode_enum, { :include_blank => false }, { :class => 'select2' }) %>
62
+ <%= f.error_message_on :mode %>
63
+ <% end %>
64
+ </div>
65
+
66
+ <div class="omega three columns">
67
+ <%= f.field_container :hide_control_on_end do %>
68
+ <%= f.label :hide_control_on_end, t(:hide_control_on_end) %><br />
69
+ <%= f.check_box :hide_control_on_end %>
70
+ <%= f.error_message_on :hide_control_on_end %>
71
+ <% end %>
72
+ </div>
73
+ </div>
74
+
75
+ </div>
76
+
77
+ <%= render :partial => 'spree/admin/shared/new_resource_links' %>
78
+
79
+ </fieldset>
80
+ <% end %>
@@ -0,0 +1,2 @@
1
+ $("#new_slideshow").html('<%= escape_javascript(render :template => "spree/admin/slideshows/new", :formats => [:html], :handlers => [:erb]) %>');
2
+ $("#admin_new_slideshow").parent().hide();
@@ -1,95 +1,63 @@
1
- ---
2
1
  en:
2
+ images_only: "must be JPG, JPEG, PNG o GIF"
3
+ slideshow_details: "Slideshow Details"
4
+ editing_slideshow: Edit Slideshow
5
+ slide_settings: Slide Setting
6
+ add_new_slide_style: "Add New Slide Style"
7
+ horizontal: "Horizontal"
8
+ fade: "Fade"
9
+ vertical: "Vertical"
10
+ slide_settings_warning: "You will need to regenerate thumbnails if you update the paperclip styles. Use rake paperclip:refresh:thumbnails CLASS=Spree::Slide to do this."
11
+ slide_settings_description: "Slide Settings Description"
12
+ slide_settings_updated: "Slide Settings successfully updated."
13
+ slide_default_style: "Slide Attachments Style"
14
+ slide_default_url: "Slide Attachments Default URL"
15
+ slide_path: "Slide Attachments Path"
16
+ slide_styles: "Slide Paperclip Styles"
17
+ slide_url: "Slide Attachments URL"
18
+ back_to_slides_list: "Back To Slides List"
19
+ back_to_slideshows_list: "Back To Slideshows List"
20
+ new_slideshow: "New Slideshow"
21
+ new_slide: "New Slide"
22
+ listing_slideshows: "Listing Slideshows"
23
+ listing_slides: "Listing Slides"
24
+ no_slides_found: "No Slide Found"
25
+ enabled: Enable?
26
+ slide_number: Slide number
27
+ slide_width: Width
28
+ slide_height: Height
29
+ enable_navigation: Navigation Enable?
30
+ enable_pagination: Pagination Enable?
31
+ mode: "Transaction type"
32
+ auto_start: "Auto start"
33
+ infinite_loop: "Infinite slide"
34
+ hide_control_on_end: "Hide controls on end"
35
+ title: Title
36
+ url: Link url
37
+ attachment: attachment
3
38
  activerecord:
4
- errors: &errors
5
- format: "%{attribute} %{message}\n"
6
-
7
- messages: &errors_messages
8
- inclusion: "is not included in the list"
9
- exclusion: "is reserved"
10
- invalid: "is invalid"
11
- confirmation: "doesn't match confirmation"
12
- record_invalid: "Validation failed: %{errors}"
13
- taken: has already been taken
14
- accepted: "must be accepted"
15
- empty: "can't be empty"
16
- blank: "can't be blank"
17
- too_long:
18
- one: "is too long (maximum is 1 character)"
19
- other: "is too long (maximum is %{count} characters)"
20
- too_short:
21
- one: "is too short (minimum is 1 character)"
22
- other: "is too short (minimum is %{count} characters)"
23
- wrong_length:
24
- one: "is the wrong length (should be 1 character)"
25
- other: "is the wrong length (should be %{count} characters)"
26
- not_a_number: "is not a number"
27
- not_an_integer: "must be an integer"
28
- greater_than: "must be greater than %{count}"
29
- greater_than_or_equal_to: "must be greater than or equal to %{count}"
30
- equal_to: "must be equal to %{count}"
31
- less_than: "must be less than %{count}"
32
- less_than_or_equal_to: "must be less than or equal to %{count}"
33
- odd: "must be odd"
34
- even: "must be even"
35
-
36
- models:
37
- slideshow_type:
38
- attributes:
39
- slideshow_type:
40
- category: Category
41
- enabled: Enable?
42
- slide_width: Width
43
- slide_height: Height
44
- slide_number: Slide Number
45
- enable_navigation: Next and Prev enable?
39
+ models:
40
+ slideshow:
41
+ one: Slideshow
42
+ other: Slideshows
46
43
  slide:
47
- attributes:
48
- slide:
49
- title: Title
50
- url: Link to product or taxonomy or to external website
51
- image: Image
44
+ one: Slide
45
+ other: Slides
52
46
  attributes:
53
- slideshow_type:
47
+ slideshow:
54
48
  category: Category
49
+ updated_at: Updated at
50
+ created_at: Created at
55
51
  enabled: Enable?
52
+ slide_number: Slide number
56
53
  slide_width: Width
57
54
  slide_height: Height
58
- slide_number: Slide Number
59
- enable_navigation: Next and Prev enable?
55
+ enable_navigation: Navigation enable?
56
+ mode: "Transaction type"
57
+ auto_start: "Auto start"
58
+ infinite_loop: "Infinite slide"
59
+ hide_control_on_end: "Hide controls on end"
60
60
  slide:
61
61
  title: Title
62
- url: Link to product or taxonomy or to external website
63
- image: Image
64
- models:
65
- slideshow_type:
66
- one: Slideshow
67
- many: Slideshows
68
- slide:
69
- one: Slide
70
- many: Slides
71
-
72
- slideshow_type:
73
- one: Slideshow
74
- many: Slideshows
75
- enable: Enable?
76
- category: Category
77
- slide_number: Slide Number
78
- detail: Detail
79
- sidebar: Manage slideshow and slide.
80
- new_page: New page
81
- slide:
82
- one: Slide
83
- many: Slides
84
- new_page: New Slide
85
- image:
86
- one: Image
87
- many: Images
88
- thumbnail: Thumbnail
89
- title: Title
90
- position: Position
91
- content: Description
92
- url: Link to product or taxonomy or to external website
93
- editing_page: Editing slide
94
- editing_page: Editing slideshow
95
- confirm_delete: Are you sure ?
62
+ url: Link url
63
+ attachment: attachment
@@ -1,97 +1,63 @@
1
- ---
2
1
  it:
2
+ images_only: "deve essere JPG, JPEG, PNG o GIF"
3
+ slideshow_details: "Dettagli Slideshow"
4
+ editing_slideshow: Modifica Slideshow
5
+ slide_settings: Impostazioni Slide
6
+ add_new_slide_style: "Aggiungi nuovo stile delle Slide"
7
+ horizontal: "Orizzontale"
8
+ fade: "Dissolvenza"
9
+ vertical: "Verticale"
10
+ slide_settings_warning: "Sarà necessario rigenerare le miniature dopo aver aggiornato gli stili di paperclip delle Slide, col comando rake paperclip:refresh:thumbnails CLASS=Spree::Slide"
11
+ slide_settings_description: "Descrizione Impostazioni Slide"
12
+ slide_settings_updated: "Impostazioni Slide aggiornate con successo."
13
+ slide_default_style: "Stile di Default dell'allegato delle Slide"
14
+ slide_default_url: "URL di Default dell'allegato delle Slide"
15
+ slide_path: "Percorso dell'allegato delle Slide"
16
+ slide_styles: "Stili di Paperclip delle Slide"
17
+ slide_url: "URL dell'allegato delle Slide"
18
+ back_to_slides_list: "Torna all'elenco Slides"
19
+ back_to_slideshows_list: "Torna all'elenco Slideshows"
20
+ new_slideshow: "Nuova Slideshow"
21
+ new_slide: "Nuova Slide"
22
+ listing_slideshows: "Elenco Slideshows"
23
+ listing_slides: "Elenco Slides"
24
+ no_slides_found: "Nessuna Slide Trovata"
25
+ enabled: Attiva?
26
+ slide_number: Numero Slide
27
+ slide_width: Larghezza
28
+ slide_height: Altezza
29
+ enable_navigation: Tasti navigazione attivi?
30
+ enable_pagination: Navigazione attiva?
31
+ mode: "Tipo transazione"
32
+ auto_start: "Start automatico"
33
+ infinite_loop: "Slide infinito"
34
+ hide_control_on_end: "Nascondi controller al termine"
35
+ title: Titolo
36
+ url: Link url
37
+ attachment: Immagine
3
38
  activerecord:
4
- errors: &errors
5
- format: "%{attribute} %{message}\n"
6
-
7
- messages: &errors_messages
8
- inclusion: "non è incluso nella lista"
9
- exclusion: "è riservato"
10
- invalid: "non è valido"
11
- confirmation: "non coincide con la conferma"
12
- record_invalid: "Validazione fallita: %{errors}"
13
- taken: è già in uso
14
- accepted: "deve essere accettata"
15
- empty: "non può essere vuoto"
16
- blank: "non può essere lasciato in bianco"
17
- too_long:
18
- one: "è troppo lungo (il massimo è 1 carattere)"
19
- other: "è troppo lungo (il massimo è %{count} caratteri)"
20
- too_short:
21
- one: "è troppo corto (il minimo è 1 carattere)"
22
- other: "è troppo corto (il minimo è %{count} caratteri)"
23
- wrong_length:
24
- one: "è della lunghezza sbagliata (deve essere di 1 carattere)"
25
- other: "è della lunghezza sbagliata (deve essere di %{count} caratteri)"
26
- not_a_number: "non è un numero"
27
- not_an_integer: "non è un intero"
28
- greater_than: "deve essere superiore a %{count}"
29
- greater_than_or_equal_to: "deve essere superiore o uguale a %{count}"
30
- equal_to: "deve essere uguale a %{count}"
31
- less_than: "deve essere meno di %{count}"
32
- less_than_or_equal_to: "deve essere meno o uguale a %{count}"
33
- odd: "deve essere dispari"
34
- even: "deve essere pari"
35
-
36
- models:
37
- slideshow_type:
38
- attributes:
39
- slideshow_type:
40
- category: Categoria
41
- enabled: Attivo?
42
- slide_width: Larghezza
43
- slide_height: Altezza
44
- slide_number: Numero Slide
45
- enable_navigation: Tasti navigazione attivi?
46
- slide:
47
- attributes:
48
- slide:
49
- title: Titolo
50
- url: Link a prodotto o tassonomia o a sito esterno
51
- image: Immagine
39
+ models:
40
+ slideshow:
41
+ one: Slideshow
42
+ other: Slideshows
43
+ slide:
44
+ one: Slide
45
+ other: Slides
52
46
  attributes:
53
- slideshow_type:
47
+ slideshow:
54
48
  category: Categoria
55
- enabled: Attivo?
56
- url: Link a prodotto o tassonomia o a sito esterno
57
- attachment_width: Larghezza immagine
58
- attachment_height: Altezza immagine
59
- attachment: Immagine
60
- position: Posizione (se esistono altri banner con la stessa categoria)
49
+ updated_at: Aggiornata il
50
+ created_at: Creata il
51
+ enabled: Attiva?
52
+ slide_number: Numero Slide
53
+ slide_width: Larghezza
54
+ slide_height: Altezza
55
+ enable_navigation: Tasti navigazione attivi?
56
+ mode: "Tipo transazione"
57
+ auto_start: "Start automatico"
58
+ infinite_loop: "Slide infinito"
59
+ hide_control_on_end: "Nascondi controller al termine"
61
60
  slide:
62
61
  title: Titolo
63
62
  url: Link a prodotto o tassonomia o a sito esterno
64
- image: Immagine
65
- models:
66
- slideshow_type:
67
- one: Slideshow
68
- many: Slideshows
69
- slide:
70
- one: Slide
71
- many: Slides
72
-
73
-
74
- slideshow_type:
75
- one: Slideshow
76
- many: Slideshows
77
- enable: Attivo?
78
- category: Categoria
79
- slide_number: Numero Slide
80
- detail: Attributi
81
- sidebar: Gestione slideshow e slide.
82
- new_page: Nuovo slideshow
83
- slide:
84
- one: Slide
85
- many: Slides
86
- new_page: Nuova slide
87
- image:
88
- one: Immagine
89
- many: Immagini
90
- thumbnail: Miniatura
91
- title: Titolo
92
- position: Posizione
93
- content: Descrizione
94
- url: Link a prodotto o tassonomia o a sito esterno
95
- editing_page: Modifica slide
96
- editing_page: Modifica slideshow
97
- confirm_delete: Sei sicuro?
63
+ attachment: Immagine
data/config/routes.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  Spree::Core::Engine.routes.draw do
2
2
 
3
3
  namespace :admin do
4
- resources :slideshow_types do
4
+ resources :slideshows do
5
5
  resources :slides do
6
6
  collection do
7
7
  post :update_positions
8
8
  end
9
9
  end
10
10
  end
11
+
12
+ resource :slide_settings
11
13
  end
12
14
 
13
15
  end
@@ -0,0 +1,17 @@
1
+ class CreateSlideshows < ActiveRecord::Migration
2
+ def change
3
+ create_table :slideshows do |t|
4
+ t.string :category
5
+ t.boolean :enabled, :default => false
6
+ t.string :mode, :default => 'horizontal'
7
+ t.boolean :auto_start, :default => false
8
+ t.boolean :infinite_loop, :default => false
9
+ t.boolean :hide_control_on_end, :default => true
10
+ t.boolean :enable_navigation, :default => true
11
+ t.boolean :enable_pagination, :default => false
12
+
13
+ t.timestamps
14
+ end
15
+ add_index :slideshows, :category, :unique => true
16
+ end
17
+ end
@@ -2,14 +2,15 @@ class CreateSlides < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :slides do |t|
4
4
  t.string :title, :url
5
- t.text :content
5
+ t.text :presentation
6
+ t.boolean :enabled, :default => true
6
7
 
7
8
  t.string :attachment_content_type, :attachment_file_name
8
9
  t.datetime :attachment_updated_at
9
10
  t.integer :attachment_size, :position
10
- t.string :type, :limit => 75
11
-
12
- t.references :slideshow_type
11
+
12
+ t.references :slideable, :polymorphic => true
13
+ t.references :slideshow
13
14
 
14
15
  t.timestamps
15
16
  end
@@ -1,6 +1,6 @@
1
1
  class MultiSlideshowNamespace < ActiveRecord::Migration
2
2
  def change
3
- rename_table :slideshow_types, :spree_slideshow_types
3
+ rename_table :slideshows, :spree_slideshows
4
4
  rename_table :slides, :spree_slides
5
5
  end
6
6
  end