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,17 @@
1
+ module Spree
2
+ class Slideshow < ActiveRecord::Base
3
+ has_many :slides
4
+
5
+ attr_accessible :category, :enable_navigation, :enable_pagination, :enabled, :mode, :auto_start, :infinite_loop,
6
+ :hide_control_on_end
7
+
8
+ validates :category, :presence => true
9
+ validates_uniqueness_of :category
10
+
11
+ scope :enable, lambda { |category| {:conditions => {:enabled => true, :category => category}} }
12
+
13
+ def mode_enum
14
+ [[I18n.t(:horizontal), "horizontal"], [I18n.t(:fade), "fade"], [I18n.t(:vertical), "vertical"]]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ Spree::Taxon.class_eval do
2
+ has_many :slides, :as => :slideable
3
+ end
@@ -0,0 +1,10 @@
1
+ Deface::Override.new(:virtual_path => "spree/layouts/admin",
2
+ :name => "slideshow_admin_tab",
3
+ :insert_bottom => "[data-hook='admin_tabs']",
4
+ :text => "<%= tab(:slideshows, :icon => 'icon-picture') %>")
5
+
6
+ Deface::Override.new(:virtual_path => "spree/admin/shared/_configuration_menu",
7
+ :name => "add_slide_settings",
8
+ :insert_bottom => "[data-hook='admin_configurations_sidebar_menu'], #admin_configurations_sidebar_menu[data-hook]",
9
+ :text => "<%= configurations_sidebar_menu_item t(:slide_settings), edit_admin_slide_settings_path %>")
10
+
@@ -0,0 +1,6 @@
1
+ <% content_for :sub_menu do %>
2
+ <ul id="sub_nav" data-hook="admin_slideshow_sub_tabs" class="inline-menu">
3
+ <%= tab :slideshows, :match_path => '/slideshows' %>
4
+ <%= tab :slide_settings, edit_admin_slide_settings_url %>
5
+ </ul>
6
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <% content_for :page_title do %>
2
+ <%= t(:editing_slideshow) %> &ldquo;<%= @slideshow.category %>&rdquo;
3
+ <% end %>
4
+
5
+ <% content_for :sidebar_title do %>
6
+ <span class="category"><%= @slideshow.category %></span>
7
+ <% end %>
8
+
9
+ <% content_for :sidebar do %>
10
+ <nav class="menu">
11
+ <ul data-hook="admin_slideshow_tabs">
12
+ <li<%== ' class="active"' if current == 'Slideshow Details' %>>
13
+ <%= link_to_with_icon 'icon-edit', t(:slideshow_details), edit_admin_slideshow_url(@slideshow) %>
14
+ </li>
15
+ <li<%== ' class="active"' if current == 'Slides' %>>
16
+ <%= link_to_with_icon 'icon-picture', t(:slides), admin_slideshow_slides_url(@slideshow) %>
17
+ </li>
18
+ </ul>
19
+ </nav>
20
+
21
+ <% end %>
@@ -0,0 +1,74 @@
1
+ <%= render :partial => 'spree/admin/shared/configuration_menu' %>
2
+
3
+ <% content_for :page_title do %>
4
+ <%= t(:slide_settings) %>
5
+ <% end %>
6
+
7
+ <%= render :partial => 'spree/admin/shared/slideshow_sub_menu' %>
8
+
9
+ <%= form_tag admin_slide_settings_path, :method => :put do %>
10
+
11
+ <fieldset class="no-border-top">
12
+ <fieldset class="no-border-bottom">
13
+ <legend align="center"><%= t(:general_settings)%></legend>
14
+
15
+ <div class="field">
16
+ <div class="warning note"><%= t(:slide_settings_warning) %></div>
17
+ </div>
18
+
19
+ <div data-hook="slide_path" class="field">
20
+ <%= label_tag 'preferences[slide_path]', t(:slide_path) %>
21
+ <%= preference_field_tag 'preferences[slide_path]', Spree::Config[:slide_path], :type => :string %>
22
+ </div>
23
+
24
+ <div class="alpha eight columns">
25
+ <div data-hook="slide_default_url" class="field">
26
+ <%= label_tag 'preferences[slide_default_url]', t(:slide_default_url) %>
27
+ <%= preference_field_tag 'preferences[slide_default_url]', Spree::Config[:slide_default_url], :type => :string %>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="alpha eight columns">
32
+ <div data-hook="slide_url" class="field">
33
+ <%= label_tag 'preferences[slide_url]', t(:slide_url) %>
34
+ <%= preference_field_tag 'preferences[slide_url]', Spree::Config[:slide_url], :type => :string %>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="omega four columns">
39
+ <div data-hook="slide_default_style" class="field">
40
+ <%= label_tag 'preferences[slide_default_style]', t(:slide_default_style) %>
41
+ <%= collection_select 'preferences', 'slide_default_style', @styles, :first, :first, {:selected => Spree::Config[:slide_default_style] }, :class => 'select2 fullwidth' %>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="clear"></div>
46
+
47
+ </fieldset>
48
+
49
+ <fieldset class="no-border-bottom" id="slide_styles" data-hook="attachment_styles">
50
+ <legend align="center"><%= t(:slide_styles) %></legend>
51
+
52
+ <div id="styles_list" class="row frameless">
53
+ <% @styles.each_with_index do |(style_name, style_value), index| %>
54
+ <div class="field three columns">
55
+ <%= label_tag "slide_styles[#{style_name}]", style_name %>
56
+ <a href='#' alt="<%= t(:destroy)%>" title="<%= t(:destroy)%>" class='destroy_style with-tip'><i class='icon-trash'></i></a>
57
+ <%= text_field_tag "slide_styles[#{style_name}]", style_value, :class => 'fullwidth' %>
58
+ </div>
59
+ <% end %>
60
+ </div>
61
+
62
+ <div id="new-slide-styles" class="row frameless"></div>
63
+
64
+ <div class="field">
65
+ <%= link_to_with_icon 'icon-plus', t(:add_new_slide_style), '#', :class => 'add_new_slide_style button' %>
66
+ </div>
67
+ </fieldset>
68
+
69
+ <div class="form-buttons filter-actions actions" data-hook="buttons">
70
+ <%= button t(:update), 'icon-refresh' %>
71
+ </div>
72
+ </fieldset>
73
+
74
+ <% end %>
@@ -1,9 +1,29 @@
1
- <%= f.inputs do %>
2
- <%= f.input :title %>
3
- <%= f.input :url %>
4
- <%= f.input :attachment_width, :input_html => { :value => @slideshow_type.slide_width}, :as => :hidden %>
5
- <%= f.input :attachment_height, :input_html => { :value => @slideshow_type.slide_height}, :as => :hidden %>
6
- <%= f.cktext_area :content, :input_html => { :value => @slide.content }, :label => t("slideshow_type.slide.content") %>
7
- <%= f.input :attachment, :as => :file, :label => I18n.t("slideshow_type.slide.image.one").capitalize, :hint => f.object.attachment.blank? ? f.template.content_tag(:span, "No Image Yet") : f.template.image_tag(f.object.attachment.url(:thumbnail)) %>
8
- <%= f.input :slideshow_type_id, :as => :hidden, :value => params[:slideshow_type_id] %>
9
- <% end %>
1
+ <div data-hook="admin_slide_form_fields">
2
+ <div class="eight columns alpha">
3
+ <div data-hook="file" class="field">
4
+ <%= f.label t(:filename) %><br>
5
+ <%= f.file_field :attachment %>
6
+ </div>
7
+ <div data-hook="enabled" class="field">
8
+ <label>
9
+ <%= f.check_box :enabled %>
10
+ <%= t(:enabled) %>
11
+ </label>
12
+ </div>
13
+ </div>
14
+ <div class="omega eight columns">
15
+ <div data-hook="title" class="field">
16
+ <%= f.label t(:title) %><br>
17
+ <%= f.text_field :title, :class => 'fullwidth' %>
18
+ </div>
19
+ <div data-hook="url" class="field">
20
+ <%= f.label t(:url) %><br>
21
+ <%= f.text_field :url, :class => 'fullwidth' %>
22
+ </div>
23
+ <div data-hook="presentation" class="field">
24
+ <%= f.label t(:presentation) %><br>
25
+ <%= f.text_area :presentation, :rows => 4, :class => 'fullwidth' %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ <div class="clear"></div>
@@ -1,17 +1,27 @@
1
- <%= render :partial => 'spree/admin/shared/slideshow_type_tabs', :locals => {:current => 'Slide Image'} %>
2
- <h1><%= t("slideshow_type.slide.editing_page") %></h1>
3
- <%= render 'spree/shared/error_messages', :target => @slide %>
1
+ <%= render :partial => 'spree/admin/shared/slideshow_sub_menu' %>
2
+ <%= render :partial => 'spree/admin/shared/slideshow_tabs', :locals => { :current => 'Slides' } %>
4
3
 
