refinerycms-image_slideshows 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb +61 -0
- data/app/models/refinery/image_slideshows/image_slide.rb +17 -0
- data/app/models/refinery/image_slideshows/image_slideshow.rb +2 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/_actions.html.erb +24 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/_form.html.erb +37 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/_image_slide.html.erb +16 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/_image_slides.html.erb +1 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/_records.html.erb +18 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/_sortable_list.html.erb +5 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/edit.html.erb +1 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/index.html.erb +10 -0
- data/app/views/refinery/image_slideshows/admin/image_slides/new.html.erb +1 -0
- data/app/views/refinery/image_slideshows/admin/image_slideshows/_actions.html.erb +0 -19
- data/app/views/refinery/image_slideshows/admin/image_slideshows/_image_slideshow.html.erb +6 -8
- data/config/locales/en.yml +29 -4
- data/config/locales/es.yml +30 -5
- data/config/locales/fr.yml +33 -5
- data/config/locales/nb.yml +30 -4
- data/config/locales/nl.yml +30 -4
- data/config/locales/sk.yml +30 -4
- data/config/locales/zh-CN.yml +27 -6
- data/config/routes.rb +6 -6
- data/db/migrate/1_create_image_slideshows_image_slideshows.rb +0 -4
- data/db/migrate/2_create_image_slides_image_slides.rb +23 -0
- data/db/migrate/3_add_image_and_caption_to_image_slides.rb +6 -0
- data/db/seeds.rb +12 -10
- data/lib/generators/refinery/image_slideshows_generator.rb +1 -1
- data/lib/refinery/image_slideshows/engine.rb +1 -1
- data/lib/refinerycms-image_slideshows.rb +1 -1
- metadata +14 -4
- data/app/controllers/refinery/image_slideshows/image_slideshows_controller.rb +0 -34
- data/app/views/refinery/image_slideshows/image_slideshows/index.html.erb +0 -11
- data/app/views/refinery/image_slideshows/image_slideshows/show.html.erb +0 -27
@@ -0,0 +1,61 @@
|
|
1
|
+
module Refinery
|
2
|
+
module ImageSlideshows
|
3
|
+
module Admin
|
4
|
+
class ImageSlidesController < ::Refinery::AdminController
|
5
|
+
|
6
|
+
crudify :'refinery/image_slideshows/image_slide', :sortable => true
|
7
|
+
|
8
|
+
before_filter :find_image_slideshow
|
9
|
+
before_filter :find_image_slide, :except => [:index, :new]
|
10
|
+
|
11
|
+
def index
|
12
|
+
find_image_slides
|
13
|
+
end
|
14
|
+
|
15
|
+
def create
|
16
|
+
@image_slide.position = Refinery::ImageSlideshows::ImageSlide.maximum(:position) + 1
|
17
|
+
|
18
|
+
if @image_slide.valid? && @image_slide.save
|
19
|
+
redirect_to image_slides_path, :notice => 'Image slide was successfully created.'
|
20
|
+
else
|
21
|
+
render :action => :new
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def update
|
26
|
+
if @image_slide.update_attributes(params[:image_slide])
|
27
|
+
redirect_to image_slides_path, :notice => 'Image slide was successfully updated.'
|
28
|
+
else
|
29
|
+
render :action => :edit
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
if @image_slide.destroy
|
35
|
+
redirect_to image_slides_path, :notice => 'Image slide was successfully deleted.'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def image_slides_path
|
42
|
+
refinery.image_slideshows_admin_image_slideshow_image_slides_path(@image_slideshow)
|
43
|
+
end
|
44
|
+
|
45
|
+
def find_image_slide
|
46
|
+
@image_slide = Refinery::ImageSlideshows::ImageSlide.find(params[:id]) if params[:id]
|
47
|
+
@image_slide ||= Refinery::ImageSlideshows::ImageSlide.new(params[:image_slide]) if params[:image_slide]
|
48
|
+
end
|
49
|
+
|
50
|
+
def find_image_slideshow
|
51
|
+
@image_slideshow = Refinery::ImageSlideshows::ImageSlideshow.find(params[:image_slideshow_id])
|
52
|
+
end
|
53
|
+
|
54
|
+
def find_image_slides
|
55
|
+
@image_slides = @image_slideshow.image_slides.order(:position) if @image_slideshow.present?
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Refinery
|
2
|
+
module ImageSlideshows
|
3
|
+
class ImageSlide < Refinery::Core::BaseModel
|
4
|
+
self.table_name = 'refinery_image_slides'
|
5
|
+
|
6
|
+
attr_accessible :title, :image_id, :caption, :position, :image_slideshow_id
|
7
|
+
|
8
|
+
acts_as_indexed :fields => [:title]
|
9
|
+
|
10
|
+
validates :title, :presence => true
|
11
|
+
validates :image_id, :presence => true
|
12
|
+
|
13
|
+
belongs_to :image_slideshow
|
14
|
+
belongs_to :image
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>
|
3
|
+
<%= link_to t('.create_new'), refinery.new_image_slideshows_admin_image_slideshow_image_slide_path,
|
4
|
+
:class => "add_icon" %>
|
5
|
+
</li>
|
6
|
+
<li>
|
7
|
+
<%= link_to t('.reorder', :what => "Image Slides"),
|
8
|
+
refinery.image_slideshows_admin_image_slideshow_image_slides_path,
|
9
|
+
:id => "reorder_action",
|
10
|
+
:class => "reorder_icon" %>
|
11
|
+
|
12
|
+
<%= link_to t('.reorder_done', :what => "Image Slides"),
|
13
|
+
refinery.image_slideshows_admin_image_slideshow_image_slides_path,
|
14
|
+
:id => "reorder_action_done",
|
15
|
+
:style => "display: none;",
|
16
|
+
:class => "reorder_icon" %>
|
17
|
+
</li>
|
18
|
+
<% if @image_slideshow.present? %>
|
19
|
+
<li>
|
20
|
+
<%= link_to "Back to Image Slideshows", refinery.image_slideshows_admin_image_slideshows_path,
|
21
|
+
:class => "back_icon" %>
|
22
|
+
</li>
|
23
|
+
<% end %>
|
24
|
+
</ul>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<%= form_for [refinery, :image_slideshows_admin, @image_slideshow, @image_slide] do |f| -%>
|
2
|
+
<%= render '/refinery/admin/error_messages',
|
3
|
+
:object => @image_slide,
|
4
|
+
:include_object_name => true %>
|
5
|
+
|
6
|
+
<%= f.hidden_field :image_slideshow_id, :value => @image_slideshow.id -%>
|
7
|
+
|
8
|
+
<div class='field'>
|
9
|
+
<%= f.label :title -%>
|
10
|
+
<%= f.text_field :title, :class => 'larger widest' -%>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class='field'>
|
14
|
+
<%= f.label :image_id, 'Image' %>
|
15
|
+
|
16
|
+
<%= render :partial => '/refinery/admin/image_picker', :locals => {
|
17
|
+
:f => f,
|
18
|
+
:field => :image_id,
|
19
|
+
:image => @image_slide.image,
|
20
|
+
:thumbnail => ''
|
21
|
+
} %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class='field'>
|
25
|
+
<%= f.label :caption -%>
|
26
|
+
<%= f.text_field :caption -%>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<% delete_url = @image_slide.id ? refinery.image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, @image_slide) : nil %>
|
30
|
+
|
31
|
+
<%= render '/refinery/admin/form_actions', :f => f,
|
32
|
+
:continue_editing => false,
|
33
|
+
:delete_title => t('delete', :scope => 'refinery.image_slides.admin.image_slides.image_slide'),
|
34
|
+
:delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @image_slide.title),
|
35
|
+
:delete_url => delete_url,
|
36
|
+
:cancel_url => refinery.image_slideshows_admin_image_slideshow_image_slides_path(@image_slideshow) %>
|
37
|
+
<% end -%>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(image_slide) -%>" style="background-color: #EAEAEA; margin-bottom: 10px;">
|
2
|
+
<span class='title'>
|
3
|
+
<%= link_to refinery.edit_image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide), :tooltip => image_slide.title, :style => 'display: inline-block;' do %>
|
4
|
+
<%= image_fu image_slide.image, '255x255', :style => 'padding: 15px 0 0 10px;' %>
|
5
|
+
<% end %>
|
6
|
+
</span>
|
7
|
+
<span class='actions'>
|
8
|
+
<%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide),
|
9
|
+
:title => t('.edit') %>
|
10
|
+
<%= link_to refinery_icon_tag("delete.png"), refinery.image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide),
|
11
|
+
:class => "cancel confirm-delete",
|
12
|
+
:title => t('.delete'),
|
13
|
+
:confirm => t('message', :scope => 'refinery.admin.delete', :title => image_slide.title),
|
14
|
+
:method => :delete %>
|
15
|
+
</span>
|
16
|
+
</li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'sortable_list' %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if searching? %>
|
2
|
+
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
|
3
|
+
<% end %>
|
4
|
+
<div class='pagination_container'>
|
5
|
+
<% if @image_slides.any? %>
|
6
|
+
<%= render 'image_slides' %>
|
7
|
+
<% else %>
|
8
|
+
<p>
|
9
|
+
<% unless searching? %>
|
10
|
+
<strong>
|
11
|
+
<%= t('.no_items_yet') %>
|
12
|
+
</strong>
|
13
|
+
<% else %>
|
14
|
+
<%= t('no_results', :scope => 'refinery.admin.search') %>
|
15
|
+
<% end %>
|
16
|
+
</p>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% if @image_slideshow.present? %>
|
2
|
+
<h2><%= @image_slideshow.title %> Slideshow</h2>
|
3
|
+
<% end %>
|
4
|
+
<section id='records'>
|
5
|
+
<%= render 'records' %>
|
6
|
+
</section>
|
7
|
+
<aside id='actions'>
|
8
|
+
<%= render 'actions' %>
|
9
|
+
</aside>
|
10
|
+
<%= render '/refinery/admin/make_sortable', :tree => false if ::Refinery::ImageSlideshows::ImageSlide.count > 1 %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -1,25 +1,6 @@
|
|
1
1
|
<ul>
|
2
|
-
<% if ::Refinery::ImageSlideshows::Admin::ImageSlideshowsController.searchable? %>
|
3
|
-
<li>
|
4
|
-
<%= render '/refinery/admin/search', :url => refinery.image_slideshows_admin_image_slideshows_path %>
|
5
|
-
</li>
|
6
|
-
<% end %>
|
7
2
|
<li>
|
8
3
|
<%= link_to t('.create_new'), refinery.new_image_slideshows_admin_image_slideshow_path,
|
9
4
|
:class => "add_icon" %>
|
10
5
|
</li>
|
11
|
-
<% if !searching? && ::Refinery::ImageSlideshows::Admin::ImageSlideshowsController.sortable? && ::Refinery::ImageSlideshows::ImageSlideshow.any? %>
|
12
|
-
<li>
|
13
|
-
<%= link_to t('.reorder', :what => "Image Slideshows"),
|
14
|
-
refinery.image_slideshows_admin_image_slideshows_path,
|
15
|
-
:id => "reorder_action",
|
16
|
-
:class => "reorder_icon" %>
|
17
|
-
|
18
|
-
<%= link_to t('.reorder_done', :what => "Image Slideshows"),
|
19
|
-
refinery.image_slideshows_admin_image_slideshows_path,
|
20
|
-
:id => "reorder_action_done",
|
21
|
-
:style => "display: none;",
|
22
|
-
:class => "reorder_icon" %>
|
23
|
-
</li>
|
24
|
-
<% end %>
|
25
6
|
</ul>
|
@@ -1,16 +1,14 @@
|
|
1
1
|
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(image_slideshow) -%>">
|
2
2
|
<span class='title'>
|
3
|
-
<%= image_slideshow
|
4
|
-
|
3
|
+
<%= link_to refinery.image_slideshows_admin_image_slideshow_image_slides_path(image_slideshow) do %>
|
4
|
+
<%= image_slideshow.title %> Slideshow
|
5
|
+
<% end %>
|
5
6
|
</span>
|
6
7
|
<span class='actions'>
|
7
|
-
|
8
|
-
|
9
|
-
:title => t('.view_live_html'),
|
10
|
-
:target => "_blank" %>
|
11
|
-
|
8
|
+
<%= link_to refinery_icon_tag("img.png"), refinery.image_slideshows_admin_image_slideshow_image_slides_path(image_slideshow),
|
9
|
+
:title => 'Manage image slides' %>
|
12
10
|
<%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_image_slideshows_admin_image_slideshow_path(image_slideshow),
|
13
|
-
:title =>
|
11
|
+
:title => 'Edit this image slideshow' %>
|
14
12
|
<%= link_to refinery_icon_tag("delete.png"), refinery.image_slideshows_admin_image_slideshow_path(image_slideshow),
|
15
13
|
:class => "cancel confirm-delete",
|
16
14
|
:title => t('.delete'),
|
data/config/locales/en.yml
CHANGED
@@ -1,8 +1,29 @@
|
|
1
1
|
en:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: Add New Image Slide
|
13
|
+
reorder: Reorder Image Slides
|
14
|
+
reorder_done: Done Reordering Image Slides
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: Sorry! There are no results found.
|
18
|
+
no_items_yet: There are no Image Slides yet. Click "Add New Image Slide"
|
19
|
+
to add your first image slide.
|
20
|
+
image_slide:
|
21
|
+
view_live_html: View this image slide live <br/><em>(opens in a new window)</em>
|
22
|
+
edit: Edit this image slide
|
23
|
+
delete: Remove this image slide forever
|
24
|
+
image_slides:
|
25
|
+
show:
|
26
|
+
other: Other Image Slides
|
6
27
|
image_slideshows:
|
7
28
|
admin:
|
8
29
|
image_slideshows:
|
@@ -13,9 +34,11 @@ en:
|
|
13
34
|
records:
|
14
35
|
title: Image Slideshows
|
15
36
|
sorry_no_results: Sorry! There are no results found.
|
16
|
-
no_items_yet: There are no Image Slideshows yet. Click "Add New Image
|
37
|
+
no_items_yet: There are no Image Slideshows yet. Click "Add New Image
|
38
|
+
Slideshow" to add your first image slideshow.
|
17
39
|
image_slideshow:
|
18
|
-
view_live_html: View this image slideshow live <br/><em>(opens in a new
|
40
|
+
view_live_html: View this image slideshow live <br/><em>(opens in a new
|
41
|
+
window)</em>
|
19
42
|
edit: Edit this image slideshow
|
20
43
|
delete: Remove this image slideshow forever
|
21
44
|
image_slideshows:
|
@@ -23,5 +46,7 @@ en:
|
|
23
46
|
other: Other Image Slideshows
|
24
47
|
activerecord:
|
25
48
|
attributes:
|
26
|
-
|
27
|
-
title: Title
|
49
|
+
refinery/image_slides/image_slide:
|
50
|
+
title: Title
|
51
|
+
refinery/image_slideshows/image_slideshow:
|
52
|
+
title: Title
|
data/config/locales/es.yml
CHANGED
@@ -1,9 +1,30 @@
|
|
1
1
|
es:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
6
|
-
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: Crear nuevo image slide
|
13
|
+
reorder: Reordenar image slides
|
14
|
+
reorder_done: Reordenación de image slides completada
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: Lo siento, no hay resultados
|
18
|
+
no_items_yet: No hay image slides todavía. Pulsa en "Crear nuevo Image
|
19
|
+
Slide" para crear tu primer image slide.
|
20
|
+
image_slide:
|
21
|
+
view_live_html: Ver este image slide como abierto al público <br/><em>(abre
|
22
|
+
en ventana nueva)</em>
|
23
|
+
edit: Editar este image slide
|
24
|
+
delete: Borrar este image slide para siempre
|
25
|
+
image_slides:
|
26
|
+
show:
|
27
|
+
other: Otros image slides
|
7
28
|
image_slideshows:
|
8
29
|
admin:
|
9
30
|
image_slideshows:
|
@@ -14,9 +35,11 @@ es:
|
|
14
35
|
records:
|
15
36
|
title: Image Slideshows
|
16
37
|
sorry_no_results: Lo siento, no hay resultados
|
17
|
-
no_items_yet: No hay image slideshows todavía. Pulsa en "Crear nuevo Image
|
38
|
+
no_items_yet: No hay image slideshows todavía. Pulsa en "Crear nuevo Image
|
39
|
+
Slideshow" para crear tu primer image slideshow.
|
18
40
|
image_slideshow:
|
19
|
-
view_live_html: Ver este image slideshow como abierto al público <br/><em>(abre
|
41
|
+
view_live_html: Ver este image slideshow como abierto al público <br/><em>(abre
|
42
|
+
en ventana nueva)</em>
|
20
43
|
edit: Editar este image slideshow
|
21
44
|
delete: Borrar este image slideshow para siempre
|
22
45
|
image_slideshows:
|
@@ -24,5 +47,7 @@ es:
|
|
24
47
|
other: Otros image slideshows
|
25
48
|
activerecord:
|
26
49
|
attributes:
|
27
|
-
|
28
|
-
title: Title
|
50
|
+
refinery/image_slides/image_slide:
|
51
|
+
title: Title
|
52
|
+
refinery/image_slideshows/image_slideshow:
|
53
|
+
title: Title
|
data/config/locales/fr.yml
CHANGED
@@ -1,8 +1,31 @@
|
|
1
1
|
fr:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: Créer un(e) nouve(au/l/lle) Image Slide
|
13
|
+
reorder: Réordonner les Image Slides
|
14
|
+
reorder_done: Fin de réordonnancement des Image Slides
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: Désolé ! Aucun résultat.
|
18
|
+
no_items_yet: Il n'y a actuellement aucun(e) Image Slide. Cliquer sur
|
19
|
+
"Créer un(e) nouve(au/l/lle) Image Slide" pour créer votre premi(er/ère)
|
20
|
+
image slide.
|
21
|
+
image_slide:
|
22
|
+
view_live_html: Voir ce(t/tte) image slide <br/><em>(Ouvre une nouvelle
|
23
|
+
fenêtre)</em>
|
24
|
+
edit: Modifier ce(t/tte) image slide
|
25
|
+
delete: Supprimer définitivement ce(t/tte) image slide
|
26
|
+
image_slides:
|
27
|
+
show:
|
28
|
+
other: Autres Image Slides
|
6
29
|
image_slideshows:
|
7
30
|
admin:
|
8
31
|
image_slideshows:
|
@@ -12,10 +35,13 @@ fr:
|
|
12
35
|
reorder_done: Fin de réordonnancement des Image Slideshows
|
13
36
|
records:
|
14
37
|
title: Image Slideshows
|
15
|
-
sorry_no_results:
|
16
|
-
no_items_yet:
|
38
|
+
sorry_no_results: Désolé ! Aucun résultat.
|
39
|
+
no_items_yet: Il n'y a actuellement aucun(e) Image Slideshow. Cliquer
|
40
|
+
sur "Créer un(e) nouve(au/l/lle) Image Slideshow" pour créer votre premi(er/ère)
|
41
|
+
image slideshow.
|
17
42
|
image_slideshow:
|
18
|
-
view_live_html: Voir ce(t/tte) image slideshow <br/><em>(Ouvre une nouvelle
|
43
|
+
view_live_html: Voir ce(t/tte) image slideshow <br/><em>(Ouvre une nouvelle
|
44
|
+
fenêtre)</em>
|
19
45
|
edit: Modifier ce(t/tte) image slideshow
|
20
46
|
delete: Supprimer définitivement ce(t/tte) image slideshow
|
21
47
|
image_slideshows:
|
@@ -23,5 +49,7 @@ fr:
|
|
23
49
|
other: Autres Image Slideshows
|
24
50
|
activerecord:
|
25
51
|
attributes:
|
26
|
-
|
27
|
-
title: Title
|
52
|
+
refinery/image_slides/image_slide:
|
53
|
+
title: Title
|
54
|
+
refinery/image_slideshows/image_slideshow:
|
55
|
+
title: Title
|
data/config/locales/nb.yml
CHANGED
@@ -1,8 +1,30 @@
|
|
1
1
|
nb:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: Lag en ny Image Slide
|
13
|
+
reorder: Endre rekkefølgen på Image Slides
|
14
|
+
reorder_done: Ferdig å endre rekkefølgen Image Slides
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: Beklager! Vi fant ikke noen resultater.
|
18
|
+
no_items_yet: Det er ingen Image Slides enda. Klikk på "Lag en ny Image
|
19
|
+
Slide" for å legge til din første image slide.
|
20
|
+
image_slide:
|
21
|
+
view_live_html: Vis hvordan denne image slide ser ut offentlig <br/><em>(åpner
|
22
|
+
i et nytt vindu)</em>
|
23
|
+
edit: Rediger denne image slide
|
24
|
+
delete: Fjern denne image slide permanent
|
25
|
+
image_slides:
|
26
|
+
show:
|
27
|
+
other: Andre Image Slides
|
6
28
|
image_slideshows:
|
7
29
|
admin:
|
8
30
|
image_slideshows:
|
@@ -13,9 +35,11 @@ nb:
|
|
13
35
|
records:
|
14
36
|
title: Image Slideshows
|
15
37
|
sorry_no_results: Beklager! Vi fant ikke noen resultater.
|
16
|
-
no_items_yet: Det er ingen Image Slideshows enda. Klikk på "Lag en ny
|
38
|
+
no_items_yet: Det er ingen Image Slideshows enda. Klikk på "Lag en ny
|
39
|
+
Image Slideshow" for å legge til din første image slideshow.
|
17
40
|
image_slideshow:
|
18
|
-
view_live_html: Vis hvordan denne image slideshow ser ut offentlig <br/><em>(åpner
|
41
|
+
view_live_html: Vis hvordan denne image slideshow ser ut offentlig <br/><em>(åpner
|
42
|
+
i et nytt vindu)</em>
|
19
43
|
edit: Rediger denne image slideshow
|
20
44
|
delete: Fjern denne image slideshow permanent
|
21
45
|
image_slideshows:
|
@@ -23,5 +47,7 @@ nb:
|
|
23
47
|
other: Andre Image Slideshows
|
24
48
|
activerecord:
|
25
49
|
attributes:
|
26
|
-
|
27
|
-
title: Title
|
50
|
+
refinery/image_slides/image_slide:
|
51
|
+
title: Title
|
52
|
+
refinery/image_slideshows/image_slideshow:
|
53
|
+
title: Title
|
data/config/locales/nl.yml
CHANGED
@@ -1,8 +1,30 @@
|
|
1
1
|
nl:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: Maak een nieuwe Image Slide
|
13
|
+
reorder: Wijzig de volgorde van de Image Slides
|
14
|
+
reorder_done: Klaar met het wijzingen van de volgorde van de Image Slides
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
|
18
|
+
no_items_yet: Er zijn nog geen Image Slides. Druk op 'Maak een nieuwe
|
19
|
+
Image Slide' om de eerste aan te maken.
|
20
|
+
image_slide:
|
21
|
+
view_live_html: Bekijk deze image slide op de website <br/><em>(opent
|
22
|
+
een nieuw venster)</em>
|
23
|
+
edit: Bewerk deze image slide
|
24
|
+
delete: Verwijder deze image slide voor eeuwig
|
25
|
+
image_slides:
|
26
|
+
show:
|
27
|
+
other: Andere Image Slides
|
6
28
|
image_slideshows:
|
7
29
|
admin:
|
8
30
|
image_slideshows:
|
@@ -13,9 +35,11 @@ nl:
|
|
13
35
|
records:
|
14
36
|
title: Image Slideshows
|
15
37
|
sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
|
16
|
-
no_items_yet: Er zijn nog geen Image Slideshows. Druk op 'Maak een nieuwe
|
38
|
+
no_items_yet: Er zijn nog geen Image Slideshows. Druk op 'Maak een nieuwe
|
39
|
+
Image Slideshow' om de eerste aan te maken.
|
17
40
|
image_slideshow:
|
18
|
-
view_live_html: Bekijk deze image slideshow op de website <br/><em>(opent
|
41
|
+
view_live_html: Bekijk deze image slideshow op de website <br/><em>(opent
|
42
|
+
een nieuw venster)</em>
|
19
43
|
edit: Bewerk deze image slideshow
|
20
44
|
delete: Verwijder deze image slideshow voor eeuwig
|
21
45
|
image_slideshows:
|
@@ -23,5 +47,7 @@ nl:
|
|
23
47
|
other: Andere Image Slideshows
|
24
48
|
activerecord:
|
25
49
|
attributes:
|
26
|
-
|
27
|
-
title: Title
|
50
|
+
refinery/image_slides/image_slide:
|
51
|
+
title: Title
|
52
|
+
refinery/image_slideshows/image_slideshow:
|
53
|
+
title: Title
|
data/config/locales/sk.yml
CHANGED
@@ -1,8 +1,30 @@
|
|
1
1
|
sk:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: Pridať Image Slide
|
13
|
+
reorder: Preusporiadať Image Slides
|
14
|
+
reorder_done: Koniec radenia Image Slides
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: Ľutujeme, ale neboli nájdené žiadne výsledky.
|
18
|
+
no_items_yet: Nie sú vytvorené žiadne Image Slides. Kliknite na "Pridať
|
19
|
+
Image Slide" pre pridanie prvého image slide.
|
20
|
+
image_slide:
|
21
|
+
view_live_html: Zobraziť náhľad image slide<br/><em>(otvorí sa v novom
|
22
|
+
okne)</em>
|
23
|
+
edit: Upraviť image slide
|
24
|
+
delete: Zmazať image slide
|
25
|
+
image_slides:
|
26
|
+
show:
|
27
|
+
other: Daľšie Image Slides
|
6
28
|
image_slideshows:
|
7
29
|
admin:
|
8
30
|
image_slideshows:
|
@@ -13,9 +35,11 @@ sk:
|
|
13
35
|
records:
|
14
36
|
title: Image Slideshows
|
15
37
|
sorry_no_results: Ľutujeme, ale neboli nájdené žiadne výsledky.
|
16
|
-
no_items_yet: Nie sú vytvorené žiadne Image Slideshows. Kliknite na "Pridať
|
38
|
+
no_items_yet: Nie sú vytvorené žiadne Image Slideshows. Kliknite na "Pridať
|
39
|
+
Image Slideshow" pre pridanie prvého image slideshow.
|
17
40
|
image_slideshow:
|
18
|
-
view_live_html: Zobraziť náhľad image slideshow<br/><em>(otvorí sa v novom
|
41
|
+
view_live_html: Zobraziť náhľad image slideshow<br/><em>(otvorí sa v novom
|
42
|
+
okne)</em>
|
19
43
|
edit: Upraviť image slideshow
|
20
44
|
delete: Zmazať image slideshow
|
21
45
|
image_slideshows:
|
@@ -23,5 +47,7 @@ sk:
|
|
23
47
|
other: Daľšie Image Slideshows
|
24
48
|
activerecord:
|
25
49
|
attributes:
|
26
|
-
|
27
|
-
title: Title
|
50
|
+
refinery/image_slides/image_slide:
|
51
|
+
title: Title
|
52
|
+
refinery/image_slideshows/image_slideshow:
|
53
|
+
title: Title
|
data/config/locales/zh-CN.yml
CHANGED
@@ -1,8 +1,28 @@
|
|
1
1
|
zh-CN:
|
2
2
|
refinery:
|
3
3
|
plugins:
|
4
|
+
image_slides:
|
5
|
+
title: Image Slides
|
4
6
|
image_slideshows:
|
5
7
|
title: Image Slideshows
|
8
|
+
image_slides:
|
9
|
+
admin:
|
10
|
+
image_slides:
|
11
|
+
actions:
|
12
|
+
create_new: 建立新的 Image Slide
|
13
|
+
reorder: 对 Image Slides 重新排序
|
14
|
+
reorder_done: 对 Image Slides 的重新排序结束
|
15
|
+
records:
|
16
|
+
title: Image Slides
|
17
|
+
sorry_no_results: 对不起,未找到结果。
|
18
|
+
no_items_yet: 目前没有 Image Slides . 点击 "Add New Image Slide" 创建一个image slide.
|
19
|
+
image_slide:
|
20
|
+
view_live_html: 查看 image slide 的最新内容.<br/><em>(新窗口中打开)</em>
|
21
|
+
edit: 编辑 image slide
|
22
|
+
delete: 永久删除 image slide
|
23
|
+
image_slides:
|
24
|
+
show:
|
25
|
+
other: 其他 Image Slides
|
6
26
|
image_slideshows:
|
7
27
|
admin:
|
8
28
|
image_slideshows:
|
@@ -12,10 +32,9 @@ zh-CN:
|
|
12
32
|
reorder_done: 对 Image Slideshows 的重新排序结束
|
13
33
|
records:
|
14
34
|
title: Image Slideshows
|
15
|
-
sorry_no_results: 对不起,未找到结果。
|
16
|
-
|
17
|
-
|
18
|
-
no_items_yet: 目前没有 Image Slideshows . 点击 "Add New Image Slideshow" 创建一个image slideshow.
|
35
|
+
sorry_no_results: 对不起,未找到结果。
|
36
|
+
no_items_yet: 目前没有 Image Slideshows . 点击 "Add New Image Slideshow" 创建一个image
|
37
|
+
slideshow.
|
19
38
|
image_slideshow:
|
20
39
|
view_live_html: 查看 image slideshow 的最新内容.<br/><em>(新窗口中打开)</em>
|
21
40
|
edit: 编辑 image slideshow
|
@@ -25,5 +44,7 @@ zh-CN:
|
|
25
44
|
other: 其他 Image Slideshows
|
26
45
|
activerecord:
|
27
46
|
attributes:
|
28
|
-
|
29
|
-
title: Title
|
47
|
+
refinery/image_slides/image_slide:
|
48
|
+
title: Title
|
49
|
+
refinery/image_slideshows/image_slideshow:
|
50
|
+
title: Title
|
data/config/routes.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
Refinery::Core::Engine.routes.append do
|
2
2
|
|
3
|
-
# Frontend routes
|
4
|
-
namespace :image_slideshows do
|
5
|
-
resources :image_slideshows, :path => '', :only => [:index, :show]
|
6
|
-
end
|
7
|
-
|
8
3
|
# Admin routes
|
9
4
|
namespace :image_slideshows, :path => '' do
|
10
5
|
namespace :admin, :path => 'refinery' do
|
11
|
-
resources :image_slideshows
|
6
|
+
resources :image_slideshows do
|
7
|
+
resources :image_slides, :except => :show do
|
8
|
+
collection do
|
9
|
+
post :update_positions
|
10
|
+
end
|
11
|
+
end
|
12
12
|
collection do
|
13
13
|
post :update_positions
|
14
14
|
end
|
@@ -15,10 +15,6 @@ class CreateImageSlideshowsImageSlideshows < ActiveRecord::Migration
|
|
15
15
|
::Refinery::UserPlugin.destroy_all({:name => "refinerycms-image_slideshows"})
|
16
16
|
end
|
17
17
|
|
18
|
-
if defined?(::Refinery::Page)
|
19
|
-
::Refinery::Page.delete_all({:link_url => "/image_slideshows/image_slideshows"})
|
20
|
-
end
|
21
|
-
|
22
18
|
drop_table :refinery_image_slideshows
|
23
19
|
|
24
20
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateImageSlidesImageSlides < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def up
|
4
|
+
create_table :refinery_image_slides do |t|
|
5
|
+
t.string :title
|
6
|
+
t.integer :position
|
7
|
+
t.integer :image_slideshow_id
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def down
|
15
|
+
if defined?(::Refinery::UserPlugin)
|
16
|
+
::Refinery::UserPlugin.destroy_all({:name => "refinerycms-image_slides"})
|
17
|
+
end
|
18
|
+
|
19
|
+
drop_table :refinery_image_slides
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/db/seeds.rb
CHANGED
@@ -10,16 +10,18 @@
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
end
|
14
|
+
|
15
|
+
(Refinery.i18n_enabled? ? Refinery::I18n.frontend_locales : [:en]).each do |lang|
|
16
|
+
I18n.locale = lang
|
17
|
+
|
18
|
+
if defined?(Refinery::User)
|
19
|
+
Refinery::User.all.each do |user|
|
20
|
+
if user.plugins.where(:name => 'refinerycms-image_slides').blank?
|
21
|
+
user.plugins.create(:name => 'refinerycms-image_slides',
|
22
|
+
:position => (user.plugins.maximum(:position) || -1) +1)
|
23
|
+
end
|
23
24
|
end
|
24
25
|
end
|
26
|
+
|
25
27
|
end
|
@@ -1 +1 @@
|
|
1
|
-
require 'refinery/image_slideshows'
|
1
|
+
require 'refinery/image_slideshows'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-image_slideshows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -49,9 +49,19 @@ executables: []
|
|
49
49
|
extensions: []
|
50
50
|
extra_rdoc_files: []
|
51
51
|
files:
|
52
|
+
- app/controllers/refinery/image_slideshows/admin/image_slides_controller.rb
|
52
53
|
- app/controllers/refinery/image_slideshows/admin/image_slideshows_controller.rb
|
53
|
-
- app/
|
54
|
+
- app/models/refinery/image_slideshows/image_slide.rb
|
54
55
|
- app/models/refinery/image_slideshows/image_slideshow.rb
|
56
|
+
- app/views/refinery/image_slideshows/admin/image_slides/_actions.html.erb
|
57
|
+
- app/views/refinery/image_slideshows/admin/image_slides/_form.html.erb
|
58
|
+
- app/views/refinery/image_slideshows/admin/image_slides/_image_slide.html.erb
|
59
|
+
- app/views/refinery/image_slideshows/admin/image_slides/_image_slides.html.erb
|
60
|
+
- app/views/refinery/image_slideshows/admin/image_slides/_records.html.erb
|
61
|
+
- app/views/refinery/image_slideshows/admin/image_slides/_sortable_list.html.erb
|
62
|
+
- app/views/refinery/image_slideshows/admin/image_slides/edit.html.erb
|
63
|
+
- app/views/refinery/image_slideshows/admin/image_slides/index.html.erb
|
64
|
+
- app/views/refinery/image_slideshows/admin/image_slides/new.html.erb
|
55
65
|
- app/views/refinery/image_slideshows/admin/image_slideshows/_actions.html.erb
|
56
66
|
- app/views/refinery/image_slideshows/admin/image_slideshows/_form.html.erb
|
57
67
|
- app/views/refinery/image_slideshows/admin/image_slideshows/_image_slideshow.html.erb
|
@@ -61,8 +71,6 @@ files:
|
|
61
71
|
- app/views/refinery/image_slideshows/admin/image_slideshows/edit.html.erb
|
62
72
|
- app/views/refinery/image_slideshows/admin/image_slideshows/index.html.erb
|
63
73
|
- app/views/refinery/image_slideshows/admin/image_slideshows/new.html.erb
|
64
|
-
- app/views/refinery/image_slideshows/image_slideshows/index.html.erb
|
65
|
-
- app/views/refinery/image_slideshows/image_slideshows/show.html.erb
|
66
74
|
- config/locales/en.yml
|
67
75
|
- config/locales/es.yml
|
68
76
|
- config/locales/fr.yml
|
@@ -72,6 +80,8 @@ files:
|
|
72
80
|
- config/locales/zh-CN.yml
|
73
81
|
- config/routes.rb
|
74
82
|
- db/migrate/1_create_image_slideshows_image_slideshows.rb
|
83
|
+
- db/migrate/2_create_image_slides_image_slides.rb
|
84
|
+
- db/migrate/3_add_image_and_caption_to_image_slides.rb
|
75
85
|
- db/seeds.rb
|
76
86
|
- lib/generators/refinery/image_slideshows_generator.rb
|
77
87
|
- lib/refinery/image_slideshows/engine.rb
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Refinery
|
2
|
-
module ImageSlideshows
|
3
|
-
class ImageSlideshowsController < ::ApplicationController
|
4
|
-
|
5
|
-
before_filter :find_all_image_slideshows
|
6
|
-
before_filter :find_page
|
7
|
-
|
8
|
-
def index
|
9
|
-
# you can use meta fields from your model instead (e.g. browser_title)
|
10
|
-
# by swapping @page for @image_slideshow in the line below:
|
11
|
-
present(@page)
|
12
|
-
end
|
13
|
-
|
14
|
-
def show
|
15
|
-
@image_slideshow = ImageSlideshow.find(params[:id])
|
16
|
-
|
17
|
-
# you can use meta fields from your model instead (e.g. browser_title)
|
18
|
-
# by swapping @page for @image_slideshow in the line below:
|
19
|
-
present(@page)
|
20
|
-
end
|
21
|
-
|
22
|
-
protected
|
23
|
-
|
24
|
-
def find_all_image_slideshows
|
25
|
-
@image_slideshows = ImageSlideshow.order('position ASC')
|
26
|
-
end
|
27
|
-
|
28
|
-
def find_page
|
29
|
-
@page = ::Refinery::Page.where(:link_url => "/image_slideshows").first
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<% content_for :body do %>
|
2
|
-
<ul id="image_slideshows">
|
3
|
-
<% @image_slideshows.each do |image_slideshow| %>
|
4
|
-
<li>
|
5
|
-
<%= link_to image_slideshow.title, refinery.image_slideshows_image_slideshow_path(image_slideshow) %>
|
6
|
-
</li>
|
7
|
-
<% end %>
|
8
|
-
</ul>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<%= render '/refinery/content_page' %>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<% content_for :body_content_title do %>
|
2
|
-
<%= @image_slideshow.title %>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% content_for :body do %>
|
6
|
-
<section>
|
7
|
-
<h1>Title</h1>
|
8
|
-
<p>
|
9
|
-
<%=raw @image_slideshow.title %>
|
10
|
-
</p>
|
11
|
-
</section>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<% content_for :side_body do %>
|
15
|
-
<aside>
|
16
|
-
<h2><%= t('.other') %></h2>
|
17
|
-
<ul id="image_slideshows">
|
18
|
-
<% @image_slideshows.each do |image_slideshow| %>
|
19
|
-
<li>
|
20
|
-
<%= link_to image_slideshow.title, refinery.image_slideshows_image_slideshow_path(image_slideshow) %>
|
21
|
-
</li>
|
22
|
-
<% end %>
|
23
|
-
</ul>
|
24
|
-
</aside>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<%= render '/refinery/content_page' %>
|