From e1be3b8a95660b6bd70afc162d086723a79570bf Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Tue, 5 Jan 2021 19:29:36 +0200 Subject: [PATCH] Fix the jquery-ui datepicker i18n files' asset compilation --- app/assets/javascripts/application.js | 8 ++++++++ app/helpers/application_helper.rb | 8 ++++---- test/controllers/todos_controller_test.rb | 10 +++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 113fc78d..7fd121ab 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -20,6 +20,14 @@ //= require jquery-ui/widgets/droppable //= require jquery-ui/effects/effect-highlight //= require jquery-ui/widgets/sortable +//= require jquery-ui/i18n/datepicker-cs +//= require jquery-ui/i18n/datepicker-de +//= require jquery-ui/i18n/datepicker-es +//= require jquery-ui/i18n/datepicker-fi +//= require jquery-ui/i18n/datepicker-fr +//= require jquery-ui/i18n/datepicker-he +//= require jquery-ui/i18n/datepicker-nl +//= require jquery-ui/i18n/datepicker-ru // Stuff in app/assets //= require tracks diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index baa0cdb6..a3a0d3d2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -165,11 +165,11 @@ module ApplicationHelper end def javascript_tag_for_i18n_datepicker - locale = I18n.locale +# locale = I18n.locale # do not include en as locale since this the available by default - if locale && locale != :en - javascript_include_tag("jquery-ui/datepicker-#{locale}") - end +# if locale && locale != :en +# javascript_include_tag("jquery-ui/i18n/datepicker-#{locale}") +# end end def done_path(controller_name, type) diff --git a/test/controllers/todos_controller_test.rb b/test/controllers/todos_controller_test.rb index 3450eccc..806a2cf2 100644 --- a/test/controllers/todos_controller_test.rb +++ b/test/controllers/todos_controller_test.rb @@ -6,16 +6,16 @@ class TodosControllerTest < ActionController::TestCase assert_redirected_to login_url end - ############################ - # not done / deferred counts - ############################ - def test_locale_index login_as(:other_user_email) get :index - asser_response 200 + assert_response 200 end + ############################ + # not done / deferred counts + ############################ + def test_not_done_counts login_as(:admin_user) get :index