5
- <%= semantic_form_for [:admin, @slideshow_type, @slide], :html => { :multipart => true } do |f| %>
6
- <table class="basic-table" data-hook="edit_image">
7
- <tr data-hook="thumbnail">
8
- <td><%= t(:thumbnail) %>:</td>
9
- <td><%= link_to image_tag(@slide.attachment.url(:small)), @slide.attachment.url(:medium) %></td>
10
- </tr>
11
- <%= render :partial => 'form', :locals => { :f => f } %>
12
- </table>
13
- <p class="form-buttons" data-hook="buttons">
14
- <%= button t(:update) %>
15
- <%= t(:or) %> <%= link_to t(:cancel), admin_slideshow_type_slide_url(@slideshow_type), :id => 'cancel_link' %>
16
- </p>
17
- <% end %>
4
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @slide } %>
5
+
6
+ <% content_for :page_actions do %>
7
+ <li><%= button_link_to t(:back_to_slides_list), admin_slideshow_slides_url(@slideshow), :icon => 'icon-arrow-left' %></li>
8
+ <% end %>
9
+
10
+ <%= form_for [:admin, @slideshow, @slide], :html => { :multipart => true } do |f| %>
11
+ <fieldset data-hook="edit_image">
12
+ <legend align="center"><%= @slide.attachment_file_name%></legend>
13
+ <div data-hook="thumbnail" class="field alpha three columns align-center">
14
+ <%= f.label t(:thumbnail) %><br>
15
+ <%= link_to image_tag(@slide.attachment.url(:mini)), @slide.attachment.url(:large) %>
16
+ </div>
17
+ <div class="nine columns omega">
18
+ <%= render :partial => 'form', :locals => { :f => f } %>
19
+ </div>
20
+ <div class="clear"></div>
21
+ <div class="form-buttons filter-actions actions" data-hook="buttons">
22
+ <%= button t(:update), 'icon-refresh' %>
23
+ <span class="or"><%= t(:or) %></span>
24
+ <%= link_to t(:cancel), admin_slideshow_slides_url(@slideshow), :id => 'cancel_link', :class => 'button icon-remove' %>
25
+ </div>
26
+ </fieldset>
27
+ <% end %>
@@ -1,35 +1,51 @@
1
- <%= render :partial => 'spree/admin/shared/slideshow_type_tabs', :locals => {:current => 'Slide Image'} %>
1
+ <%= render :partial => 'spree/admin/shared/slideshow_sub_menu' %>
2
+ <%= render :partial => 'spree/admin/shared/slideshow_tabs', :locals => {:current => 'Slides'} %>
2
3
 
