refinerycms-photo-gallery 0.0.2.dev → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/Changelog.md +18 -0
  2. data/README.md +40 -22
  3. data/Rakefile +20 -0
  4. data/app/assets/javascripts/refinery/photo_gallery/admin/{photo_gallery.js → photo_gallery.js.erb} +26 -1
  5. data/app/assets/javascripts/refinery/photo_gallery/photo_gallery.js +28 -0
  6. data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +2 -1
  7. data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +2 -0
  8. data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +4 -2
  9. data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +1 -50
  10. data/app/models/refinery/album_page.rb +11 -0
  11. data/app/models/refinery/photo_gallery/album.rb +7 -14
  12. data/app/models/refinery/photo_gallery/collection.rb +3 -2
  13. data/app/models/refinery/photo_gallery/photo.rb +7 -5
  14. data/app/sweepers/refinery/photo_gallery/admin/album_sweeper.rb +33 -0
  15. data/app/sweepers/refinery/photo_gallery/admin/photo_sweeper.rb +27 -0
  16. data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +20 -29
  17. data/app/views/refinery/admin/pages/tabs/_form.html.erb +13 -0
  18. data/app/views/refinery/admin/pages/tabs/_photo_gallery.html.erb +12 -0
  19. data/app/views/refinery/admin/pages/tabs/_photo_pages_bar.html.erb +4 -0
  20. data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +43 -36
  21. data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +2 -2
  22. data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +1 -1
  23. data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +2 -13
  24. data/app/views/refinery/photo_gallery/albums/_photos.html.erb +20 -0
  25. data/app/views/refinery/photo_gallery/albums/_photos.js.erb +5 -0
  26. data/app/views/refinery/photo_gallery/albums/_show.html.erb +18 -0
  27. data/config/locales/en.yml +45 -27
  28. data/config/locales/sk.yml +47 -27
  29. data/config/routes.rb +1 -11
  30. data/db/migrate/20120805222126_create_album_pages.rb +19 -0
  31. data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +3 -7
  32. data/lib/refinery/photo_gallery.rb +5 -3
  33. data/lib/refinery/photo_gallery/configuration.rb +7 -9
  34. data/lib/refinery/photo_gallery/engine.rb +17 -2
  35. data/lib/refinery/photo_gallery/extensions/pages_controller_extension.rb +30 -0
  36. data/lib/refinery/photo_gallery/extensions/pages_extension.rb +50 -0
  37. data/lib/refinery/photo_gallery/version.rb +2 -2
  38. data/{refinerycms-balder-photo-gallery.gemspec → refinerycms-photo-gallery.gemspec} +0 -0
  39. data/screenshots/13_pages.png +0 -0
  40. metadata +23 -16
  41. data/app/controllers/refinery/photo_gallery/albums_controller.rb +0 -22
  42. data/app/controllers/refinery/photo_gallery/collections_controller.rb +0 -28
  43. data/app/middleware/refinery/photo_gallery/admin/flash_session_cookie_middleware.rb +0 -27
  44. data/app/views/refinery/photo_gallery/albums/show.html.erb +0 -34
  45. data/app/views/refinery/photo_gallery/collections/index.html.erb +0 -9
  46. data/app/views/refinery/photo_gallery/collections/show.html.erb +0 -19
  47. data/app/views/refinery/photo_gallery/shared/_layout.html.erb +0 -22
  48. data/app/views/refinery/photo_gallery/shared/_submenu.html.erb +0 -4
  49. data/config/initializers/session_store.rb +0 -10
