refinerycms-photo-gallery 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Changelog.md +11 -0
- data/Gemfile +35 -17
- data/Gemfile.lock +301 -0
- data/LICENSE.md +0 -0
- data/README.md +63 -13
- data/Rakefile +3 -2
- data/app/assets/images/refinery/photo_gallery/admin/chosen-sprite.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/cog.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/down.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/loading.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/page_copy.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/up.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/backgrounds.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons-disabled.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/delete.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/done.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/error.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/throbber.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/transp50.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload-bw.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload.png +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/blank.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_loading.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_sprite.png +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/helpers/fancybox_buttons.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/jquery.chosen.min.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js.erb +46 -46
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/Moxie.swf +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/Moxie.xap +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/changelog.txt +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ar.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/az.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/bg.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/bs.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ca.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cs.js +2 -14
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cy.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/da.js +2 -12
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/de.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/el.js +2 -14
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/en.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/es.js +2 -25
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/et.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fa.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fi.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr-ca.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr.js +2 -25
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/he.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hr.js +2 -25
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hu.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hy.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/id.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/it.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ja.js +2 -37
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ka.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/kk.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/km.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ko.js +2 -36
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ku_IQ.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lt.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lv.js +2 -33
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ms.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/nl.js +2 -21
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pl.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt-br.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt_BR.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ro.js +2 -24
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ru.js +2 -21
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sk.js +2 -37
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sl.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sq.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sr.js +2 -14
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sv.js +2 -12
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/th_TH.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/tr.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/uk_UA.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/vi.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/zh_CN.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/zh_TW.js +2 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css +185 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/backgrounds.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/buttons-disabled.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/buttons.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/delete.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/done.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/error.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/throbber.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/img/transp50.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/jquery.plupload.queue.js +428 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css +375 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/img/loading.gif +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/img/plupload.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/jquery.ui.plupload.js +1343 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/license.txt +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/moxie.js +11158 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/moxie.min.js +16 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.browserplus.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.dev.js +2381 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.swf +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js.default +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.min.js +29 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.gears.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html4.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js.default +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.min.js +13 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/readme.md +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/CHANGELOG.md +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/README.md +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-media.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.pack.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/lib/jquery.mousewheel-3.0.6.pack.js +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/photo_gallery.js +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/chosen.css.scss +262 -262
- data/app/assets/stylesheets/refinery/photo_gallery/admin/photo_gallery.css.scss +1 -13
- data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css +0 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/jquery.fancybox.css.scss +0 -0
- data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +10 -3
- data/app/controllers/refinery/photo_gallery/admin/collections_controller.rb +8 -0
- data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +19 -8
- data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +5 -1
- data/app/helpers/refinery/photo_gallery/albums_helper.rb +0 -0
- data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +0 -0
- data/app/models/refinery/album_page.rb +0 -1
- data/app/models/refinery/photo_gallery/album.rb +0 -2
- data/app/models/refinery/photo_gallery/collection.rb +0 -2
- data/app/models/refinery/photo_gallery/collection_album.rb +0 -0
- data/app/models/refinery/photo_gallery/photo.rb +14 -16
- data/app/sweepers/refinery/admin/album_page_sweeper.rb +0 -0
- data/app/sweepers/refinery/photo_gallery/admin/album_sweeper.rb +0 -0
- data/app/sweepers/refinery/photo_gallery/admin/photo_sweeper.rb +0 -0
- data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +7 -1
- data/app/views/refinery/admin/pages/tabs/_form.html.erb +0 -0
- data/app/views/refinery/admin/pages/tabs/_photo_gallery.html.erb +0 -0
- data/app/views/refinery/admin/pages/tabs/_photo_pages_bar.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +4 -30
- data/app/views/refinery/photo_gallery/admin/albums/_album.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/_albums.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/_form.html.erb +1 -2
- data/app/views/refinery/photo_gallery/admin/albums/edit.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/albums/new.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/_collection.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/_collections.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/_form.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/edit.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +1 -0
- data/app/views/refinery/photo_gallery/admin/collections/new.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +1 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_fields_actions.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/edit_multiple.html.erb +0 -0
- data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +4 -3
- data/app/views/refinery/photo_gallery/albums/_photos.html.erb +6 -2
- data/app/views/refinery/photo_gallery/albums/_photos.js.erb +0 -0
- data/app/views/refinery/photo_gallery/albums/_show.html.erb +0 -0
- data/config/initializers/carrierwave.rb +0 -0
- data/config/initializers/form_builder.rb +0 -0
- data/config/initializers/refinery/core.rb +0 -0
- data/config/initializers/s3.rb +0 -0
- data/config/locales/en.yml +2 -2
- data/config/locales/pl.yml +110 -0
- data/config/locales/sk.yml +2 -2
- data/config/routes.rb +0 -0
- data/db/migrate/20120804063842_create_albums.rb +0 -0
- data/db/migrate/20120805131321_create_collections.rb +0 -0
- data/db/migrate/20120805131547_create_collection_albums.rb +0 -0
- data/db/migrate/20120805165238_create_photos.rb +0 -0
- data/db/migrate/20120805222125_add_indexes.rb +2 -2
- data/db/migrate/20120805222126_create_album_pages.rb +0 -0
- data/db/migrate/20130127175559_add_url_to_photos.rb +5 -0
- data/db/migrate/20130128173800_add_css_styles_and_show_original_fields_to_photos.rb +6 -0
- data/db/seeds.rb +0 -0
- data/lib/generators/refinery/photo_gallery_generator.rb +5 -2
- data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +3 -2
- data/lib/refinery/photo_gallery.rb +0 -1
- data/lib/refinery/photo_gallery/configuration.rb +7 -1
- data/lib/refinery/photo_gallery/engine.rb +0 -1
- data/lib/refinery/photo_gallery/extensions/pages_controller_extension.rb +0 -0
- data/lib/refinery/photo_gallery/extensions/pages_extension.rb +4 -12
- data/lib/refinery/photo_gallery/version.rb +2 -2
- data/lib/refinerycms-photo-gallery.rb +0 -0
- data/refinerycms-photo-gallery.gemspec +2 -3
- data/spec/factories/album_photos.rb +5 -0
- data/spec/factories/albums.rb +23 -0
- data/spec/factories/collections.rb +6 -0
- data/spec/factories/photos.rb +12 -0
- data/spec/factories/user.rb +27 -0
- data/spec/features/manage_albums_spec.rb +93 -0
- data/spec/features/manage_collections_spec.rb +62 -0
- data/spec/features/manage_photos_spec.rb +47 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/support/images/refinery-logo-trans.png +0 -0
- data/tasks/rspec.rake +6 -0
- data/tasks/testing.rake +8 -0
- metadata +110 -63
@@ -1,6 +1,3 @@
|
|
1
|
-
.folder_icon {
|
2
|
-
background-image: image-url('refinery/photo_gallery/admin/icons/folder.png');
|
3
|
-
}
|
4
1
|
.folder_add_icon {
|
5
2
|
background-image: image-url('refinery/photo_gallery/admin/icons/folder_add.png');
|
6
3
|
}
|
@@ -31,10 +28,6 @@
|
|
31
28
|
|
32
29
|
|
33
30
|
|
34
|
-
.settings_icon {
|
35
|
-
background-image: image-url('refinery/photo_gallery/admin/icons/cog.png');
|
36
|
-
}
|
37
|
-
|
38
31
|
ul.collapsible_menu li {
|
39
32
|
position: relative;
|
40
33
|
}
|
@@ -47,12 +40,7 @@ ul.collapsible_menu li span.arrow {
|
|
47
40
|
height: 7px;
|
48
41
|
cursor: pointer;
|
49
42
|
}
|
50
|
-
|
51
|
-
background-image: image-url('refinery/photo_gallery/admin/icons/up.gif');
|
52
|
-
}
|
53
|
-
ul.collapsible_menu li.closed span.arrow {
|
54
|
-
background-image: image-url('refinery/photo_gallery/admin/icons/down.gif');
|
55
|
-
}
|
43
|
+
|
56
44
|
ul.collapsible_menu > div {
|
57
45
|
width: 93%;
|
58
46
|
margin: 0px auto;
|
data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss
CHANGED
File without changes
|
data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss
CHANGED
File without changes
|
data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss
CHANGED
File without changes
|
data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css
CHANGED
File without changes
|
File without changes
|
@@ -2,13 +2,12 @@ module Refinery
|
|
2
2
|
module PhotoGallery
|
3
3
|
module Admin
|
4
4
|
class AlbumsController < ::Refinery::AdminController
|
5
|
-
cache_sweeper AlbumSweeper
|
6
5
|
crudify :'refinery/photo_gallery/album', :order => "created_at DESC" , :xhr_paging => true
|
7
6
|
|
8
7
|
def create
|
9
|
-
@album = Album.new(
|
8
|
+
@album = Album.new(album_params)
|
10
9
|
|
11
|
-
if @album.save
|
10
|
+
if @album.save
|
12
11
|
flash[:notice]= t('refinery.crudify.created',:what => "'#{@album.title}'" )
|
13
12
|
|
14
13
|
redirect_to refinery.upload_photo_gallery_admin_album_photos_path(@album)
|
@@ -17,6 +16,14 @@ module Refinery
|
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
19
|
+
protected
|
20
|
+
|
21
|
+
def album_params
|
22
|
+
params.require(:album).permit(:title, :description, :address, :note, :tags, :longitude, :latitude, :path, :path_prefix, :collection_ids => [])
|
23
|
+
end
|
24
|
+
|
25
|
+
alias_method :new_album_params, :album_params
|
26
|
+
alias_method :edit_album_params, :album_params
|
20
27
|
|
21
28
|
end
|
22
29
|
end
|
@@ -4,6 +4,14 @@ module Refinery
|
|
4
4
|
class CollectionsController < ::Refinery::AdminController
|
5
5
|
|
6
6
|
crudify :'refinery/photo_gallery/collection', :order => "created_at DESC" , :xhr_paging => true
|
7
|
+
|
8
|
+
protected
|
9
|
+
|
10
|
+
def collection_params
|
11
|
+
params.require(:collection).permit(:title, :description)
|
12
|
+
end
|
13
|
+
|
14
|
+
alias_method :new_collection_params, :collection_params
|
7
15
|
end
|
8
16
|
end
|
9
17
|
end
|
@@ -5,8 +5,6 @@ module Refinery
|
|
5
5
|
module Admin
|
6
6
|
class PhotosController < ::Refinery::AdminController
|
7
7
|
include PhotosHelper
|
8
|
-
helper :"refinery/photo_gallery/admin/photos"
|
9
|
-
cache_sweeper PhotoSweeper
|
10
8
|
|
11
9
|
#TODO delete update method from routes
|
12
10
|
#TODO delete edit action from routes
|
@@ -14,11 +12,11 @@ module Refinery
|
|
14
12
|
#TODO after destroying album, delete empty folders
|
15
13
|
|
16
14
|
def upload
|
17
|
-
@album = Album.find( params[:album_id])
|
15
|
+
@album = Album.find( params[:album_id].to_i)
|
18
16
|
end
|
19
17
|
|
20
18
|
def create
|
21
|
-
@photo = Photo.new(
|
19
|
+
@photo = Photo.new(new_photo_params)
|
22
20
|
@photo.file = params[:file]
|
23
21
|
@photo.title = get_filename_part(params[:name])
|
24
22
|
|
@@ -30,17 +28,17 @@ module Refinery
|
|
30
28
|
end
|
31
29
|
|
32
30
|
def edit_multiple
|
33
|
-
@album = Album.find( params[:album_id] )
|
31
|
+
@album = Album.find( params[:album_id].to_i )
|
34
32
|
@photos = @album.photos.order("created_at DESC")
|
35
33
|
end
|
36
34
|
|
37
35
|
|
38
36
|
def update_multiple
|
39
|
-
photo_ids =
|
37
|
+
photo_ids = update_multiple_photo_params["photo"].map{ |key, hash| key }
|
40
38
|
|
41
39
|
@photos = Photo.find(photo_ids)
|
42
40
|
@photos.each do |photo|
|
43
|
-
photo.update_attributes(
|
41
|
+
photo.update_attributes(update_multiple_photo_params["photo"][photo.id.to_s]) #TODO use ! method and validate exceptions
|
44
42
|
end
|
45
43
|
|
46
44
|
flash[:notice] = t('updated', :scope=> 'refinery.photo_gallery.admin.photos')
|
@@ -49,10 +47,13 @@ module Refinery
|
|
49
47
|
|
50
48
|
|
51
49
|
def destroy
|
52
|
-
@photo = Photo.find( params[:id])
|
50
|
+
@photo = Photo.find( params[:id].to_i)
|
53
51
|
|
54
52
|
if @photo.destroy
|
55
53
|
respond_to do |format|
|
54
|
+
format.html {
|
55
|
+
redirect_to refinery.photo_gallery_admin_albums_path
|
56
|
+
}
|
56
57
|
format.js {
|
57
58
|
render :partial=> "destroy", :locals => {:photo => @photo}
|
58
59
|
}
|
@@ -62,7 +63,17 @@ module Refinery
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
66
|
+
protected
|
67
|
+
|
68
|
+
def update_multiple_photo_params
|
69
|
+
params.require(:photos).permit(:photo => [ :id, :title, :description, :url, :css_class, :preview_type, :longitude, :latitude ] )
|
70
|
+
end
|
71
|
+
|
72
|
+
def photo_params
|
73
|
+
params.require(:photo).permit(:album_id, :title, :description, :longitude, :latitude, :url, :css_class, :preview_type)
|
74
|
+
end
|
65
75
|
|
76
|
+
alias_method :new_photo_params, :photo_params
|
66
77
|
end
|
67
78
|
end
|
68
79
|
end
|
File without changes
|
File without changes
|
@@ -11,8 +11,6 @@ module Refinery
|
|
11
11
|
validates :path, :presence => true, :uniqueness => true
|
12
12
|
|
13
13
|
attr_accessor :path_prefix
|
14
|
-
attr_accessible :title, :description, :address, :note, :tags, :longitude, :latitude, :path, :path_prefix, :collection_ids
|
15
|
-
acts_as_indexed :fields => [:title, :description]
|
16
14
|
|
17
15
|
self.per_page = Refinery::PhotoGallery.albums_per_page
|
18
16
|
|
@@ -6,10 +6,8 @@ module Refinery
|
|
6
6
|
|
7
7
|
#TODO Allow to remove collection only if no album belongs to it
|
8
8
|
|
9
|
-
attr_accessible :title, :description
|
10
9
|
|
11
10
|
validates :title, :presence => true
|
12
|
-
acts_as_indexed :fields => [:title, :description]
|
13
11
|
|
14
12
|
self.per_page = Refinery::PhotoGallery.collections_per_page
|
15
13
|
|
File without changes
|
@@ -4,8 +4,7 @@ module Refinery
|
|
4
4
|
belongs_to :album
|
5
5
|
|
6
6
|
mount_uploader :file, Refinery::PhotoGallery::Admin::FileUploader
|
7
|
-
|
8
|
-
attr_accessible :album_id, :title, :description, :longitude, :latitude
|
7
|
+
|
9
8
|
validates :title, :presence => true
|
10
9
|
#TODO validate latitude/longitude - convert from nondecimal to decimal using inspiration from https://github.com/airblade/geo_tools/tree/master/lib/geo_tools
|
11
10
|
|
@@ -20,6 +19,19 @@ module Refinery
|
|
20
19
|
"#{id}-#{title.parameterize}"
|
21
20
|
end
|
22
21
|
|
22
|
+
def link_url
|
23
|
+
self.url.blank? ? file.single.url : self.url
|
24
|
+
end
|
25
|
+
|
26
|
+
def preview_link(ext_type = :album)
|
27
|
+
begin
|
28
|
+
type = self.preview_type.blank? ? ext_type : self.preview_type
|
29
|
+
file.url(type)
|
30
|
+
rescue Exception => e
|
31
|
+
file.url(:error_wrong_preview_version)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
23
35
|
private
|
24
36
|
|
25
37
|
def set_title
|
@@ -44,20 +56,6 @@ module Refinery
|
|
44
56
|
end
|
45
57
|
|
46
58
|
|
47
|
-
=begin
|
48
|
-
#TODO add checkbox to check if it should be writed to exif, globally on/off writing
|
49
|
-
def exif_write
|
50
|
-
# should only write if tags are changed as images can be large and thus ExifTool will take a while to write to the file
|
51
|
-
photo = MiniExiftool.new(self.file.file.file)
|
52
|
-
photo.GPSLongitude = self.longitude
|
53
|
-
photo.GPSLatitude = self.latitude
|
54
|
-
photo.DocumentName = self.title
|
55
|
-
photo.ImageDescription = self.description
|
56
|
-
photo.Keywords = self.tags
|
57
|
-
photo.save
|
58
|
-
end
|
59
|
-
=end
|
60
|
-
|
61
59
|
end
|
62
60
|
end
|
63
61
|
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -47,6 +47,7 @@ module Refinery
|
|
47
47
|
"thumbs/#{model.album.path}"
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
50
51
|
version :preview do
|
51
52
|
process :resize_to_fit => Refinery::PhotoGallery.preview_dimensions
|
52
53
|
process :auto_orient
|
@@ -54,8 +55,8 @@ module Refinery
|
|
54
55
|
"thumbs/#{model.album.path}"
|
55
56
|
end
|
56
57
|
end
|
57
|
-
version :single do
|
58
58
|
|
59
|
+
version :single do
|
59
60
|
process :resize_to_limit => Refinery::PhotoGallery.single_dimensions
|
60
61
|
process :auto_orient
|
61
62
|
|
@@ -64,6 +65,11 @@ module Refinery
|
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
68
|
+
version :error_wrong_preview_version do
|
69
|
+
def store_dir
|
70
|
+
"error/wrong_preview_version.png"
|
71
|
+
end
|
72
|
+
end
|
67
73
|
|
68
74
|
# Add a white list of extensions which are allowed to be uploaded,
|
69
75
|
def extension_white_list
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,51 +1,25 @@
|
|
1
1
|
<nav id='actions' class='multilist'>
|
2
|
-
<ul class='search_list'>
|
3
|
-
<li class='not_a_link'>
|
4
|
-
<% if params[:controller] == "refinery/photo_gallery/admin/collections" %>
|
5
|
-
<%= render :partial => "/refinery/admin/search",
|
6
|
-
:locals => {
|
7
|
-
:url => refinery.photo_gallery_admin_collections_path
|
8
|
-
} %>
|
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>
|
17
2
|
|
18
3
|
<ul class='collapsible_menu'>
|
19
4
|
<li class='not_a_link'>
|
20
|
-
<%= link_to t('.albums.title'), '#',
|
21
|
-
:class => 'album_icon' %>
|
22
|
-
</li>
|
23
|
-
<li>
|
24
5
|
<%= link_to t('.albums.manage'), refinery.photo_gallery_admin_albums_path,
|
25
|
-
:class => '
|
6
|
+
:class => 'folder_icon' %>
|
26
7
|
</li>
|
27
8
|
<li>
|
28
9
|
<%= link_to t('.albums.new'), refinery.new_photo_gallery_admin_album_path,
|
29
|
-
:class => '
|
10
|
+
:class => 'add_icon' %>
|
30
11
|
</li>
|
31
12
|
</ul>
|
32
13
|
|
33
14
|
<ul class='collapsible_menu'>
|
34
15
|
<li class='not_a_link'>
|
35
|
-
<%= link_to t('.collections.title'), '#',
|
36
|
-
:class => 'folder_icon' %>
|
37
|
-
</li>
|
38
|
-
<li>
|
39
16
|
<%= link_to t('.collections.manage'), refinery.photo_gallery_admin_collections_path,
|
40
|
-
:class => '
|
17
|
+
:class => 'folder_icon' %>
|
41
18
|
</li>
|
42
19
|
<li>
|
43
20
|
<%= link_to t('.collections.new'), refinery.new_photo_gallery_admin_collection_path,
|
44
|
-
:class => '
|
21
|
+
:class => 'add_icon' %>
|
45
22
|
</li>
|
46
23
|
</ul>
|
47
|
-
|
48
|
-
|
49
24
|
</nav>
|
50
25
|
|
51
|
-
<% content_for :stylesheets, stylesheet_link_tag('refinery/photo_gallery/admin/backend') %>
|
File without changes
|
File without changes
|
@@ -11,10 +11,9 @@
|
|
11
11
|
<%= f.text_field :title, {:class => 'larger widest'} %><br />
|
12
12
|
</div>
|
13
13
|
|
14
|
-
<%# TODO use pop up to create collection %>
|
15
14
|
<div class='field'>
|
16
15
|
<%= label :collection, t('.album_belongs_to_collection') %>
|
17
|
-
<%= collection_select(:album, :collection_ids, Refinery::PhotoGallery::Collection.all(
|
16
|
+
<%= collection_select(:album, :collection_ids, Refinery::PhotoGallery::Collection.all.order("title ASC"), :id, :title,
|
18
17
|
{ },
|
19
18
|
{ :data => {:placeholder=> t('.choose_collection')}, :multiple=> true, :class=> "chzn-select", :style=>"width:400px;"}) %>
|
20
19
|
</div>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<%= content_for :javascripts do %>
|
2
|
-
<style type="text/css">@import url('/assets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css');</style>
|
3
2
|
|
4
|
-
<%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/plupload.full.js" -%>
|
5
|
-
<%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js" -%>
|
3
|
+
<%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/plupload.full.min.js" -%>
|
4
|
+
<%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/jquery.plupload.queue.js" -%>
|
6
5
|
<%= javascript_include_tag "/assets/refinery/photo_gallery/admin/plupload/i18n/" + Refinery::PhotoGallery.plupload_locale.to_s + ".js" -%>
|
6
|
+
<style type="text/css">@import url('/assets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css');</style>
|
7
|
+
|
7
8
|
|
8
9
|
<script type="text/javascript">
|
9
10
|
<% session_key = Rails.application.config.session_options[:key] %>
|
@@ -5,8 +5,12 @@
|
|
5
5
|
|
6
6
|
<ul id="gallery" class="clearfix">
|
7
7
|
<% photos_for_page.each_with_index do |photo, index| %>
|
8
|
-
|
9
|
-
|
8
|
+
<% if photo.css_class.present? %>
|
9
|
+
<li class="<%= photo.css_class %>" >
|
10
|
+
<% else %>
|
11
|
+
<li>
|
12
|
+
<% end %>
|
13
|
+
<%= link_to (image_tag photo.preview_link(:album), :width => Refinery::PhotoGallery.album_dimensions[0], :height => Refinery::PhotoGallery.album_dimensions[1] ), photo.link_url, {
|
10
14
|
:target=> "_blank",
|
11
15
|
:class=>"fancybox",
|
12
16
|
:data =>{:title=> t('.image') + ' ' + (index + 1 ).to_s + '/' + photos_for_page.total_pages.to_s + ' ' + photo.title + '<br/><br/>' + photo.description},
|