3
- <%= javascript_include_tag 'admin/slides/index.js' %>
4
- <div id="slides" data-hook></div>
5
- <p data-hook="links">
6
- <%= link_to icon('add') + ' ' + t("slideshow_type.slide.new_page"), new_admin_slideshow_type_slide_url(@slideshow_type), :id => 'new_slide_link' %>
7
- </p>
4
+ <% content_for :page_actions do %>
5
+ <li><%= link_to_with_icon('icon-plus', t(:new_slide), new_admin_slideshow_slide_url(@slideshow), :id => 'new_slide_link', :class => 'button') %></li>
6
+ <% end %>
8
7
 
9
- <table class="index sortable" data-hook="slide_table" data-hook data-sortable-link="<%= update_positions_admin_slideshow_type_slides_url %>">
10
- <tr data-hook="images_header">
11
- <th><%= t("slideshow_type.slide.thumbnail") %></th>
12
- <th><%= t("slideshow_type.slide.title") %></th>
13
- <th><%= t("slideshow_type.slide.position") %></th>
14
- <th><%= t("slideshow_type.slide.url") %></th>
15
- <th><%= t(:action) %></th>
16
- </tr>
8
+ <div id="slides" data-hook></div>
17
9
 
18
- <% Spree::Slide.where("slideshow_type_id = ?", @slideshow_type.id).order("position ASC").each do |slide| %>
19
- <tr id="<%= dom_id(slide) %>" data-hook="images_row">
20
- <td>
21
- <span class="handle"></span>
22
- <%= link_to image_tag(slide.attachment.url(:thumbnail)), slide.attachment.url(:medium) %>
23
- </td>
24
- <td><%= slide.title %></td>
25
- <td><%= slide.position %></td>
26
- <td><%= slide.url %></td>
27
- <td class="actions">
28
- <%= link_to_with_icon 'edit', t(:edit), edit_admin_slideshow_type_slide_url(@slideshow_type, slide), :class => 'edit' %>
29
- &nbsp;
30
- <%= link_to_delete slide, {:url => admin_slideshow_type_slide_url(@slideshow_type, slide) }%>
31
- </td>
32
- </tr>
33
- <% end %>
10
+ <% unless @slideshow.slides.any? %>
11
+ <div class="no-objects-found">
12
+ <%= t(:no_slides_found) %>.
13
+ </div>
14
+ <% else %>
15
+ <table class="index sortable" data-hook="slides_table" data-sortable-link="<%= update_positions_admin_slideshow_slides_url(@slideshow) %>">
16
+ <colgroup>
17
+ <col style="width: 5%">
18
+ <col style="width: 10%">
19
+ <col style="width: 25%">
20
+ <col style="width: 45%">
21
+ <col style="width: 15%">
22
+ </colgroup>
23
+ <thead>
24
+ <tr data-hook="slides_header">
25
+ <th colspan="2"><%= t(:thumbnail) %></th>
26
+ <th><%= t(:alt_text) %></th>
27
+ <th><%= t(:enabled) %></th>
28
+ <th class="actions"></th>
29
+ </tr>
30
+ </thead>
34
31
 