@@ -1,22 +0,0 @@
1
- module Refinery
2
- module PhotoGallery
3
- class AlbumsController < ::ApplicationController
4
- include PhotoGalleryHelper, AlbumsHelper
5
- helper :'refinery/photo_gallery/photo_gallery'
6
-
7
-
8
- def show
9
- @collections = Collection.has_albums
10
-
11
- @albums = Album.find_by_collection_id(params[:collection_id])
12
- @album = Album.find(params[:id])
13
-
14
- @photos = Photo.where("album_id = ? ", params[:id]).paginate(:page => params[:page])
15
-
16
- respond_to do |format|
17
- format.html
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,28 +0,0 @@
1
- module Refinery
2
- module PhotoGallery
3
- class CollectionsController < ::ApplicationController
4
- include PhotoGalleryHelper
5
- helper :'refinery/photo_gallery/photo_gallery'
6
-
7
- def index
8
- @collections = Collection.has_albums
9
-
10
- respond_to do |format|
11
- format.html
12
- end
13
- end
14
-
15
- def show
16
- @collections = Collection.has_albums
17
-
18
- @albums = Album.find_by_collection_id(params[:id])
19
-
20
- respond_to do |format|
21
- format.html
22
- end
23
- end
24
-
25
-
26
- end
27
- end
28
- end
@@ -1,27 +0,0 @@
1
- =begin
2
- #TODO fix Flash runtime
3
- require 'rack/utils'
4
-
5
- module Refinery
6
- module PhotoGallery
7
- module Admin
8
- class FlashSessionCookieMiddleware
9
- def initialize(app, session_key = '_session_id')
10
- @app = app
11
- @session_key = session_key
12
- end
13
-
14
- def call(env)
15
- if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/
16
- req = Rack::Request.new(env)
17
- env['HTTP_COOKIE'] = [ @session_key,
18
- req.params[@session_key] ].join('=').freeze unless req.params[@session_key].nil?
19
- env['HTTP_ACCEPT'] = "#{req.params['_http_accept']}".freeze unless req.params['_http_accept'].nil?
20
- end
21
- @app.call(env)
22
- end
23
- end
24
- end
25
- end
26
- end
27
- =end
@@ -1,34 +0,0 @@
1
- <% content_for :body_content_right do %>
2
- <%= message_photos_length_is_zero %>
3
-
4
- <h1 class="single-thumbnail-title post-title-color gdl-title">
5
- <%= @album.title %>
6
- </h1>
7
-
8
- <div>
9
- <%= raw @album.description %>
10
- </div>
11
-
12
- <% @photos.each_with_index do |photo, index| %>
13
- <div class="column portfolio-item">
14
- <div class="portfolio-thumbnail-image">
15
-
16
- <%= link_to (image_tag photo.file.album.url), photo.file.single.url, {
17
- :target=> "_blank",
18
- :class=>"fancybox",
19
- :data =>{:title=> photo_description(photo,@photos, index)},
20
- :rel=>"group",
21
- :title=> photo.title } %>
22
- </div>
23
- </div>
24
- <% end %>
25
-
26
- <div style="clear:both;"></div>
27
- <%= will_paginate @photos %>
28
- <% end %>
29
-
30
- <% content_for :body_content_left do %>
31
- <%= render :partial=> "refinery/photo_gallery/shared/submenu" %>
32
- <% end %>
33
-
34
- <%= render :partial=> "refinery/photo_gallery/shared/layout" %>
@@ -1,9 +0,0 @@
1
- <% content_for :body_content_right do %>
2
- <%= message_collections_length_is_zero %>
3
- <% end %>
4
-
5
- <% content_for :body_content_left do %>
6
- <%= render :partial=> "refinery/photo_gallery/shared/submenu" %>
7
- <% end %>
8
-
9
- <%= render :partial=> "refinery/photo_gallery/shared/layout" %>
@@ -1,19 +0,0 @@
1
- <% content_for :body_content_right do %>
2
- <%= message_albums_length_is_zero %>
3
-
4
- <ul style="list-style-type: disc;">
5
- <% @albums.each do |album| %>
6
- <li><%= link_to album.title, refinery.photo_gallery_collection_album_path(:collection_id=> params[:id], :id => album.id) %></li>
7
- <%#TODO image thumbnail + description? %>
8
- <%#= link_to (image_tag photo.file.album.url), photo.file.single.url %>
9
-
10
- <% end %>
11
- </ul>
12
-
13
- <% end %>
14
-
15
- <% content_for :body_content_left do %>
16
- <%= render :partial=> "refinery/photo_gallery/shared/submenu" %>
17
- <% end %>
18
-
19
- <%= render :partial=> "refinery/photo_gallery/shared/layout" %>
@@ -1,22 +0,0 @@
1
- <div class="content-wrapper sidebar-included left-sidebar">
2
- <div class="clear"></div>
3
- <div class="gdl-page-float-left">
4
- <div class="gdl-page-item">
5
- <div class="sixteen columns mt0">
6
- <%= yield(:body_content_right) %>
7
- </div>
8
- </div>
9
-
10
- <div class="five columns mt0 gdl-left-sidebar">
11
- <div class="left-sidebar-wrapper gdl-divider">
12
- <%= yield(:body_content_left) %>
13
- </div>
14
- </div>
15
-
16
- </div>
17
- <div class="clear"></div>
18
- </div>
19
-
20
-
21
-
22
-
@@ -1,4 +0,0 @@
1
- <div class="custom-sidebar gdl-divider">
2
- <%= generate_photo_gallery_menu(@collections, @albums, {:ul=>{:class => "classtest", :id=>"idtest" }}) %>
3
- </div>
4
- <div class="pt30"></div>
@@ -1,10 +0,0 @@
1
- #Rails.application.config.session_store :cookie_store, :key => '_balder_session'
2
-
3
- =begin
4
- #TODO fix flash runtime
5
- Rails.application.config.middleware.insert_before(
6
- Rails.application.config.session_store,
7
- Refinery::PhotoGallery::Admin::FlashSessionCookieMiddleware,
8
- Rails.application.config.session_options[:key]
9
- )
10
- =end