Commit d76bc2b5 authored by Matho's avatar Matho
Browse files

Introduce support for Rails 5.1 and Refinery 4.0.3

parent 7111ec5d
source "https://rubygems.org"
gem "refinerycms-authentication-devise", '~> 1.0.4'
# this is due to renaming FactoryGirl -> FactoryBot. You do not need to use this version exactly
gem "refinerycms-authentication-devise", '~> 2.0.1', git: 'https://github.com/refinery/refinerycms-authentication-devise', ref: "4fbe5428ea2fd2bfe033617d50c47dc2ce14351d"
gemspec
gem 'refinerycms', '~> 3.0.6'
gem 'refinerycms', '~> 4.0.3'
group :development, :test do
gem 'refinerycms-testing', '~> 3.0.6'
gem 'listen'
end
group :development, :test do
gem 'refinerycms-testing', '~> 4.0.3'
end
# Add the default visual editor, for now.
......
GIT
remote: https://github.com/refinery/refinerycms-authentication-devise
revision: 4fbe5428ea2fd2bfe033617d50c47dc2ce14351d
ref: 4fbe5428ea2fd2bfe033617d50c47dc2ce14351d
specs:
refinerycms-authentication-devise (2.0.1)
actionmailer (>= 5.0.0)
devise (~> 4.0, >= 4.3.0)
friendly_id (~> 5.2.1)
refinerycms-core (>= 3.0.0, < 5.0)
PATH
remote: .
specs:
......@@ -7,61 +18,64 @@ PATH
mini_exiftool
mini_magick (>= 4.9.4)
rack (>= 1.6.11)
refinerycms-core (~> 3.0.6)
refinerycms-core (~> 4.0.3)
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
actionmailer (5.1.7)
actionpack (= 5.1.7)
actionview (= 5.1.7)
activejob (= 5.1.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7.1)
actionview (= 4.2.7.1)
activesupport (= 4.2.7.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
actionpack (5.1.7)
actionview (= 5.1.7)
activesupport (= 5.1.7)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7.1)
activesupport (= 4.2.7.1)
actionview (5.1.7)
activesupport (= 5.1.7)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7.1)
activesupport (= 4.2.7.1)
globalid (>= 0.3.0)
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.1.7)
activesupport (= 5.1.7)
globalid (>= 0.3.6)
activemodel (5.1.7)
activesupport (= 5.1.7)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (4.2.7.1)
activemodel (= 4.2.7.1)
activesupport (= 4.2.7.1)
arel (~> 6.0)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
activerecord (5.1.7)
activemodel (= 5.1.7)
activesupport (= 5.1.7)
arel (~> 8.0)
activesupport (5.1.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
acts_as_indexed (0.8.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (6.0.4)
awesome_nested_set (3.0.3)
activerecord (>= 4.0.0, < 5)
arel (8.0.0)
awesome_nested_set (3.2.0)
activerecord (>= 4.0.0, < 7.0)
babosa (1.0.3)
bcrypt (3.1.11)
bcrypt (3.1.13)
builder (3.2.3)
capybara (2.4.4)
mime-types (>= 1.16)
capybara (2.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
xpath (>= 2.0, < 4.0)
capybara-screenshot (1.0.14)
capybara (>= 1.0, < 3)
launchy
......@@ -80,62 +94,86 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
crass (1.0.5)
database_cleaner (1.3.0)
database_cleaner (1.7.0)
decorators (2.0.5)
railties (>= 4.0.0, < 7)
devise (3.5.10)
devise (4.7.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.3)
diffy (3.1.0)
dragonfly (1.1.5)
diffy (3.3.0)
dragonfly (1.2.0)
addressable (~> 2.3)
multi_json (~> 1.0)
rack (>= 1.3)
erubis (2.7.0)
dragonfly-s3_data_store (1.3.0)
dragonfly (~> 1.0)
fog-aws
erubi (1.9.0)
excon (0.68.0)
execjs (2.7.0)
factory_girl (4.5.0)
factory_bot (4.11.1)
activesupport (>= 3.0.0)
factory_girl_rails (4.6.0)
factory_girl (~> 4.5.0)
factory_bot_rails (4.11.1)
factory_bot (~> 4.11.1)
railties (>= 3.0.0)
ffi (1.11.1)
fog-aws (3.5.2)
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-core (2.1.2)
builder
excon (~> 0.58)
formatador (~> 0.2)
mime-types
fog-json (1.2.0)
fog-core
multi_json (~> 1.10)
fog-xml (0.1.3)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
font-awesome-sass (4.7.0)
sass (>= 3.2)
friendly_id (5.1.0)
formatador (0.2.5)
friendly_id (5.2.5)
activerecord (>= 4.0.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalize (5.1.0)
activemodel (>= 4.2, < 5.2)
activerecord (>= 4.2, < 5.2)
request_store (~> 1.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
ipaddress (0.8.3)
jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
json (1.8.6)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.2.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.3.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.8.2)
mime-types (3.1)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mime-types-data (3.2019.1009)
mini_exiftool (2.9.1)
mini_magick (4.9.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
multi_json (1.14.1)
......@@ -152,87 +190,93 @@ GEM
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (4.0.1)
rack (1.6.11)
rack-test (0.6.3)
rack (>= 1.0)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rack (2.0.7)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails-controller-testing (0.1.1)
actionpack (~> 5.x)
actionview (~> 5.x)
activesupport (~> 5.x)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (4.0.9)
rails-i18n (5.0.4)
i18n (~> 0.7)
railties (~> 4.0)
railties (4.2.7.1)
actionpack (= 4.2.7.1)
activesupport (= 4.2.7.1)
railties (~> 5.0)
railties (5.1.7)
actionpack (= 5.1.7)
activesupport (= 5.1.7)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.0.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
refinerycms (3.0.6)
refinerycms-core (= 3.0.6)
refinerycms-images (= 3.0.6)
refinerycms-pages (= 3.0.6)
refinerycms-resources (= 3.0.6)
refinerycms-authentication-devise (1.0.4)
actionmailer (~> 4.2, >= 4.2.0)
devise (~> 3.0, >= 3.2.4)
friendly_id (~> 5.1.0)
refinerycms-core (~> 3.0, >= 3.0.0)
refinerycms-core (3.0.6)
actionpack (>= 4.2.3, < 5.0)
activerecord (>= 4.2.3, < 5.0)
awesome_nested_set (~> 3.0.0)
refinerycms (4.0.3)
refinerycms-core (= 4.0.3)
refinerycms-images (= 4.0.3)
refinerycms-pages (= 4.0.3)
refinerycms-resources (= 4.0.3)
refinerycms-core (4.0.3)
actionpack (>= 5.1.0, < 5.2)
activerecord (>= 5.1.0, < 5.2)
awesome_nested_set (~> 3.0, >= 3.0.0)
coffee-rails (~> 4.0, >= 4.0.0)
decorators (~> 2.0.0)
decorators (~> 2.0, >= 2.0.0)
font-awesome-sass (>= 4.3.0, < 5.0)
jquery-rails (>= 2.3.0)
jquery-ui-rails (~> 5.0.0)
railties (>= 4.2.3, < 5.0)
refinerycms-i18n (~> 3.0.0)
jquery-rails (~> 4.3, >= 4.3.1)
jquery-ui-rails (~> 5.0, >= 5.0.0)
railties (>= 5.1.0, < 5.2)
refinerycms-i18n (~> 4.0, >= 4.0.0)
sass-rails (>= 4.0, < 5.1)
truncate_html (~> 0.9)
will_paginate (~> 3.0.2)
zilch-authorisation
refinerycms-i18n (3.0.2)
rails-i18n (~> 4.0.1)
will_paginate (~> 3.1, >= 3.1.0)
zilch-authorisation (~> 0, >= 0.0.1)
refinerycms-dragonfly (1.0.1)
dragonfly (~> 1.1)
dragonfly-s3_data_store
refinerycms-i18n (4.0.2)
rails-i18n (~> 5.0.0)
routing-filter (>= 0.4.0)
refinerycms-images (3.0.6)
dragonfly (~> 1.1.0)
globalize (>= 4.0.0, < 5.2)
refinerycms-core (= 3.0.6)
refinerycms-pages (3.0.6)
awesome_nested_set (~> 3.0.0)
refinerycms-images (4.0.3)
activemodel-serializers-xml (~> 1.0, >= 1.0.1)
globalize (>= 5.1.0.beta1, < 5.2)
refinerycms-core (= 4.0.3)
refinerycms-dragonfly (~> 1.0)
refinerycms-pages (4.0.3)
activemodel-serializers-xml (~> 1.0, >= 1.0.1)
awesome_nested_set (~> 3.1, >= 3.1.0)
babosa (!= 0.3.6)
diffy (~> 3.1.0)
diffy (~> 3.1, >= 3.1.0)
friendly_id (>= 5.1.0, < 5.3)
globalize (>= 4.0.0, < 5.2)
refinerycms-core (= 3.0.6)
seo_meta (~> 2.0.0.rc.1)
speakingurl-rails (~> 8.0.0)
refinerycms-resources (3.0.6)
globalize (>= 5.1.0.beta1, < 5.2)
refinerycms-core (= 4.0.3)
seo_meta (~> 3.0, >= 3.0.0)
speakingurl-rails (~> 8.0, >= 8.0.0)
refinerycms-resources (4.0.3)
activemodel-serializers-xml (~> 1.0, >= 1.0.1)
acts_as_indexed (~> 0.8.0)
dragonfly (~> 1.1.0)
globalize (>= 4.0.0, < 5.2)
refinerycms-core (= 3.0.6)
refinerycms-testing (3.0.6)
capybara (~> 2.4.3)
database_cleaner (~> 1.3.0)
factory_girl_rails (~> 4.6.0)
refinerycms-core (= 3.0.6)
rspec-rails (~> 3.0)
dragonfly (~> 1.1, >= 1.1.0)
globalize (>= 5.1.0.beta1, < 5.2)
refinerycms-core (= 4.0.3)
refinerycms-dragonfly (~> 1.0)
refinerycms-testing (4.0.3)
capybara (~> 2.7)
database_cleaner (~> 1.6)
factory_bot_rails (~> 4.8)
rails-controller-testing (~> 0.1.1)
refinerycms-core (= 4.0.3)
rspec-rails (~> 3.5)
refinerycms-wymeditor (1.1.0)
refinerycms-core (>= 3.0.0, < 5.0)
request_store (1.4.1)
rack (>= 1.4)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
routing-filter (0.6.3)
actionpack (>= 4.2)
activesupport (>= 4.2)
......@@ -264,8 +308,8 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
seo_meta (2.0.1)
railties (>= 3.0.0)
seo_meta (3.0.0)
railties (>= 5.0.0)
slop (3.6.0)
speakingurl-rails (8.0.2)
railties (>= 3.1)
......@@ -283,14 +327,14 @@ GEM
truncate_html (0.9.3)
tzinfo (1.2.5)
thread_safe (~> 0.1)
warden (1.2.6)
rack (>= 1.0)
warden (1.2.8)
rack (>= 2.0.6)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.0.12)
xpath (2.0.0)
nokogiri (~> 1.3)
will_paginate (3.2.1)
xpath (3.2.0)
nokogiri (~> 1.8)
zilch-authorisation (0.0.1)
PLATFORMS
......@@ -302,13 +346,14 @@ DEPENDENCIES
capybara-screenshot
coffee-rails
launchy
listen
pg
poltergeist
pry
refinerycms (~> 3.0.6)
refinerycms-authentication-devise (~> 1.0.4)
refinerycms (~> 4.0.3)
refinerycms-authentication-devise (~> 2.0.1)!
refinerycms-photo-gallery!
refinerycms-testing (~> 3.0.6)
refinerycms-testing (~> 4.0.3)
refinerycms-wymeditor (~> 1.0, >= 1.0.6)
sass-rails
sqlite3
......
......@@ -16,15 +16,6 @@ $(function() {
return false;
});
$('#more_photo_options_field #toggle_advanced_options').click(function(e){
e.preventDefault();
$('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250);
$('html,body').animate({
scrollTop: $('#toggle_advanced_options').parent().offset().top
}, 250);
});
$(".chzn-select").chosen(
{
no_results_text: "<%= I18n.t('chosen.no_results') %>"
......@@ -50,4 +41,4 @@ $(function() {
return false;
});
});
\ No newline at end of file
});
......@@ -34,7 +34,7 @@ module Refinery
def update_multiple
photo_ids = update_multiple_photo_params["photo"].map{ |key, hash| key }
photo_ids = update_multiple_photo_params["photo"].keys
@photos = Photo.find(photo_ids)
@photos.each do |photo|
......@@ -77,4 +77,4 @@ module Refinery
end
end
end
end
\ No newline at end of file
end
module Refinery
class AlbumPage < Refinery::Core::BaseModel
belongs_to :album , :class_name => Refinery::PhotoGallery::Album
belongs_to :album , class_name: 'Refinery::PhotoGallery::Album'
belongs_to :page, :polymorphic => true
......
......@@ -19,13 +19,12 @@ module Refinery
select("refinery_photo_gallery_albums.*, refinery_photo_gallery_collection_albums.collection_id ").joins(:collection_albums)
end
scope :find_by_collection_id, lambda {|collection_id|
select("refinery_photo_gallery_albums.*").
joins(:collection_albums).
where("refinery_photo_gallery_collection_albums.collection_id = ?
", collection_id).
order('created_at DESC, title ASC')
}
# scope :find_by_collection_id, ->(collection_id) {
# select("refinery_photo_gallery_albums.*").
# joins(:collection_albums).
# where("refinery_photo_gallery_collection_albums.collection_id = ?", collection_id).
# order('created_at DESC, title ASC')
# }
def collection_ids
Refinery::PhotoGallery::CollectionAlbum.select('collection_id').where("album_id = ?", self.id ).map{|ca| ca.collection_id }
......
......@@ -7,7 +7,7 @@
:placeholder=> t('.choose_album')},
:multiple=> false,
:class=> "chzn-select-deselect",
:style=>"min-width: 300px;"
:style=>"width: 300px;"
}) %>
<% end %>
......@@ -9,4 +9,4 @@
<%= render "/refinery/admin/pages/tabs/form", :f => f %>
</div>
</div>
\ No newline at end of file
</div>
......@@ -20,7 +20,7 @@
<%= link_to (image_tag 'refinery/photo_gallery/admin/icons/album_edit.png'),
refinery.edit_photo_gallery_admin_album_path(album),
:title => t('.edit') %>
<%= link_to refinery_icon_tag("delete.png"), refinery.photo_gallery_admin_album_path(album),
<%= link_to image_tag('refinery/icons/delete.png'), refinery.photo_gallery_admin_album_path(album),
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
......
class CreateAlbums < ActiveRecord::Migration
class CreateAlbums < ActiveRecord::Migration[4.2]
def self.up
create_table "refinery_photo_gallery_albums" do |t|
create_table Refinery::PhotoGallery::Album.table_name do |t|
t.string :title, :length => 250, :null => false
t.text :description
t.string :path, :length => 100, :null=> true
......@@ -13,6 +13,6 @@ class CreateAlbums < ActiveRecord::Migration
end
def self.down
drop_table "refinery_photo_gallery_albums"
drop_table Refinery::PhotoGallery::Album.table_name
end
end
class CreateCollections < ActiveRecord::Migration
class CreateCollections < ActiveRecord::Migration[4.2]
def self.up
create_table Refinery::PhotoGallery::Collection.table_name do |t|
t.string :title, :null => false
......
class CreateCollectionAlbums < ActiveRecord::Migration
class CreateCollectionAlbums < ActiveRecord::Migration[4.2]
def self.up
create_table Refinery::PhotoGallery::CollectionAlbum.table_name do |t| #TODO primary id to false
t.references :collection
......
class CreatePhotos < ActiveRecord::Migration
class CreatePhotos < ActiveRecord::Migration[4.2]
def self.up
create_table "refinery_photo_gallery_photos" do |t|
create_table Refinery::PhotoGallery::Photo.table_name do |t|
t.string :title, :length => 250, :null => false
t.text :description
t.string :path, :length => 100, :null=> true
......@@ -14,6 +14,6 @@ class CreatePhotos < ActiveRecord::Migration
end
def self.down
drop_table "refinery_photo_gallery_photos"
drop_table Refinery::PhotoGallery::Photo.table_name
end
end
class AddIndexes < ActiveRecord::Migration
class AddIndexes < ActiveRecord::Migration[4.2]
def self.up
add_index Refinery::PhotoGallery::Album.table_name, :id, :unique => true
add_index Refinery::PhotoGallery::Collection.table_name, :id, :unique => true
......
class CreateAlbumPages < ActiveRecord::Migration
class CreateAlbumPages < ActiveRecord::Migration[4.2]
def up
create_table :refinery_album_pages do |t|
......
class AddUrlToPhotos < ActiveRecord::Migration
class AddUrlToPhotos < ActiveRecord::Migration[4.2]
def change
add_column :refinery_photo_gallery_photos, :url, :string
end
......
class AddCssStylesAndShowOriginalFieldsToPhotos < ActiveRecord::Migration
class AddCssStylesAndShowOriginalFieldsToPhotos < ActiveRecord::Migration[4.2]
def change
add_column :refinery_photo_gallery_photos, :css_class, :string
add_column :refinery_photo_gallery_photos, :preview_type, :string
......
......@@ -5,7 +5,7 @@ module Refinery
def self.included(base)
base.class_eval do
before_filter :ajax_photo_gallery, :only => :show
before_action :ajax_photo_gallery, :only => :show
def ajax_photo_gallery
......
......@@ -5,7 +5,7 @@ module Refinery
def has_one_page_album
has_one :album_page, :as => :page, :dependent=> :destroy
has_one :album, :through => :album_page
has_many :photos, -> {order "created_at ASC"}, class_name: Refinery::PhotoGallery::Photo, through: :album
has_many :photos, -> {order "created_at ASC"}, class_name: 'Refinery::PhotoGallery::Photo', through: :album
accepts_nested_attributes_for :album_page
......@@ -43,4 +43,4 @@ module Refinery