From 4e076c32eedcc9301fbed2d0ed46c951f8621b9f Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 9 Sep 2020 16:25:34 +0200 Subject: [PATCH] using bootsrap-sass + erb fixes --- app/frontend/packs/application.js | 11 +-- app/frontend/packs/application.scss | 2 +- .../src/javascript/controllers/events.js.erb | 2 +- .../stylesheets/bootstrap_and_overrides.scss | 76 +++++++++---------- .../admin/open_api_clients/index.html.erb | 2 + .../shared/{header.html.erb => header.html} | 2 +- package.json | 2 +- yarn.lock | 10 +-- 8 files changed, 55 insertions(+), 52 deletions(-) rename app/frontend/templates/shared/{header.html.erb => header.html} (96%) diff --git a/app/frontend/packs/application.js b/app/frontend/packs/application.js index b8f413062..39f43e015 100644 --- a/app/frontend/packs/application.js +++ b/app/frontend/packs/application.js @@ -3,7 +3,7 @@ import 'regenerator-runtime/runtime'; import 'jquery'; import 'jquery_ujs'; -import 'bootstrap'; +import 'bootstrap-sass'; import 'polyfill'; import 'angular'; import 'angular-cookies'; @@ -70,11 +70,12 @@ import 'angular-ui-tour/dist/angular-ui-tour'; import '../src/javascript/app.js'; import '../src/javascript/router.js.erb'; -import '../src/javascript/controllers/*'; -import '../src/javascript/services/*'; -import '../src/javascript/directives/*'; -import '../src/javascript/filters/*'; import '../src/javascript/plugins.js.erb'; +require.context('../src/javascript/controllers/', true, /.*/); +require.context('../src/javascript/services/', true, /.*/); +require.context('../src/javascript/directives/', true, /.*/); +require.context('../src/javascript/filters/', true, /.*/); + require.context('../images', true); require.context('../templates', true); diff --git a/app/frontend/packs/application.scss b/app/frontend/packs/application.scss index f24c3331e..23738d3fc 100644 --- a/app/frontend/packs/application.scss +++ b/app/frontend/packs/application.scss @@ -6,7 +6,7 @@ @import '~angular-xeditable/dist/css/xeditable'; @import '~angular-loading-bar/build/loading-bar'; @import '~nvd3/build/nv.d3'; -@import '~font-awesome'; +@import '~font-awesome/css/font-awesome'; @import '~medium-editor/dist/css/medium-editor'; @import '~medium-editor/dist/css/themes/default'; @import '~bootstrap-switch/dist/css/bootstrap3/bootstrap-switch'; diff --git a/app/frontend/src/javascript/controllers/events.js.erb b/app/frontend/src/javascript/controllers/events.js.erb index 6f6e23b58..1ae7ebfb6 100644 --- a/app/frontend/src/javascript/controllers/events.js.erb +++ b/app/frontend/src/javascript/controllers/events.js.erb @@ -42,7 +42,7 @@ Application.Controllers.controller('EventsController', ['$scope', '$state', 'Eve age_range_id: null }; - $scope.monthNames = [<%= t('date.month_names')[1..-1].map { |m| "\"#{m}\"" }.join(', ') %>]; + $scope.monthNames = [<%= I18n.t('date.month_names')[1..-1].map { |m| "\"#{m}\"" }.join(', ') %>]; /** * Adds a resultset of events to the bottom of the page, grouped by month diff --git a/app/frontend/src/stylesheets/bootstrap_and_overrides.scss b/app/frontend/src/stylesheets/bootstrap_and_overrides.scss index a356d9073..db5e73739 100644 --- a/app/frontend/src/stylesheets/bootstrap_and_overrides.scss +++ b/app/frontend/src/stylesheets/bootstrap_and_overrides.scss @@ -1032,51 +1032,51 @@ $hr-border: $gray-lighter !default; // Core variables and mixins // @import "bootstrap/variables"; //overrides -@import "bootstrap/mixins"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/mixins"; // Reset and dependencies -@import "bootstrap/normalize"; -@import "bootstrap/print"; -@import "bootstrap/glyphicons"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/normalize"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/print"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/glyphicons"; // Core CSS -@import "bootstrap/scaffolding"; -@import "bootstrap/type"; -@import "bootstrap/code"; -@import "bootstrap/grid"; -@import "bootstrap/tables"; -@import "bootstrap/forms"; -@import "bootstrap/buttons"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/scaffolding"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/type"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/code"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/grid"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/tables"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/forms"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/buttons"; // Components -@import "bootstrap/component-animations"; -@import "bootstrap/dropdowns"; -@import "bootstrap/button-groups"; -@import "bootstrap/input-groups"; -@import "bootstrap/navs"; -@import "bootstrap/navbar"; -@import "bootstrap/breadcrumbs"; -@import "bootstrap/pagination"; -@import "bootstrap/pager"; -@import "bootstrap/labels"; -@import "bootstrap/badges"; -@import "bootstrap/jumbotron"; -@import "bootstrap/thumbnails"; -@import "bootstrap/alerts"; -@import "bootstrap/progress-bars"; -@import "bootstrap/media"; -@import "bootstrap/list-group"; -@import "bootstrap/panels"; -@import "bootstrap/responsive-embed"; -@import "bootstrap/wells"; -@import "bootstrap/close"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/component-animations"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/dropdowns"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/button-groups"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/input-groups"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/navs"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/navbar"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/breadcrumbs"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/pagination"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/pager"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/labels"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/badges"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/jumbotron"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/thumbnails"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/alerts"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/progress-bars"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/media"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/list-group"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/panels"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/responsive-embed"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/wells"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/close"; // Components w/ JavaScript -@import "bootstrap/modals"; -@import "bootstrap/tooltip"; -@import "bootstrap/popovers"; -@import "bootstrap/carousel"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/modals"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/tooltip"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/popovers"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/carousel"; // Utility classes -@import "bootstrap/utilities"; -@import "bootstrap/responsive-utilities"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/utilities"; +@import "~bootstrap-sass/assets/stylesheets/bootstrap/responsive-utilities"; diff --git a/app/frontend/templates/admin/open_api_clients/index.html.erb b/app/frontend/templates/admin/open_api_clients/index.html.erb index e54beae97..e22f785b0 100644 --- a/app/frontend/templates/admin/open_api_clients/index.html.erb +++ b/app/frontend/templates/admin/open_api_clients/index.html.erb @@ -1,3 +1,5 @@ +<% include Rails.application.routes.url_helpers %> +
diff --git a/app/frontend/templates/shared/header.html.erb b/app/frontend/templates/shared/header.html similarity index 96% rename from app/frontend/templates/shared/header.html.erb rename to app/frontend/templates/shared/header.html index 3d48ecbc6..ba4d6026a 100644 --- a/app/frontend/templates/shared/header.html.erb +++ b/app/frontend/templates/shared/header.html @@ -3,7 +3,7 @@ {{logo.custom_asset_file_attributes.attachment}} - <%= raw "" if Rails.env.staging? %> +