diff --git a/Gemfile b/Gemfile index b8a1687..7e4c5b1 100644 --- a/Gemfile +++ b/Gemfile @@ -7,12 +7,12 @@ gem 'puma' ## DATABASES ## gem 'mysql2' -## JAVASCRIPT AND JSON -gem "importmap-rails" - -## CSS ## +## JAVASCRIPT/CSS ## gem 'bootstrap' gem "sassc-rails" +gem 'sprockets-rails' +gem 'jquery-rails' +gem 'jquery-ui-rails' ## TOOLS AND UTILITIES gem 'simple_form' diff --git a/Gemfile.lock b/Gemfile.lock index 035e926..698806d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -158,10 +158,12 @@ GEM rack (>= 2.0, < 4) i18n (1.14.6) concurrent-ruby (~> 1.0) - importmap-rails (2.0.3) - actionpack (>= 6.0.0) - activesupport (>= 6.0.0) - railties (>= 6.0.0) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (7.0.0) + railties (>= 3.2.16) json (2.8.2) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -359,7 +361,8 @@ DEPENDENCIES factory_bot_rails guard-minitest httparty - importmap-rails + jquery-rails + jquery-ui-rails listen mimemagic minitest @@ -375,6 +378,7 @@ DEPENDENCIES shoulda-matchers simple_form sinatra + sprockets-rails sqlite3 (~> 1.4) sucker_punch (~> 2.0) tzinfo-data diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index ddd546a..a6ea8c1 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,4 +1,4 @@ //= link_tree ../images +//= link_directory ../javascripts .js //= link_directory ../stylesheets .css -//= link_tree ../../javascript .js -//= link_tree ../../../vendor/javascript .js +//= link_directory ../stylesheets .scss diff --git a/app/javascript/application.js b/app/assets/javascripts/application.js similarity index 53% rename from app/javascript/application.js rename to app/assets/javascripts/application.js index 722cfc8..da4506b 100644 --- a/app/javascript/application.js +++ b/app/assets/javascripts/application.js @@ -1,13 +1,25 @@ -// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails -import "bootstrap"; -import "jquery"; -import "datepicker"; +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery3 +//= require popper +//= require bootstrap +//= require rails-ujs +//= require jquery-ui +//= require_self -import Rails from '@rails/ujs'; -Rails.start(); $(document).ready(function () { - $('.datepicker').datepicker(); + $('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' }); if ($('#overview_fees_container').length > 0) { $.ajax({ diff --git a/app/assets/stylesheets/_datepicker.scss b/app/assets/stylesheets/_datepicker.scss new file mode 100644 index 0000000..9547ffc --- /dev/null +++ b/app/assets/stylesheets/_datepicker.scss @@ -0,0 +1 @@ +@import "jquery-ui/datepicker.css"; diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 36c18c5..3528521 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -13,12 +13,10 @@ *= require_tree . *= require_self */ + @import "_theme_variables"; @import "bootstrap"; -@import "_navbar"; -@import "_login"; - body { background: #fffefe; } @@ -42,4 +40,4 @@ body { a:hover { text-decoration: none; } -} \ No newline at end of file +} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 64ed717..7584e6e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,13 +2,13 @@