35
- </table>
32
+ <tbody>
33
+ <% (@slideshow.slides).each do |slide| %>
34
+ <tr id="<%= spree_dom_id slide %>" data-hook="slides_row" class="<%= cycle('odd', 'even')%>">
35
+ <td class="no-border">
36
+ <span class="handle"></span>
37
+ </td>
38
+ <td>
39
+ <%= link_to image_tag(slide.attachment.url(:mini)), slide.attachment.url(:large) %>
40
+ </td>
41
+ <td><%= slide.presentation %></td>
42
+ <td align="center"><%= icon('icon-check icon-large') if slide.enabled %></td>
43
+ <td class="actions">
44
+ <%= link_to_with_icon 'icon-edit', t(:edit), edit_admin_slideshow_slide_url(@slideshow, slide), :no_text => true, :data => {:action => 'edit'} %>
45
+ <%= link_to_delete slide, { :url => admin_slideshow_slide_url(@slideshow, slide), :no_text => true } %>
46
+ </td>
47
+ </tr>
48
+ <% end %>
49
+ </tbody>
50
+ </table>
51
+ <% end %>
@@ -1,12 +1,15 @@
1
- <h4><%= t("slideshow_type.slide.new_page") %></h4>
2
- <%= semantic_form_for [:admin, @slideshow_type, @slide], :html => { :multipart => true } do |f| %>
3
- <table class="basic-table" data-hook="new_slide">
4
- <%= render :partial => 'form', :locals => { :f => f } %>
5
- </table>
6
- <p class="form-buttons" data-hook="buttons">
7
- <%= button t(:update) %>
8
- <%= t(:or) %> <%= link_to t(:cancel), admin_slideshow_type_slides_url(@slideshow_type), :id => 'cancel_link' %>
9
- </p>
1
+ <%= form_for [:admin, @slideshow, @slide], :html => { :multipart => true } do |f| %>
2
+ <fieldset data-hook="new_image">
3
+ <legend align="center"><%= t(:new_slide) %></legend>
4
+
5
+ <%= render :partial => 'form', :locals => { :f => f } %>
6
+
7
+ <div class="form-buttons filter-actions actions" data-hook="buttons">
8
+ <%= button t(:update), 'icon-refresh' %>
9
+ <span class="or"><%= t(:or) %></span>
10
+ <%= link_to_with_icon 'icon-remove', t(:cancel), admin_slideshow_slides_url(@slideshow), :id => 'cancel_link', :class => 'button' %>
11
+ </div>
12
+ </fieldset>
10
13
  <% end %>
