Commit 4bb06a2a authored by Alexandre Friquet's avatar Alexandre Friquet

Upgrades to rails 5.0.6 (make the app boot): refs #23.

parent 6d6d7f97
......@@ -5,6 +5,6 @@ log/*.log
tmp/
public/system
.DS_Store
vendor/bundle
vendor/bundle*
coverage
.env
......@@ -22,7 +22,7 @@
#
source 'https://rubygems.org'
gem 'rails', '4.2.9'
gem 'rails', '5.0.6'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
......@@ -41,27 +41,27 @@ gem 'delayed_job_active_record'
gem 'daemons'
gem 'rdoc'
gem 'fullcalendar-rails'
gem 'formatize', git: "https://github.com/januszm/formatize.git", ref: "0f2f138bc3069dd7a80e05d9bf28d98cc69f411d"
gem 'momentjs-rails'
gem 'formatize', git: 'https://github.com/infoPiiaf/formatize.git'
gem 'simple_form'
gem "nested_form"
gem 'geocoder'
gem 'gmaps4rails'
gem 'gretel'
gem 'gretel-trails', git: 'git@github.com:infoPiiaf/gretel-trails.git'
gem 'gretel-trails', git: 'https://github.com/infoPiiaf/gretel-trails.git'
gem 'piwik_analytics', git: 'https://git.framasoft.org/infopiiaf/piwik_analytics.git'
gem 'jquery-ui-rails'
gem 'compass-rails', '~> 2.0.0'
gem 'compass-rails'
gem 'susy'
#gem 'turbo-sprockets-rails3'
gem 'zeroclipboard-rails'
gem 'fitvidsjs_rails'
gem 'font-awesome-rails'
gem 'jquery-colorpicker-rails'
#gem 'jquery-colorpicker-rails'
gem 'prettyphoto-rails'
group :development, :test do
gem "sqlite3"
gem 'rspec-rails', '~> 3.5.0'
gem 'rspec-rails'
gem 'pry-rails'
end
......@@ -73,7 +73,7 @@ group :test do
gem 'capybara'
gem 'launchy'
gem 'factory_girl_rails'
gem 'shoulda-matchers'
gem 'shoulda-matchers', git: 'https://github.com/thoughtbot/shoulda-matchers.git', branch: 'rails-5'
gem 'test-unit', '~> 3.0' # For shoulda-matchers with ruby 2.3+
gem 'database_cleaner'
gem 'capybara-webkit'
......@@ -85,5 +85,5 @@ group :development do
#gem 'mailcatcher'
gem 'brakeman'
gem 'puma'
gem 'web-console', '~> 2.0'
gem 'web-console'
end
This diff is collapsed.
......@@ -23,17 +23,17 @@
//= require jquery
//= require jquery_ujs
//= require jquery.ui.effect
//= require jquery.ui.tabs
//= require jquery.ui.accordion
//= require jquery.ui.dialog
//= require modernizr-custom
//= require html5shiv
//= require autoresize.jquery.min
//= require jquery_nested_form
//= require jquery.ui.datepicker
//= require jquery.ui.datepicker-fr
//= require jquery.ui.slider
//= require jquery-ui/effect
//= require jquery-ui/widgets/tabs
//= require jquery-ui/widgets/accordion
//= require jquery-ui/widgets/dialog
//= require jquery-ui/widgets/datepicker
//= require jquery-ui/i18n/datepicker-fr
//= require jquery-ui/widgets/slider
//= require jquery-ui-timepicker-addon
//= require jquery-ui-timepicker-fr
//= require jquery.highlight
......@@ -43,8 +43,8 @@
//= require underscore-min
//= require gmaps/google
//= require gretel.trails.hidden
//= require jquery-colorpicker
//= require prettyphoto-rails
//= require moment
//= require fullcalendar
//= require_self
......
......@@ -24,7 +24,7 @@
@import "compass";
@import "compass/reset";
@import "application/pie";
@import "susy";
@import "susyone";
@import "font-awesome";
$base-font-size : 1em;
......
......@@ -24,7 +24,7 @@
nav#admin_links {
@extend .card-block;
@include background(linear-gradient(top, $oligaa-red, $white 20%, $white 80%, $oligaa-red));
@include pie;
//@include pie;
border: 1px solid $oligaa-red;
padding: 0;
text-align: center;
......
......@@ -22,14 +22,13 @@
*/
/*
*= require jquery.ui.tabs
*= require jquery.ui.accordion
*= require jquery.ui.datepicker
*= require jquery.ui.slider
*= require jquery.ui.dialog
*= require jquery-ui/tabs
*= require jquery-ui/accordion
*= require jquery-ui/datepicker
*= require jquery-ui/slider
*= require jquery-ui/dialog
*= require jquery-ui-timepicker-addon
*= require jquery.switchButton
*= require jquery.colorpicker
*= require prettyphoto-rails
*= require fullcalendar
*= require_self
......
......@@ -23,7 +23,7 @@
@mixin gradient-li-separated {
@include background(linear-gradient(left, $white, $oligaa-blue, $white));
@include pie;
//@include pie;
& > li {
background-color: #FFF;
......
......@@ -46,7 +46,7 @@
padding: 0.2em 1em;
margin: 5px 0;
@include border-radius(10px);
@include pie;
//@include pie;
}
.edit_attachment {@extend .attachment-edition}
\ No newline at end of file
......@@ -26,7 +26,7 @@ $anchor : 1; // #Columns still visible when menu open
$menu-columns : $total-columns - $anchor;
body {
@include pie;
//@include pie;
background-repeat: no-repeat;
background-attachment: fixed;
font-family: "Open Sans", verdana, arial, helvetica, sans-serif;
......
......@@ -43,7 +43,7 @@ a {
.fa {
@include border-radius(3px);
@include pie;
//@include pie;
background: lighten($color, $background-lighten);
}
......@@ -128,13 +128,13 @@ a.add_nested_fields, a.remove_nested_fields {
@include border-radius(5px);
padding: 0.2em 1em;
@include background(linear-gradient(top, $white, $grey));
@include pie;
//@include pie;
&:link, &:visited {
color: black;
}
&:hover {
text-decoration: none;
@include background(linear-gradient(top, $grey, $white));
@include pie;
//@include pie;
}
}
......@@ -35,7 +35,7 @@
@include border-radius(3px);
@include box-shadow(#000 0px 4px 12px);
@include legacy-pie-clearfix;
@include pie;
//@include pie;
background-color: $white;
margin: 0 0 $gutter-width 0;
padding: 0.5em 0;
......@@ -139,7 +139,7 @@ span.highlight { background-color: $oligaa-yellow}
.rounded_box {
@include border-radius(3px);
@include pie;
//@include pie;
}
.last_update {
......@@ -171,7 +171,7 @@ span.highlight { background-color: $oligaa-yellow}
border: 1px solid darkgrey;
padding: 1px 5px;
@include border-radius(5px);
@include pie;
//@include pie;
}
.edit_logo {
......@@ -179,7 +179,7 @@ span.highlight { background-color: $oligaa-yellow}
margin-bottom: 10px;
padding: 5px;
@include border-radius(5px);
@include pie;
//@include pie;
}
#goToTop {
......
......@@ -25,5 +25,5 @@
$pie-behavior: javascript-url("PIE.htc");
$pie-base-class: pie-element;
.pie-element {
@include pie-element(relative);
// @include pie-element(relative);
}
......@@ -36,7 +36,7 @@ body #page #columns #content #event_types_filter {
margin: 0;
padding: 0 0.5em;
@include border-radius(3px);
@include pie;
//@include pie;
}
}
......@@ -52,7 +52,7 @@ dl.events {
dt {
@include border-radius(3px);
@include pie;
//@include pie;
padding: 0 0.5em;
}
......
......@@ -40,7 +40,7 @@
&[type="submit"] {
@include background(linear-gradient(#1D65A6, $oligaa-blue));
@include pie;
//@include pie;
color: $white;
&:active {
......
......@@ -114,7 +114,7 @@ form#members_filter {
@include border-radius(3px);
@include span-columns(4, 8);
@include pre(2, 8);
@include pie;
//@include pie;
border: 1px solid $oligaa-blue;
color: $white;
font-size: 1em;
......
......@@ -123,11 +123,11 @@ body #page #columns #content #home_news {
display: none;
padding: 2em 0 1em;
text-align: left;
width: columns(7);
//width: auto;
span {
@include border-radius(3px);
@include pie;
//@include pie;
background-color: $grey;
color: $white;
padding: 0.2em 1em;
......
......@@ -41,7 +41,7 @@
&[type="submit"] {
@include background(linear-gradient(#1D65A6, $oligaa-blue));
@include pie;
//@include pie;
color: $white;
&:active {
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ActivitiesController < ApplicationController
before_filter :authorize, :except => [ :show ]
before_action :authorize, :except => [ :show ]
def index
@activity_categories = ActivityCategory.all
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ActivityCategoriesController < ApplicationController
before_filter :authorize, :except => [ :show ]
before_action :authorize, :except => [ :show ]
def show
@activity_category = ActivityCategory.find(params[:id])
......
......@@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base
helper :all
helper_method :admin?, :current_member, :settings
before_filter :set_timezone, :check_new_member
before_action :set_timezone, :check_new_member
def set_timezone
Time.zone = "Paris"
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ContactTypesController < ApplicationController
before_filter :authorize
before_action :authorize
def index
@contact_types = ContactType.all
......
......@@ -31,7 +31,7 @@ class ContactUsController < ApplicationController
@mail = ContactUsMail.new(params[:contact_us_mail])
if @mail.valid?
begin
Mailer.contact_us(@mail).deliver
Mailer.contact_us(@mail).deliver_later
flash[:notice] = "Votre email a été envoyé avec succès."
redirect_to root_path
rescue
......@@ -42,4 +42,4 @@ class ContactUsController < ApplicationController
render :new
end
end
end
\ No newline at end of file
end
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class EmailsController < ApplicationController
before_filter :authorize
before_action :authorize
def index
@unsent_emails = Email.unsent
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class EventTypesController < ApplicationController
before_filter :authorize, :except => [ :show ]
before_action :authorize, :except => [ :show ]
def index
@event_types = EventType.all
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class EventsController < ApplicationController
before_filter :authorize, :except => [ :show ]
before_action :authorize, :except => [ :show ]
def index
@passed_events = Event.reverse_chronology.visible.passed
......
......@@ -21,5 +21,5 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class HelpController < ApplicationController
before_filter :authorize
before_action :authorize
end
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class MemberGroupsController < ApplicationController
before_filter :authorize, :except => [:show, :filter_members]
before_action :authorize, :except => [:show, :filter_members]
def show
prepare_markers
......
......@@ -21,8 +21,8 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class MembersController < ApplicationController
before_filter :authorize, except: [:show, :edit, :update]
skip_before_filter :check_new_member, only: [:edit, :update]
before_action :authorize, except: [:show, :edit, :update]
skip_before_action :check_new_member, only: [:edit, :update]
def index
respond_to do |format|
......@@ -162,7 +162,7 @@ class MembersController < ApplicationController
success, errors = [], []
@member.contacts.each do |contact|
begin
Mailer.reset_password(@member, contact.email).deliver
Mailer.reset_password(@member, contact.email).deliver_later
success << contact.email
rescue Exception => e
errors << "#{contact.email} (#{e.message})"
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class MenusController < ApplicationController
before_filter :authorize
before_action :authorize
def new
@menu = Menu.new
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class NewsletterItemsController < ApplicationController
before_filter :authorize
before_action :authorize
def move_up
@item = NewsletterItem.find(params[:id])
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class NewslettersController < ApplicationController
before_filter :authorize, except: [:index, :show]
before_action :authorize, except: [:index, :show]
def index
@newsletters = admin? ? Newsletter.ordered : Newsletter.ordered.published
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class NovelTypesController < ApplicationController
before_filter :authorize
before_action :authorize
def show
@novel_type = NovelType.find(params[:id])
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class NovelsController < ApplicationController
before_filter :authorize, :except => [:public_index, :show, :feed]
before_action :authorize, :except => [:public_index, :show, :feed]
def public_index
@novels = Novel.public_ones.without_templates.paginate(page: params[:page])
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class PagesController < ApplicationController
before_filter :authorize, :except => [ :show ]
before_action :authorize, :except => [ :show ]
def index
@menus = Menu.all
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class PartnersController < ApplicationController
before_filter :authorize, except: :display
before_action :authorize, except: :display
def index
@partners_groups = PartnersGroup.includes(:partners)
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class PartnersGroupsController < ApplicationController
before_filter :authorize
before_action :authorize
def new
@partners_group = PartnersGroup.new
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class PublicTypesController < ApplicationController
before_filter :authorize
before_action :authorize
def index
@public_types = PublicType.all
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class SettingsController < ApplicationController
before_filter :authorize
before_action :authorize
def edit
@settings = settings
......
#
# OLIGAA - Stands for "Outil en Ligne d'Information et de Gestion des Activités
# des Associations" which is an online tool for associations to manage news,
# actors and activities.
# Copyright (C) 2010-2016 Comité Départemental du Sport Adapté de la Gironde (CDSA
# 33) <contact@cdsa33.org>
#
# This file is part of OLIGAA.
#
# OLIGAA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OLIGAA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ApplicationJob < ActiveJob::Base
end
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Activity < ActiveRecord::Base
class Activity < ApplicationRecord
has_and_belongs_to_many :activity_categories, :join_table => :activities_cats
has_and_belongs_to_many :events
has_and_belongs_to_many :members
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ActivityCategory < ActiveRecord::Base
class ActivityCategory < ApplicationRecord
include URLEncoding
has_and_belongs_to_many :activities, :join_table => :activities_cats
......
#
# OLIGAA - Stands for "Outil en Ligne d'Information et de Gestion des Activités
# des Associations" which is an online tool for associations to manage news,
# actors and activities.
# Copyright (C) 2010-2016 Comité Départemental du Sport Adapté de la Gironde (CDSA
# 33) <contact@cdsa33.org>
#
# This file is part of OLIGAA.
#
# OLIGAA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OLIGAA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class AttachedFile < ActiveRecord::Base
class AttachedFile < ApplicationRecord
belongs_to :attachable, :polymorphic => true
has_attached_file :file
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Contact < ActiveRecord::Base
class Contact < ApplicationRecord
has_many :phone_numbers, :dependent => :destroy
accepts_nested_attributes_for :phone_numbers, :allow_destroy => true
belongs_to :member
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class ContactType < ActiveRecord::Base
class ContactType < ApplicationRecord
has_many :contacts, :dependent => :nullify
validates_presence_of :title
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Email < ActiveRecord::Base
class Email < ApplicationRecord
attr_accessor :recipients_by_contact_types
attr_accessor :other_recipients_enabled
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Event < ActiveRecord::Base
class Event < ApplicationRecord
belongs_to :event_type
has_many :attached_files, :as => :attachable, :dependent => :destroy
accepts_nested_attributes_for :attached_files, :allow_destroy => true
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class EventType < ActiveRecord::Base
class EventType < ApplicationRecord
has_many :events
validates_presence_of :title
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Image < ActiveRecord::Base
class Image < ApplicationRecord
belongs_to :imageable, :polymorphic => true
has_attached_file :img_file,
:styles => { :thumb => "160x120^", :large => "1280x960>" },
......
......@@ -20,7 +20,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
#
class Logo < ActiveRecord::Base