diff --git a/Gemfile b/Gemfile index 255f5d9e..82ee274f 100644 --- a/Gemfile +++ b/Gemfile @@ -112,7 +112,6 @@ group :development, :test, :assets do # Turbolinks makes following links in your web application # faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' - gem 'jquery-turbolinks' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', group: :doc diff --git a/Gemfile.lock b/Gemfile.lock index 1687e8c4..7f72256e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview-encoded_mail_to (1.0.7) rails - activeadmin (1.0.0.pre2) + activeadmin (1.0.0.pre3) arbre (~> 1.0, >= 1.0.2) bourbon coffee-rails @@ -59,6 +59,7 @@ GEM rails (>= 3.2, < 5.0) ransack (~> 1.3) sass-rails + sprockets (< 4) activeadmin_pagedown (0.0.2) activeadmin (>= 0.5.0) activejob (4.2.6) @@ -90,11 +91,11 @@ GEM buftok (0.2.0) builder (3.2.2) byebug (9.0.5) - chunky_png (1.3.5) + chunky_png (1.3.6) coderay (1.1.1) - coffee-rails (4.1.1) + coffee-rails (4.2.1) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.1.x) + railties (>= 4.0.0, < 5.2.x) coffee-script (2.4.1) coffee-script-source execjs @@ -222,9 +223,6 @@ GEM rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-turbolinks (2.1.0) - railties (>= 3.1.0) - turbolinks jquery-ui-rails (5.0.5) railties (>= 3.2.16) json (1.8.3) @@ -267,7 +265,7 @@ GEM nenv (~> 0.1) shellany (~> 0.0) orm_adapter (0.5.0) - paper_trail (5.1.1) + paper_trail (5.2.0) activerecord (>= 3.0, < 6.0) activesupport (>= 3.0, < 6.0) request_store (~> 1.1) @@ -333,8 +331,8 @@ GEM request_store (1.3.1) responders (2.2.0) railties (>= 4.2.0, < 5.1) - rubocop (0.40.0) - parser (>= 2.3.1.0, < 3.0) + rubocop (0.41.1) + parser (>= 2.3.1.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) @@ -367,10 +365,10 @@ GEM simplecov-html (0.10.0) slop (3.6.0) spring (1.7.1) - sprockets (3.6.0) + sprockets (3.6.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.0.4) + sprockets-rails (3.1.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) @@ -388,8 +386,9 @@ GEM railties (>= 3.1.1) tinymce-rails-langs (4.20160310) tinymce-rails (~> 4.1, >= 4.1.10) - turbolinks (2.5.3) - coffee-rails + turbolinks (5.0.0) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) twitter (5.16.0) addressable (~> 2.3) buftok (~> 0.2.0) @@ -408,7 +407,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.2) - unicode-display_width (1.0.5) + unicode-display_width (1.1.0) warden (1.2.6) rack (>= 1.0) web-console (3.3.0) @@ -450,7 +449,6 @@ DEPENDENCIES jbuilder jquery-rails (< 4.1) jquery-sparkline-rails! - jquery-turbolinks leaflet-markercluster-rails leaflet-rails meta-tags diff --git a/app/admin/dashboard.rb b/app/admin/dashboard.rb index 0d64deff..22c99991 100644 --- a/app/admin/dashboard.rb +++ b/app/admin/dashboard.rb @@ -26,10 +26,8 @@ ActiveAdmin.register_page 'Dashboard' do end panel 'Git' do - para %(Actuellement: - #{link_to(`git rev-parse --short HEAD`, - '//git.framasoft.org/agenda-libre/agenda-libre-ruby')}) - .html_safe + link_to(`git log -n 1 --oneline`, + '//git.framasoft.org/agenda-libre/agenda-libre-ruby') end end end diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 40b506e2..ad979f22 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -13,7 +13,6 @@ #= require jquery #= require jquery_ujs #= require jquery.sparkline -#= require jquery.turbolinks #= require turbolinks #= require tinymce-jquery #= require modernizr @@ -34,18 +33,10 @@ $.webshims.setOptions 'forms-ext', 'classes': 'show-yearbtns hide-btnrow show-uparrow' $.webshims.polyfill 'forms forms-ext' -Turbolinks.enableProgressBar() - -$(document).on 'page:fetch submit', -> - $('em#loading').fadeIn('slow') -$(document).on 'page:change ready', -> - $('em#loading').fadeOut('slow') - -$(document).on 'page:load', -> +$(document).on 'turbolinks:load', -> # Reload polyfill when turbolinks loads a new page $(this).updatePolyfill() -$(document).ready -> # Hides the chrome broken image when image is absent if !Modernizr.testAllProps('forceBrokenImageIcon') $('img.favicon').one 'error', -> diff --git a/app/assets/javascripts/events.js.coffee b/app/assets/javascripts/events.js.coffee index 7c52ce26..0eec6a1f 100644 --- a/app/assets/javascripts/events.js.coffee +++ b/app/assets/javascripts/events.js.coffee @@ -1,4 +1,4 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> # Manage event tags edition $('#event_tags').each -> elt = $(this) diff --git a/app/assets/javascripts/flash.js.coffee b/app/assets/javascripts/flash.js.coffee index 90fff30e..0c501091 100644 --- a/app/assets/javascripts/flash.js.coffee +++ b/app/assets/javascripts/flash.js.coffee @@ -1 +1 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> diff --git a/app/assets/javascripts/list.js.coffee b/app/assets/javascripts/list.js.coffee index 90fff30e..0c501091 100644 --- a/app/assets/javascripts/list.js.coffee +++ b/app/assets/javascripts/list.js.coffee @@ -1 +1 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> diff --git a/app/assets/javascripts/maps.js.coffee b/app/assets/javascripts/maps.js.coffee index ad553f7b..0acc2e50 100644 --- a/app/assets/javascripts/maps.js.coffee +++ b/app/assets/javascripts/maps.js.coffee @@ -1,5 +1,5 @@ # Setting up OpenStreeMap from a generic #map element -$(document).ready -> +$(document).on 'turbolinks:load', -> markerColors = ['blue', 'red', 'darkred', 'orange', 'green', 'darkgreen', 'purple', 'darkpuple', 'cadetblue'] idx = 0 $('#map.list').each -> diff --git a/app/assets/javascripts/moderations.js.coffee b/app/assets/javascripts/moderations.js.coffee index 773aa17c..27909538 100644 --- a/app/assets/javascripts/moderations.js.coffee +++ b/app/assets/javascripts/moderations.js.coffee @@ -1,5 +1,5 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> $('body.moderations .field.closer input[type=radio]').click -> - $('body.moderations #event_reason_text').parent().slideUp() + $('body.moderations #event_reason').parent().slideUp() $('body.moderations .field.opener input[type=radio]').click -> - $('body.moderations #event_reason_text').parent().slideDown() + $('body.moderations #event_reason').parent().slideDown() diff --git a/app/assets/javascripts/orgas.js.coffee b/app/assets/javascripts/orgas.js.coffee index 7da46595..e1ff5929 100644 --- a/app/assets/javascripts/orgas.js.coffee +++ b/app/assets/javascripts/orgas.js.coffee @@ -1,4 +1,4 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> # Manage orga tags edition $('#orga_tags').each -> elt = $(this) diff --git a/app/assets/javascripts/pagination.coffee b/app/assets/javascripts/pagination.coffee index cf81b33d..9af690b5 100644 --- a/app/assets/javascripts/pagination.coffee +++ b/app/assets/javascripts/pagination.coffee @@ -2,7 +2,7 @@ # To not setup pagination twice pager = true -$(document).ready -> +$(document).on 'turbolinks:load', -> $('.pagination .next a') .attr('data-remote', true) .click -> diff --git a/app/assets/javascripts/stats.js.coffee b/app/assets/javascripts/stats.js.coffee index ce87433d..220ec4f5 100644 --- a/app/assets/javascripts/stats.js.coffee +++ b/app/assets/javascripts/stats.js.coffee @@ -1,4 +1,4 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> # Sparline generation along the data tables $('table.list.dates tbody tr').each -> vals = $(this).find('td.quantity').map -> diff --git a/app/assets/javascripts/tinymce.coffee.erb b/app/assets/javascripts/tinymce.coffee.erb index 260a14a8..ebe0601b 100644 --- a/app/assets/javascripts/tinymce.coffee.erb +++ b/app/assets/javascripts/tinymce.coffee.erb @@ -1,4 +1,4 @@ -$(document).ready -> +$(document).on 'turbolinks:load', -> # Setup the graphical editor for event's description tinyMCE.init schema: 'html5', @@ -22,6 +22,6 @@ $(document).ready -> preview, table, fullscreen, searchreplace, media, insertdatetime, visualblocks, visualchars, wordcount, contextmenu, code' -$(document).on 'page:receive', -> +$(document).on 'turbolinks:before-cache', -> # Delete existing tinymce editors, very important in the turbolinks context! tinymce.remove() diff --git a/app/mailers/event_mailer.rb b/app/mailers/event_mailer.rb index 1661ae98..e8d213e8 100644 --- a/app/mailers/event_mailer.rb +++ b/app/mailers/event_mailer.rb @@ -14,7 +14,7 @@ class EventMailer < ApplicationMailer def accept(event) @event = event - @current_user = User.find_by id: event.paper_trail_originator + @current_user = User.find_by id: event.paper_trail.originator mail 'In-Reply-To' => "", @@ -25,7 +25,7 @@ class EventMailer < ApplicationMailer def destroy(event) @event = event - @current_user = User.find_by id: event.paper_trail_originator + @current_user = User.find_by id: event.paper_trail.originator mail 'In-Reply-To' => "", diff --git a/app/mailers/moderation_mailer.rb b/app/mailers/moderation_mailer.rb index 694cbfd3..dafc3fec 100644 --- a/app/mailers/moderation_mailer.rb +++ b/app/mailers/moderation_mailer.rb @@ -13,7 +13,7 @@ class ModerationMailer < ApplicationMailer def update(event) @event = event - @current_user = User.find_by id: event.paper_trail_originator + @current_user = User.find_by id: event.paper_trail.originator mail 'In-Reply-To' => "", @@ -23,7 +23,7 @@ class ModerationMailer < ApplicationMailer def accept(event) @event = event - @current_user = User.find_by id: event.paper_trail_originator + @current_user = User.find_by id: event.paper_trail.originator mail 'In-Reply-To' => "", @@ -33,7 +33,7 @@ class ModerationMailer < ApplicationMailer def destroy(event) @event = event - @current_user = User.find_by id: event.paper_trail_originator + @current_user = User.find_by id: event.paper_trail.originator mail 'In-Reply-To' => "", diff --git a/app/mailers/orga_mailer.rb b/app/mailers/orga_mailer.rb index 65823018..a4b5ec85 100644 --- a/app/mailers/orga_mailer.rb +++ b/app/mailers/orga_mailer.rb @@ -24,7 +24,7 @@ class OrgaMailer < ApplicationMailer # def update(orga) @orga = orga - @current_user = User.find_by id: orga.paper_trail_originator + @current_user = User.find_by id: orga.paper_trail.originator mail 'Message-ID' => "", @@ -40,7 +40,7 @@ class OrgaMailer < ApplicationMailer # def accept(orga) @orga = orga - @current_user = User.find_by id: orga.paper_trail_originator + @current_user = User.find_by id: orga.paper_trail.originator mail 'In-Reply-To' => "", @@ -56,7 +56,7 @@ class OrgaMailer < ApplicationMailer # def destroy(orga, reason = '') @orga = orga - @current_user = User.find_by id: orga.paper_trail_originator + @current_user = User.find_by id: orga.paper_trail.originator @reason = reason mail 'In-Reply-To' => diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index fc12d9b2..906192a5 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -77,5 +77,3 @@ = link_to moderations_path do %em.fa.fa-gavel = t '.moderation' - - %em.fa.fa-spin.fa-circle-o-notch#loading diff --git a/app/views/moderation_mailer/update.text.haml b/app/views/moderation_mailer/update.text.haml index dfdb36b6..b3ac82f6 100644 --- a/app/views/moderation_mailer/update.text.haml +++ b/app/views/moderation_mailer/update.text.haml @@ -4,7 +4,7 @@ new = render file: '/events/show' former = @event - @event = @event.previous_version if @event.previous_version + @event = @event.paper_trail.previous_version || @event prev = render file: '/events/show' @event = former diff --git a/app/views/orga_mailer/update.text.haml b/app/views/orga_mailer/update.text.haml index 8b430ab7..9a60dca9 100644 --- a/app/views/orga_mailer/update.text.haml +++ b/app/views/orga_mailer/update.text.haml @@ -4,7 +4,7 @@ new = render file: '/orgas/show' former = @orga - @orga = @orga.previous_version + @orga = @orga.paper_trail.previous_version prev = render file: '/orgas/show' @orga = former