refinerycms-photo-gallery 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +6 -0
- data/README.md +3 -0
- data/app/sweepers/refinery/admin/album_page_sweeper.rb +14 -0
- data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +37 -37
- data/app/views/refinery/photo_gallery/admin/albums/_albums.html.erb +4 -0
- data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +18 -25
- data/app/views/refinery/photo_gallery/admin/collections/_collections.html.erb +4 -0
- data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +18 -25
- data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +2 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/sk.yml +1 -1
- data/db/seeds.rb +0 -12
- data/lib/refinery/photo_gallery/extensions/pages_extension.rb +5 -1
- data/lib/refinery/photo_gallery/version.rb +1 -1
- metadata +5 -5
- data/app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb +0 -7
- data/app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb +0 -7
- data/app/views/refinery/photo_gallery/admin/collections/test.html.erb +0 -39
data/Changelog.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.1.1 [20 October 2012]
|
2
|
+
* allow to edit filenames in plupload editor before uploading start
|
3
|
+
* allow to upload another photos in the same album after uploading is done, without need to do page refresh
|
4
|
+
* add dependent destroy to album_page
|
5
|
+
* fix ajax pagination in backend
|
6
|
+
|
1
7
|
## 0.1.0 [24 September 2012]
|
2
8
|
* drop collection thumbnail version
|
3
9
|
* support for old fancybox v1.3
|
data/README.md
CHANGED
@@ -99,6 +99,9 @@ Seed your database:
|
|
99
99
|
```ruby
|
100
100
|
rake db:seed
|
101
101
|
```
|
102
|
+
Append
|
103
|
+
``<%= render "/refinery/photo_gallery/albums/show" %>``
|
104
|
+
to pages/show.html.erb to display photos
|
102
105
|
|
103
106
|
You can configure gem in ``your_app_name/config/initializers/refinery/photo_gallery.rb``
|
104
107
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This is not traditional sweeper, this is only class called in pages_extension.rb , because I was unable to
|
2
|
+
# append this sweeper in Admin::PagesController.
|
3
|
+
|
4
|
+
module Refinery
|
5
|
+
module Admin
|
6
|
+
class AlbumPageSweeper
|
7
|
+
|
8
|
+
def self.sweep
|
9
|
+
ActionController::Base.new.expire_fragment( 'refinery/recent_album_page')
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -7,45 +7,45 @@
|
|
7
7
|
:url => refinery.photo_gallery_admin_collections_path
|
8
8
|
} %>
|
9
9
|
<% elsif params[:controller] == "refinery/photo_gallery/admin/albums" %>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
<%= render :partial => "/refinery/admin/search",
|
11
|
+
:locals => {
|
12
|
+
:url => refinery.photo_gallery_admin_albums_path
|
13
|
+
} %>
|
14
|
+
<% end %>
|
15
|
+
</li>
|
16
|
+
</ul>
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
<ul class='collapsible_menu'>
|
19
|
+
<li class='not_a_link'>
|
20
|
+
<%= link_to t('.albums.title'), '#',
|
21
|
+
:class => 'album_icon' %>
|
22
|
+
</li>
|
23
|
+
<li>
|
24
|
+
<%= link_to t('.albums.manage'), refinery.photo_gallery_admin_albums_path,
|
25
|
+
:class => 'album_edit_icon' %>
|
26
|
+
</li>
|
27
|
+
<li>
|
28
|
+
<%= link_to t('.albums.new'), refinery.new_photo_gallery_admin_album_path,
|
29
|
+
:class => 'album_add_icon' %>
|
30
|
+
</li>
|
31
|
+
</ul>
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
33
|
+
<ul class='collapsible_menu'>
|
34
|
+
<li class='not_a_link'>
|
35
|
+
<%= link_to t('.collections.title'), '#',
|
36
|
+
:class => 'folder_icon' %>
|
37
|
+
</li>
|
38
|
+
<li>
|
39
|
+
<%= link_to t('.collections.manage'), refinery.photo_gallery_admin_collections_path,
|
40
|
+
:class => 'folder_edit_icon' %>
|
41
|
+
</li>
|
42
|
+
<li>
|
43
|
+
<%= link_to t('.collections.new'), refinery.new_photo_gallery_admin_collection_path,
|
44
|
+
:class => 'folder_add_icon' %>
|
45
|
+
</li>
|
46
|
+
</ul>
|
47
47
|
|
48
48
|
|
49
|
-
|
49
|
+
</nav>
|
50
50
|
|
51
|
-
|
51
|
+
<% content_for :stylesheets, stylesheet_link_tag('refinery/photo_gallery/admin/backend') %>
|
@@ -1,28 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<div id='records'>
|
1
|
+
<section id='records'>
|
4
2
|
<% if searching? %>
|
5
3
|
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
|
6
|
-
<% if @albums.any? %>
|
7
|
-
<ul>
|
8
|
-
<%= render :partial => "album", :collection => @albums %>
|
9
|
-
</ul>
|
10
|
-
<% else %>
|
11
|
-
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
|
12
|
-
<% end %>
|
13
|
-
<% else %>
|
14
|
-
<% if @albums.any? %>
|
15
|
-
<%= will_paginate @albums %>
|
16
|
-
|
17
|
-
<%= render :partial => "sortable_list" %>
|
18
|
-
|
19
|
-
<%= will_paginate @albums %>
|
20
|
-
<% else %>
|
21
|
-
<p>
|
22
|
-
<strong>
|
23
|
-
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.albums')) %>
|
24
|
-
</strong>
|
25
|
-
</p>
|
26
|
-
<% end %>
|
27
4
|
<% end %>
|
28
|
-
|
5
|
+
<div class='pagination_container'>
|
6
|
+
<% if @albums.any? %>
|
7
|
+
<%= render "albums" %>
|
8
|
+
<% else %>
|
9
|
+
<p>
|
10
|
+
<% unless searching? %>
|
11
|
+
<strong>
|
12
|
+
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.albums')) %>
|
13
|
+
</strong>
|
14
|
+
<% else %>
|
15
|
+
<%= t('no_results', :scope => 'refinery.admin.search') %>
|
16
|
+
<% end %>
|
17
|
+
</p>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</section>
|
21
|
+
<%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
|
@@ -1,28 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<div id='records'>
|
1
|
+
<section id='records'>
|
4
2
|
<% if searching? %>
|
5
3
|
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
|
6
|
-
<% if @collections.any? %>
|
7
|
-
<ul>
|
8
|
-
<%= render :partial => "collection", :collection => @collections %>
|
9
|
-
</ul>
|
10
|
-
<% else %>
|
11
|
-
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
|
12
|
-
<% end %>
|
13
|
-
<% else %>
|
14
|
-
<% if @collections.any? %>
|
15
|
-
<%= will_paginate @collections %>
|
16
|
-
|
17
|
-
<%= render :partial => "sortable_list" %>
|
18
|
-
|
19
|
-
<%= will_paginate @collections %>
|
20
|
-
<% else %>
|
21
|
-
<p>
|
22
|
-
<strong>
|
23
|
-
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.collections')) %>
|
24
|
-
</strong>
|
25
|
-
</p>
|
26
|
-
<% end %>
|
27
4
|
<% end %>
|
28
|
-
|
5
|
+
<div class='pagination_container'>
|
6
|
+
<% if @collections.any? %>
|
7
|
+
<%= render "collections" %>
|
8
|
+
<% else %>
|
9
|
+
<p>
|
10
|
+
<% unless searching? %>
|
11
|
+
<strong>
|
12
|
+
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.collections')) %>
|
13
|
+
</strong>
|
14
|
+
<% else %>
|
15
|
+
<%= t('no_results', :scope => 'refinery.admin.search') %>
|
16
|
+
<% end %>
|
17
|
+
</p>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</section>
|
21
|
+
<%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
|
data/config/locales/en.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/db/seeds.rb
CHANGED
@@ -7,15 +7,3 @@ if defined?(::Refinery::User)
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/photo-gallery')
|
11
|
-
page = Refinery::Page.create(
|
12
|
-
:title => "Photo galleries",
|
13
|
-
:link_url => "/photo-gallery",
|
14
|
-
:deletable => false,
|
15
|
-
:menu_match => "^/photo-gallery?(\/|\/.+?|)$"
|
16
|
-
)
|
17
|
-
|
18
|
-
Refinery::Pages.default_parts.each do |default_page_part|
|
19
|
-
page.parts.create(:title => default_page_part, :body => nil)
|
20
|
-
end
|
21
|
-
end
|
@@ -3,7 +3,7 @@ module Refinery
|
|
3
3
|
module Extensions
|
4
4
|
module Pages
|
5
5
|
def has_one_page_album
|
6
|
-
has_one :album_page, :as => :page
|
6
|
+
has_one :album_page, :as => :page, :dependent=> :destroy
|
7
7
|
has_one :album, :through => :album_page
|
8
8
|
has_many :photos, :class_name => Refinery::PhotoGallery::Photo, :through => :album , :order=> "created_at ASC"
|
9
9
|
|
@@ -29,10 +29,14 @@ module Refinery
|
|
29
29
|
if album_page_params[:album_id].blank?
|
30
30
|
self.album_page.destroy
|
31
31
|
|
32
|
+
Refinery::Admin::AlbumPageSweeper.sweep
|
33
|
+
|
32
34
|
# create or update if changed
|
33
35
|
elsif self.album_page.album_id.to_s != album_page_params[:album_id]
|
34
36
|
self.album_page.update_attributes( album_page_params)
|
35
37
|
self.album_page.save
|
38
|
+
|
39
|
+
Refinery::Admin::AlbumPageSweeper.sweep
|
36
40
|
end
|
37
41
|
|
38
42
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-photo-gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: refinerycms-core
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- app/models/refinery/photo_gallery/collection.rb
|
236
236
|
- app/models/refinery/photo_gallery/collection_album.rb
|
237
237
|
- app/models/refinery/photo_gallery/photo.rb
|
238
|
+
- app/sweepers/refinery/admin/album_page_sweeper.rb
|
238
239
|
- app/sweepers/refinery/photo_gallery/admin/album_sweeper.rb
|
239
240
|
- app/sweepers/refinery/photo_gallery/admin/photo_sweeper.rb
|
240
241
|
- app/uploaders/refinery/photo_gallery/admin/file_uploader.rb
|
@@ -243,18 +244,17 @@ files:
|
|
243
244
|
- app/views/refinery/admin/pages/tabs/_photo_pages_bar.html.erb
|
244
245
|
- app/views/refinery/photo_gallery/admin/_submenu.html.erb
|
245
246
|
- app/views/refinery/photo_gallery/admin/albums/_album.html.erb
|
247
|
+
- app/views/refinery/photo_gallery/admin/albums/_albums.html.erb
|
246
248
|
- app/views/refinery/photo_gallery/admin/albums/_form.html.erb
|
247
|
-
- app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb
|
248
249
|
- app/views/refinery/photo_gallery/admin/albums/edit.html.erb
|
249
250
|
- app/views/refinery/photo_gallery/admin/albums/index.html.erb
|
250
251
|
- app/views/refinery/photo_gallery/admin/albums/new.html.erb
|
251
252
|
- app/views/refinery/photo_gallery/admin/collections/_collection.html.erb
|
253
|
+
- app/views/refinery/photo_gallery/admin/collections/_collections.html.erb
|
252
254
|
- app/views/refinery/photo_gallery/admin/collections/_form.html.erb
|
253
|
-
- app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb
|
254
255
|
- app/views/refinery/photo_gallery/admin/collections/edit.html.erb
|
255
256
|
- app/views/refinery/photo_gallery/admin/collections/index.html.erb
|
256
257
|
- app/views/refinery/photo_gallery/admin/collections/new.html.erb
|
257
|
-
- app/views/refinery/photo_gallery/admin/collections/test.html.erb
|
258
258
|
- app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb
|
259
259
|
- app/views/refinery/photo_gallery/admin/photos/_form.html.erb
|
260
260
|
- app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<ul id='sortable_list'>
|
2
|
-
<%= render :partial => 'collection', :collection => @collections %>
|
3
|
-
</ul>
|
4
|
-
<%= render :partial => "/refinery/admin/sortable_list",
|
5
|
-
:locals => {
|
6
|
-
:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
|
7
|
-
} %>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<%= form.label :title, :Title, {:class => 'big'} %><br />
|
2
|
-
<%= form.text_field :title, {:class => 'big'} %><br />
|
3
|
-
|
4
|
-
<%= form.label :description %><br />
|
5
|
-
<%= form.text_area :description %><br />
|
6
|
-
|
7
|
-
|
8
|
-
<% unless @collection.albums.empty? %>
|
9
|
-
<%= form.label :albums %><br />
|
10
|
-
<div id="collection_albums">
|
11
|
-
<% for album in @collection.albums %>
|
12
|
-
<%= form.fields_for :album_list do |album_fields| %>
|
13
|
-
<span>
|
14
|
-
<%= image_tag "delete-24x24.png", :class => "delete", :alt => "Delete" -%>
|
15
|
-
|
16
|
-
<% if album.photos.empty? %>
|
17
|
-
<%= album.title %>
|
18
|
-
<% else %>
|
19
|
-
<%= image_tag album.photos.first.file.album.url, :alt => album.title %>
|
20
|
-
<% end %>
|
21
|
-
<%= album_fields.hidden_field album.id %>
|
22
|
-
</span>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
</div>
|
26
|
-
|
27
|
-
<p class="clear">
|
28
|
-
<%
|
29
|
-
grouped_options = [
|
30
|
-
['Available albums',[['Choose album to add','']]],
|
31
|
-
['Not used', Album.unused.map{|album|[album.title, album.id]} ],
|
32
|
-
['In use', Album.used.map{|album|[album.title, album.id]} ]
|
33
|
-
]
|
34
|
-
grouped_options_for_select(grouped_options)
|
35
|
-
%>
|
36
|
-
<%= select_tag 'available_albums', grouped_options_for_select(grouped_options) %>
|
37
|
-
</p>
|
38
|
-
|
39
|
-
<% end %>
|