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 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
- <%= render :partial => "/refinery/admin/search",
11
- :locals => {
12
- :url => refinery.photo_gallery_admin_albums_path
13
- } %>
14
- <% end %>
15
- </li>
16
- </ul>
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
- <ul class='collapsible_menu'>
19
- <li class='not_a_link'>
20
- <%= link_to t('.collections.title'), '#',
21
- :class => 'folder_icon' %>
22
- </li>
23
- <li>
24
- <%= link_to t('.collections.manage'), refinery.photo_gallery_admin_collections_path,
25
- :class => 'folder_edit_icon' %>
26
- </li>
27
- <li>
28
- <%= link_to t('.collections.new'), refinery.new_photo_gallery_admin_collection_path,
29
- :class => 'folder_add_icon' %>
30
- </li>
31
- </ul>
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
- <ul class='collapsible_menu'>
34
- <li class='not_a_link'>
35
- <%= link_to t('.albums.title'), '#',
36
- :class => 'album_icon' %>
37
- </li>
38
- <li>
39
- <%= link_to t('.albums.manage'), refinery.photo_gallery_admin_albums_path,
40
- :class => 'album_edit_icon' %>
41
- </li>
42
- <li>
43
- <%= link_to t('.albums.new'), refinery.new_photo_gallery_admin_album_path,
44
- :class => 'album_add_icon' %>
45
- </li>
46
- </ul>
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
- </nav>
49
+ </nav>
50
50
 
51
- <% content_for :stylesheets, stylesheet_link_tag('refinery/photo_gallery/admin/backend') %>
51
+ <% content_for :stylesheets, stylesheet_link_tag('refinery/photo_gallery/admin/backend') %>
@@ -0,0 +1,4 @@
1
+ <%= will_paginate @albums %>
2
+ <ul>
3
+ <%= render :partial => 'album', :collection => @albums %>
4
+ </ul>
@@ -1,28 +1,21 @@
1
- <%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
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
- </div>
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' %>
@@ -0,0 +1,4 @@
1
+ <%= will_paginate @collections %>
2
+ <ul>
3
+ <%= render :partial => 'collection', :collection => @collections %>
4
+ </ul>
@@ -1,28 +1,21 @@
1
- <%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
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
- </div>
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' %>
@@ -20,7 +20,8 @@
20
20
  'authenticity_token' : '<%= form_authenticity_token %>',
21
21
  'photo[album_id]' : "<%= @album.id %>"
22
22
  },
23
-
23
+ multiple_queues: true,
24
+ rename: true,
24
25
 
25
26
  // Resize images on clientside if we can
26
27
  <% if Refinery::PhotoGallery.client_side_resize %>
@@ -99,7 +99,7 @@ en:
99
99
  longitude: Longitude
100
100
  latitude: Latitude
101
101
  path: Path
102
- adress: Adress
102
+ address: Adress
103
103
  note: Note
104
104
  tags: Tags
105
105
  refinery/photo_gallery/photo:
@@ -100,7 +100,7 @@ sk:
100
100
  longitude: Zemepisná dĺžka
101
101
  latitude: Zemepisná šírka
102
102
  path: Názov priečinku
103
- adress: Adresa
103
+ address: Adresa
104
104
  note: Poznámka
105
105
  tags: Tagy
106
106
  refinery/photo_gallery/photo:
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
 
@@ -3,7 +3,7 @@ module Refinery
3
3
  class Version
4
4
  @major = 0
5
5
  @minor = 1
6
- @tiny = '0'
6
+ @tiny = '1'
7
7
 
8
8
  class << self
9
9
  attr_reader :major, :minor, :tiny
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.0
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-09-24 00:00:00.000000000 Z
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 => 'album', :collection => @albums %>
3
- </ul>
4
- <%= render :partial => "/refinery/admin/sortable_list",
5
- :locals => {
6
- :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
7
- } %>
@@ -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 %>