11
14
 
12
15
  <%= javascript_include_tag 'admin/slides/new.js' %>
@@ -0,0 +1,59 @@
1
+ <div data-hook="admin_slideshow_form_fields">
2
+ <div class="left eight columns alpha" data-hook="admin_slideshow_form_left">
3
+ <%= f.field_container :category do %>
4
+ <%= f.label :category, t(:category) %> <span class="required">*</span><br />
5
+ <%= f.text_field :category, :class => 'fullwidth title' %>
6
+ <%= f.error_message_on :category %>
7
+ <% end %>
8
+
9
+ <%= f.field_container :enable_navigation do %>
10
+ <%= f.label :enable_navigation, t(:enable_navigation) %><br />
11
+ <%= f.check_box :enable_navigation %>
12
+ <%= f.error_message_on :enable_navigation %>
13
+ <% end %>
14
+
15
+ <%= f.field_container :enable_pagination do %>
16
+ <%= f.label :enable_pagination, t(:enable_pagination) %><br />
17
+ <%= f.check_box :enable_pagination %>
18
+ <%= f.error_message_on :enable_pagination %>
19
+ <% end %>
20
+
21
+ <%= f.field_container :enabled do %>
22
+ <%= f.label :enabled, t(:enabled) %><br />
23
+ <%= f.check_box :enabled %>
24
+ <%= f.error_message_on :enabled %>
25
+ <% end %>
26
+ </div>
27
+ <div class="right four columns omega" data-hook="admin_slideshow_form_right">
28
+ <%= f.field_container :mode do %>
29
+ <%= f.label :mode, t(:mode) %><br />
30
+ <%= f.select(:mode, @slideshow.mode_enum, { :include_blank => false }, { :class => 'select2' }) %>
31
+ <%= f.error_message_on :mode %>
32
+ <% end %>
33
+
34
+ <%= f.field_container :auto_start do %>
35
+ <%= f.label :auto_start, t(:auto_start) %><br />
36
+ <%= f.check_box :auto_start %>
37
+ <%= f.error_message_on :auto_start %>
38
+ <% end %>
39
+
40
+ <%= f.field_container :infinite_loop do %>
41
+ <%= f.label :infinite_loop, t(:infinite_loop) %><br />
42
+ <%= f.check_box :infinite_loop %>
43
+ <%= f.error_message_on :infinite_loop %>
44
+ <% end %>
45
+
46
+ <%= f.field_container :hide_control_on_end do %>
47
+ <%= f.label :hide_control_on_end, t(:hide_control_on_end) %><br />
48
+ <%= f.check_box :hide_control_on_end %>
49
+ <%= f.error_message_on :hide_control_on_end %>
50
+ <% end %>
51
+ </div>
52
+
53
+ <div class="clear"></div>
54
+
55
+ <div data-hook="admin_slideshow_form_additional_fields"></div>
56
+
57
+ <div class="clear"></div>
58
+
59
+ </div>
@@ -0,0 +1,17 @@
1
+ <% content_for :page_actions do %>
2
+ <li><%= button_link_to t(:back_to_slideshows_list), admin_slideshows_url, :icon => 'icon-arrow-left' %></li>
3
+ <li id="new_slideshow_link">
4
+ <%= button_link_to t(:new_slideshow), new_object_url, { :remote => true, :icon => 'icon-plus', :id => 'admin_new_slideshow' } %>
5
+ </li>
6
+ <% end %>
7
+
8
+ <%= render :partial => 'spree/admin/shared/slideshow_sub_menu' %>
9
+ <%= render :partial => 'spree/admin/shared/slideshow_tabs', :locals => { :current => 'Slideshow Details' } %>
10
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @slideshow } %>
11
+
12
+ <%= form_for [:admin, @slideshow], :method => :put, :html => { :multipart => true } do |f| %>
13
+ <fieldset class="no-border-top">
14
+ <%= render :partial => 'form', :locals => { :f => f } %>
15
+ <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
16
+ </fieldset>
17
+ <% end %>
@@ -0,0 +1,51 @@
1
+ <% content_for :page_title do %>
2
+ <%= t(:listing_slideshows) %>
3
+ <% end %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <div class="toolbar" data-hook="toolbar">
7
+ <ul class="actions header-action-links inline-menu">
8
+ <li id="new_slideshow_link">
9
+ <%= button_link_to t(:new_slideshow), new_object_url, { :remote => true, :icon => 'icon-plus', :id => 'admin_new_slideshow' } %>
10
+ </li>
11
+ </ul>
12
+ </div>
13
+ <% end %>
14
+
15
+ <%= render :partial => 'spree/admin/shared/slideshow_sub_menu' %>
16
+
17
+ <div id="new_slideshow" data-hook></div>
18
+
19
+ <% if @collection.any? %>
20
+ <table class="index" id="listing_slideshows">
21
+ <colgroup>
22
+ <col style="width: 55%;">
23
+ <col style="width: 10%;">
24
+ <col style="width: 17%;">
25
+ </colgroup>
26
+ <thead>
27
+ <tr data-hook="admin_slideshows_index_headers">
28
+ <th><%= t(:category) %></th>
29
+ <th><%= t(:enabled) %></th>
30
+ <th data-hook="admin_slideshows_index_header_actions" class="actions"></th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <% @slideshows.each do |slideshow| %>
35
+ <tr id="<%= spree_dom_id slideshow %>" data-hook="admin_slideshows_index_rows" class="<%= cycle('odd', 'even') %>">
36
+ <td><%= slideshow.category %> (<%= slideshow.slides.count %> <%= t(:slides) %>)</td>
37
+ <td align="center"><%= icon('icon-check icon-large') if slideshow.enabled %></td>
38
+ <td class="actions" data-hook="admin_slideshows_index_row_actions">
39
+ <%= link_to_edit slideshow, :no_text => true, :class => 'edit' %>
40
+ &nbsp;
41
+ <%= link_to_delete slideshow, :no_text => true %>
42
+ </td>
43
+ </tr>
44
+ <% end %>
45
+ </tbody>
46
+ </table>
47
+ <% else %>
48
+ <div class="no-objects-found">
49
+ <%= t(:no_results) %>
50
+ </div>
51
+ <% end %>