diff --git a/app/frontend/packs/application.js b/app/frontend/packs/application.js index a7d3f5ec4..ae09dc633 100644 --- a/app/frontend/packs/application.js +++ b/app/frontend/packs/application.js @@ -77,5 +77,5 @@ importAll(require.context('../src/javascript/services/', true, /.*/)); importAll(require.context('../src/javascript/directives/', true, /.*/)); importAll(require.context('../src/javascript/filters/', true, /.*/)); -require.context('../images', true); -require.context('../templates', true); +importAll(require.context('../images', true)); +importAll(require.context('../templates', true)); diff --git a/app/frontend/packs/locale.js.erb b/app/frontend/packs/locale.js.erb index 4319f43c4..5ac89190d 100644 --- a/app/frontend/packs/locale.js.erb +++ b/app/frontend/packs/locale.js.erb @@ -3,8 +3,8 @@ import 'angular-i18n/angular-locale_<%= Rails.application.secrets.angular_locale import 'moment/locale/<%= Rails.application.secrets.moment_locale %>.js'; <% end %> <% if Rails.application.secrets.summernote_locale != 'en-US' %> -import 'summernote/lang/summernote-<%= Rails.application.secrets.summernote_locale %>.js'; +// import 'summernote/lang/summernote-<%#= Rails.application.secrets.summernote_locale %>.js'; <% end %> <% if Rails.application.secrets.fullcalendar_locale != 'en' %> -import 'fullcalendar/dist/lang/<%= Rails.application.secrets.fullcalendar_locale %>.js'; +// import 'fullcalendar/dist/lang/<%#= Rails.application.secrets.fullcalendar_locale %>.js'; <% end %> diff --git a/app/frontend/src/javascript/controllers/admin/authentications.js b/app/frontend/src/javascript/controllers/admin/authentications.js index bc249f57b..737920172 100644 --- a/app/frontend/src/javascript/controllers/admin/authentications.js +++ b/app/frontend/src/javascript/controllers/admin/authentications.js @@ -87,7 +87,7 @@ class AuthenticationController { */ $scope.defineDataMapping = function (mapping) { $uibModal.open({ - templateUrl: 'admin/authentications/_data_mapping.html', + template: require('../../../../templates/admin/authentications/_data_mapping.html'), size: 'md', resolve: { field () { return mapping; }, diff --git a/app/frontend/src/javascript/controllers/admin/calendar.js b/app/frontend/src/javascript/controllers/admin/calendar.js index 07c21c41f..faf33ddba 100644 --- a/app/frontend/src/javascript/controllers/admin/calendar.js +++ b/app/frontend/src/javascript/controllers/admin/calendar.js @@ -273,7 +273,7 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state // open a confirmation dialog const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'admin/calendar/deleteRecurrent.html', + template: require('../../../../templates/admin/calendar/deleteRecurrent.html'), size: 'md', controller: 'DeleteRecurrentAvailabilityController', resolve: { @@ -419,7 +419,7 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state // then we open a modal window to let the admin specify the slot type const modalInstance = $uibModal.open({ - templateUrl: 'admin/calendar/eventModal.html', + template: require('../../../../templates/admin/calendar/eventModal.html'), controller: 'CreateEventModalController', backdrop: 'static', keyboard: false, diff --git a/app/frontend/src/javascript/controllers/admin/events.js b/app/frontend/src/javascript/controllers/admin/events.js index d43c31882..00c28b574 100644 --- a/app/frontend/src/javascript/controllers/admin/events.js +++ b/app/frontend/src/javascript/controllers/admin/events.js @@ -279,7 +279,7 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', */ $scope.newPriceCategory = function () { $uibModal.open({ - templateUrl: 'admin/events/price_form.html', + template: require('../../../../templates/admin/events/price_form.html'), size: 'md', resolve: { category () { return {}; } @@ -307,7 +307,7 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', return growl.error(_t('app.admin.events.unexpected_error_occurred_please_refresh')); } else { return $uibModal.open({ - templateUrl: 'admin/events/price_form.html', + template: require('../../../../templates/admin/events/price_form.html'), size: 'md', resolve: { category () { return $scope.priceCategories[index]; } @@ -645,7 +645,7 @@ Application.Controllers.controller('EditEventController', ['$scope', '$state', ' // open a choice edit-mode dialog const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'events/editRecurrent.html', + template: require('../../../../templates/events/editRecurrent.html'), size: 'md', controller: 'EditRecurrentEventController', resolve: { diff --git a/app/frontend/src/javascript/controllers/admin/invoices.js b/app/frontend/src/javascript/controllers/admin/invoices.js index 64a42735d..c5e267f30 100644 --- a/app/frontend/src/javascript/controllers/admin/invoices.js +++ b/app/frontend/src/javascript/controllers/admin/invoices.js @@ -58,7 +58,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I prefix: settings.invoice_prefix, nextId: 40, date: moment().format('DDMMYYYY'), - templateUrl: 'editPrefix.html' + template: require('../../../../templates/editPrefix.html') } // Invoices parameters @@ -67,22 +67,22 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I reference: { model: '', help: null, - templateUrl: 'editReference.html' + template: require('../../../../templates/editReference.html') }, code: { model: '', active: true, - templateUrl: 'editCode.html' + template: require('../../../../templates/editCode.html') }, number: { model: '', help: null, - templateUrl: 'editNumber.html' + template: require('../../../../templates/editNumber.html') }, VAT: { rate: 19.6, active: false, - templateUrl: 'editVAT.html' + template: require('../../../../templates/editVAT.html') }, text: { content: '' @@ -220,7 +220,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I $scope.generateAvoirForInvoice = function (invoice) { // open modal const modalInstance = $uibModal.open({ - templateUrl: 'admin/invoices/avoirModal.html', + template: require('../../../../templates/admin/invoices/avoirModal.html'), controller: 'AvoirModalController', resolve: { invoice () { return invoice; }, @@ -579,7 +579,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I $scope.closeAnAccountingPeriod = function() { // open modal $uibModal.open({ - templateUrl: 'admin/invoices/closePeriodModal.html', + template: require('../../../../templates/admin/invoices/closePeriodModal.html'), controller: 'ClosePeriodModalController', backdrop: 'static', keyboard: false, @@ -593,7 +593,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I $scope.toggleExportModal = function() { $uibModal.open({ - templateUrl: 'admin/invoices/accountingExportModal.html', + template: require('../../../../templates/admin/invoices/accountingExportModal.html'), controller: 'AccountingExportModalController', size: 'xl' }); @@ -647,7 +647,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I // otherwise, open a modal to ask for the stripe keys const modalInstance = $uibModal.open({ - templateUrl: 'stripeKeys.html', + template: require('../../../../templates/stripeKeys.html'), controller: 'StripeKeysModalController', resolve: { stripeKeys: ['Setting', function (Setting) { return Setting.query({ names: "['stripe_public_key', 'stripe_secret_key']" }).$promise; }] diff --git a/app/frontend/src/javascript/controllers/admin/members.js b/app/frontend/src/javascript/controllers/admin/members.js index 13b229326..89f385180 100644 --- a/app/frontend/src/javascript/controllers/admin/members.js +++ b/app/frontend/src/javascript/controllers/admin/members.js @@ -236,7 +236,7 @@ Application.Controllers.controller('AdminMembersController', ['$scope', '$sce', $scope.openPartnerNewModal = function () { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'shared/_partner_new_modal.html', + template: require('../../../../templates/shared/_partner_new_modal.html'), size: 'lg', controller: ['$scope', '$uibModalInstance', 'User', function ($scope, $uibModalInstance, User) { $scope.partner = {}; @@ -702,7 +702,7 @@ Application.Controllers.controller('EditMemberController', ['$scope', '$state', $scope.changeUserRole = function() { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'admin/members/change_role_modal.html', + template: require('../../../../templates/admin/members/change_role_modal.html'), size: 'lg', resolve: { user() { return $scope.user; } @@ -750,7 +750,7 @@ Application.Controllers.controller('EditMemberController', ['$scope', '$state', $scope.updateSubscriptionModal = function (subscription, free) { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'admin/subscriptions/expired_at_modal.html', + template: require('../../../../templates/admin/subscriptions/expired_at_modal.html'), size: 'lg', controller: ['$scope', '$uibModalInstance', 'Subscription', function ($scope, $uibModalInstance, Subscription) { $scope.new_expired_at = angular.copy(subscription.expired_at); @@ -797,7 +797,7 @@ Application.Controllers.controller('EditMemberController', ['$scope', '$state', $scope.createSubscriptionModal = function (user, plans) { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'admin/subscriptions/create_modal.html', + template: require('../../../../templates/admin/subscriptions/create_modal.html'), size: 'lg', controller: ['$scope', '$uibModalInstance', 'Subscription', 'Group', function ($scope, $uibModalInstance, Subscription, Group) { // selected user @@ -845,7 +845,7 @@ Application.Controllers.controller('EditMemberController', ['$scope', '$state', $scope.createWalletCreditModal = function (user, wallet) { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'wallet/credit_modal.html', + template: require('../../../../templates/wallet/credit_modal.html'), controller: ['$scope', '$uibModalInstance', 'Wallet', function ($scope, $uibModalInstance, Wallet) { // default: do not generate a refund invoice $scope.generate_avoir = false; diff --git a/app/frontend/src/javascript/controllers/admin/plans.js b/app/frontend/src/javascript/controllers/admin/plans.js index 9bbb2447b..784afef93 100644 --- a/app/frontend/src/javascript/controllers/admin/plans.js +++ b/app/frontend/src/javascript/controllers/admin/plans.js @@ -106,7 +106,7 @@ Application.Controllers.controller('NewPlanController', ['$scope', '$uibModal', $scope.openPartnerNewModal = function (subscription) { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'shared/_partner_new_modal.html', + template: require('../../../../templates/shared/_partner_new_modal.html'), size: 'lg', controller: ['$scope', '$uibModalInstance', 'User', function ($scope, $uibModalInstance, User) { $scope.partner = {}; diff --git a/app/frontend/src/javascript/controllers/admin/pricing.js b/app/frontend/src/javascript/controllers/admin/pricing.js index e93943a14..a18a0078e 100644 --- a/app/frontend/src/javascript/controllers/admin/pricing.js +++ b/app/frontend/src/javascript/controllers/admin/pricing.js @@ -570,7 +570,7 @@ Application.Controllers.controller('EditPricingController', ['$scope', '$state', */ $scope.sendCouponToUser = function (coupon) { $uibModal.open({ - templateUrl: 'admin/pricing/sendCoupon.html', + template: require('../../../../templates/admin/pricing/sendCoupon.html'), resolve: { coupon () { return coupon; } }, diff --git a/app/frontend/src/javascript/controllers/admin/settings.js b/app/frontend/src/javascript/controllers/admin/settings.js index feb771f27..3c36e3235 100644 --- a/app/frontend/src/javascript/controllers/admin/settings.js +++ b/app/frontend/src/javascript/controllers/admin/settings.js @@ -173,7 +173,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope' $scope.savePrivacyPolicy = function () { // open modal const modalInstance = $uibModal.open({ - templateUrl: 'admin/settings/save_policy.html', + template: require('../../../../templates/admin/settings/save_policy.html'), controller: 'SavePolicyController', resolve: { saveCb () { return $scope.save; }, @@ -274,7 +274,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope' */ $scope.analyticsModal = function() { $uibModal.open({ - templateUrl: 'admin/settings/analyticsModal.html', + template: require('../../../../templates/admin/settings/analyticsModal.html'), controller: 'AnalyticsModalController', size: 'lg', resolve: { diff --git a/app/frontend/src/javascript/controllers/admin/statistics.js b/app/frontend/src/javascript/controllers/admin/statistics.js index adeb71c6f..cd70975c6 100644 --- a/app/frontend/src/javascript/controllers/admin/statistics.js +++ b/app/frontend/src/javascript/controllers/admin/statistics.js @@ -311,7 +311,7 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', */ $scope.exportToExcel = function () { const options = { - templateUrl: 'admin/statistics/export.html', + template: require('../../../../templates/admin/statistics/export.html'), size: 'sm', controller: 'ExportStatisticsController', resolve: { diff --git a/app/frontend/src/javascript/controllers/admin/trainings.js b/app/frontend/src/javascript/controllers/admin/trainings.js index 071c2b45b..a160c2644 100644 --- a/app/frontend/src/javascript/controllers/admin/trainings.js +++ b/app/frontend/src/javascript/controllers/admin/trainings.js @@ -221,7 +221,7 @@ Application.Controllers.controller('TrainingsAdminController', ['$scope', '$stat */ $scope.showReservations = function (training, availability) { $uibModal.open({ - templateUrl: 'admin/trainings/validTrainingModal.html', + template: require('../../../../templates/admin/trainings/validTrainingModal.html'), controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { $scope.availability = availability; diff --git a/app/frontend/src/javascript/controllers/application.js.erb b/app/frontend/src/javascript/controllers/application.js.erb index 126062f6a..1fe8f8f8d 100644 --- a/app/frontend/src/javascript/controllers/application.js.erb +++ b/app/frontend/src/javascript/controllers/application.js.erb @@ -89,7 +89,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco <% else %> return $uibModal.open({ - templateUrl: 'shared/signupModal.html', + template: require('../../../templates/shared/signupModal.html'), size: 'md', resolve: { settingsPromise: ['Setting', function (Setting) { return Setting.query({ names: "['phone_required', 'recaptcha_site_key', 'confirmation_required']" }).$promise; }] @@ -192,7 +192,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco */ $scope.editPassword = function (token) { $uibModal.open({ - templateUrl: 'shared/passwordEditModal.html', + template: require('../../../templates/shared/passwordEditModal.html'), size: 'md', controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { $scope.user = { reset_password_token: token }; @@ -282,7 +282,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco if ($rootScope.currentUser.role !== 'admin') return; $uibModal.open({ - templateUrl: 'admin/versions/upgradeModal.html', + template: require('../../../templates/admin/versions/upgradeModal.html'), controller: 'VersionModalController', resolve: { version() { return $scope.version; } @@ -407,7 +407,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco $window.location.href = '/sso-redirect'; <% else %> return $uibModal.open({ - templateUrl: 'shared/deviseModal.html', + template: require('../../../templates/shared/deviseModal.html'), size: 'sm', resolve: { settingsPromise: ['Setting', function (Setting) { return Setting.query({ names: "['confirmation_required']" }).$promise; }] @@ -470,7 +470,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco } else if (reason === 'resetPassword') { // open the 'reset password' modal return $uibModal.open({ - templateUrl: 'shared/passwordNewModal.html', + template: require('../../../templates/shared/passwordNewModal.html'), size: 'sm', controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { $scope.user = { email: '' }; @@ -488,7 +488,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco } else if (reason === 'confirmationNew') { // open the 'reset password' modal return $uibModal.open({ - templateUrl: 'shared/ConfirmationNewModal.html', + template: require('../../../templates/shared/ConfirmationNewModal.html'), size: 'sm', controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { $scope.user = { email: '' }; diff --git a/app/frontend/src/javascript/controllers/calendar.js b/app/frontend/src/javascript/controllers/calendar.js index 4f60257c5..25e2b5cf8 100644 --- a/app/frontend/src/javascript/controllers/calendar.js +++ b/app/frontend/src/javascript/controllers/calendar.js @@ -106,7 +106,7 @@ Application.Controllers.controller('CalendarController', ['$scope', '$state', '$ $scope.openFilterAside = () => $aside.open({ - templateUrl: 'filterAside.html', + template: require('../../../templates/filterAside.html'), placement: 'right', size: 'md', backdrop: false, diff --git a/app/frontend/src/javascript/controllers/events.js.erb b/app/frontend/src/javascript/controllers/events.js.erb index 1ae7ebfb6..afe25db51 100644 --- a/app/frontend/src/javascript/controllers/events.js.erb +++ b/app/frontend/src/javascript/controllers/events.js.erb @@ -186,7 +186,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' // open a confirmation dialog const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'events/deleteRecurrent.html', + template: require('../../../templates/events/deleteRecurrent.html'), size: 'md', controller: 'DeleteRecurrentEventController', resolve: { @@ -416,7 +416,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' $scope.modifyReservation = function (reservation) { const index = $scope.reservations.indexOf(reservation); return $uibModal.open({ - templateUrl: 'events/modify_event_reservation_modal.html', + template: require('../../../templates/events/modify_event_reservation_modal.html'), resolve: { event () { return $scope.event; }, reservation () { return reservation; } @@ -671,7 +671,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' */ const payByStripe = function (reservation) { $uibModal.open({ - templateUrl: 'stripe/payment_modal.html', + template: require('../../../templates/stripe/payment_modal.html'), size: 'md', resolve: { reservation () { @@ -739,7 +739,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' */ const payOnSite = function (reservation) { $uibModal.open({ - templateUrl: 'shared/valid_reservation_modal.html', + template: require('../../../templates/shared/valid_reservation_modal.html'), size: 'sm', resolve: { reservation () { @@ -858,7 +858,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' const showReserveSlotSameTimeModal = function(sameTimeReservations, callback) { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'shared/_reserve_slot_same_time.html', + template: require('../../../templates/shared/_reserve_slot_same_time.html'), size: 'md', controller: 'ReserveSlotSameTimeController', resolve: { diff --git a/app/frontend/src/javascript/controllers/machines.js.erb b/app/frontend/src/javascript/controllers/machines.js.erb index a0f300b76..ffee03cb5 100644 --- a/app/frontend/src/javascript/controllers/machines.js.erb +++ b/app/frontend/src/javascript/controllers/machines.js.erb @@ -121,7 +121,7 @@ const _reserveMachine = function (machine, e) { // the training before he can book the reservation if (machine.current_user_training_reservation) { return _this.$uibModal.open({ - templateUrl: 'machines/training_reservation_modal.html', + template: require('../../../templates/machines/training_reservation_modal.html'), controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { $scope.machine = machine; return $scope.cancel = function () { $uibModalInstance.dismiss('cancel'); }; @@ -136,7 +136,7 @@ const _reserveMachine = function (machine, e) { // otherwise open the information modal } else { return _this.$uibModal.open({ - templateUrl: 'machines/request_training_modal.html', + template: require('../../../templates/machines/request_training_modal.html'), controller: ['$scope', '$uibModalInstance', '$state', function ($scope, $uibModalInstance, $state) { $scope.machine = machine; $scope.member = _this.$scope.currentUser; diff --git a/app/frontend/src/javascript/controllers/plans.js b/app/frontend/src/javascript/controllers/plans.js index 3e3f84ee2..62fdbdc3a 100644 --- a/app/frontend/src/javascript/controllers/plans.js +++ b/app/frontend/src/javascript/controllers/plans.js @@ -235,7 +235,7 @@ Application.Controllers.controller('PlansIndexController', ['$scope', '$rootScop */ const payByStripe = function () { $uibModal.open({ - templateUrl: 'stripe/payment_modal.html', + template: require('../../../templates/stripe/payment_modal.html'), size: 'md', resolve: { selectedPlan () { return $scope.selectedPlan; }, @@ -299,7 +299,7 @@ Application.Controllers.controller('PlansIndexController', ['$scope', '$rootScop */ const payOnSite = function () { $uibModal.open({ - templateUrl: 'plans/payment_modal.html', + template: require('../../../templates/plans/payment_modal.html'), size: 'sm', resolve: { selectedPlan () { return $scope.selectedPlan; }, diff --git a/app/frontend/src/javascript/controllers/profile.js b/app/frontend/src/javascript/controllers/profile.js index d7ef29777..183be5bab 100644 --- a/app/frontend/src/javascript/controllers/profile.js +++ b/app/frontend/src/javascript/controllers/profile.js @@ -167,7 +167,7 @@ Application.Controllers.controller('CompleteProfileController', ['$scope', '$roo event.stopPropagation(); dialogs.confirm( { - templateUrl: 'profile/resend_code_modal.html', + template: require('../../../templates/profile/resend_code_modal.html'), resolve: { object () { return { email: memberPromise.email }; diff --git a/app/frontend/src/javascript/controllers/projects.js b/app/frontend/src/javascript/controllers/projects.js index a05103df4..6da57938e 100644 --- a/app/frontend/src/javascript/controllers/projects.js +++ b/app/frontend/src/javascript/controllers/projects.js @@ -587,7 +587,7 @@ Application.Controllers.controller('ShowProjectController', ['$scope', '$state', if (e) { e.preventDefault(); } $uibModal.open({ - templateUrl: 'shared/signalAbuseModal.html', + template: require('../../../templates/shared/signalAbuseModal.html'), size: 'md', resolve: { project () { return $scope.project; } diff --git a/app/frontend/src/javascript/directives/cart.js b/app/frontend/src/javascript/directives/cart.js index 06dc762dc..0c72a61bf 100644 --- a/app/frontend/src/javascript/directives/cart.js +++ b/app/frontend/src/javascript/directives/cart.js @@ -39,7 +39,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', reservableName: '@', limitToOneSlot: '@' }, - templateUrl: 'shared/_cart.html', + template: require('../../../templates/shared/_cart.html'), link ($scope, element, attributes) { // will store the user's plan if he choosed to buy one $scope.selectedPlan = null; @@ -174,7 +174,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', } else { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'shared/_reserve_slot_without_plan.html', + template: require('../../../templates/shared/_reserve_slot_without_plan.html'), size: 'md', controller: 'ReserveSlotWithoutPlanController', resolve: { @@ -318,7 +318,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', // ask confirmation const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'shared/_reserve_slot_tags_mismatch.html', + template: require('../../../templates/shared/_reserve_slot_tags_mismatch.html'), size: 'md', controller: 'ReserveSlotTagsMismatchController', resolve: { @@ -357,7 +357,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', if (sameTimeReservations.length > 0) { const modalInstance = $uibModal.open({ animation: true, - templateUrl: 'shared/_reserve_slot_same_time.html', + template: require('../../../templates/shared/_reserve_slot_same_time.html'), size: 'md', controller: 'ReserveSlotSameTimeController', resolve: { @@ -447,7 +447,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', $scope.slot.cancelable = slotCanBeCanceled($scope.slot); // -> then, we open a dialog to ask to the user to choose an action return dialogs.confirm({ - templateUrl: 'shared/confirm_modify_slot_modal.html', + template: require('../../../templates/shared/confirm_modify_slot_modal.html'), resolve: { object () { return $scope.slot; } } @@ -612,7 +612,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', */ const payByStripe = function (reservation) { $uibModal.open({ - templateUrl: 'stripe/payment_modal.html', + template: require('../../../templates/stripe/payment_modal.html'), size: 'md', resolve: { reservation () { @@ -673,7 +673,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', */ const payOnSite = function (reservation) { $uibModal.open({ - templateUrl: 'shared/valid_reservation_modal.html', + template: require('../../../templates/shared/valid_reservation_modal.html'), size: 'sm', resolve: { reservation () { diff --git a/app/frontend/src/javascript/directives/coupon.js b/app/frontend/src/javascript/directives/coupon.js index 9ea13697f..fe4f1253d 100644 --- a/app/frontend/src/javascript/directives/coupon.js +++ b/app/frontend/src/javascript/directives/coupon.js @@ -18,7 +18,7 @@ Application.Directives.directive('coupon', [ '$rootScope', 'Coupon', '_t', funct total: '=', userId: '@' }, - templateUrl: 'shared/_coupon.html', + template: require('../../../templates/shared/_coupon.html'), link ($scope, element, attributes) { // Whether code input is shown or not (ie. the link 'I have a coupon' is shown) $scope.code = diff --git a/app/frontend/src/javascript/directives/fab_user_avatar.js b/app/frontend/src/javascript/directives/fab_user_avatar.js index af2345098..fd2caf65e 100644 --- a/app/frontend/src/javascript/directives/fab_user_avatar.js +++ b/app/frontend/src/javascript/directives/fab_user_avatar.js @@ -15,6 +15,6 @@ Application.Directives.directive('fabUserAvatar', [ function () { userAvatar: '=ngModel', avatarClass: '@' }, - templateUrl: 'shared/_user_avatar.html' + template: require('../../../templates/shared/_user_avatar.html') }); }]); diff --git a/app/frontend/src/javascript/directives/home/events.js b/app/frontend/src/javascript/directives/home/events.js index 8f3c86ba9..597b722cc 100644 --- a/app/frontend/src/javascript/directives/home/events.js +++ b/app/frontend/src/javascript/directives/home/events.js @@ -2,7 +2,7 @@ Application.Directives.directive('events', [ 'Event', function (Event) { return ({ restrict: 'E', - templateUrl: 'home/events.html', + template: require('../../../../templates/home/events.html'), link ($scope, element, attributes) { // The closest upcoming events $scope.upcomingEvents = null; diff --git a/app/frontend/src/javascript/directives/home/news.js b/app/frontend/src/javascript/directives/home/news.js index 2f34f638f..cee4d8043 100644 --- a/app/frontend/src/javascript/directives/home/news.js +++ b/app/frontend/src/javascript/directives/home/news.js @@ -2,7 +2,7 @@ Application.Directives.directive('news', [ 'Setting', function (Setting) { return ({ restrict: 'E', - templateUrl: 'home/news.html', + template: require('../../../../templates/home/news.html'), link ($scope, element, attributes) { // The admin blogpost $scope.homeBlogpost = null; diff --git a/app/frontend/src/javascript/directives/home/projects.js b/app/frontend/src/javascript/directives/home/projects.js index 2383891c5..b3876a35a 100644 --- a/app/frontend/src/javascript/directives/home/projects.js +++ b/app/frontend/src/javascript/directives/home/projects.js @@ -2,7 +2,7 @@ Application.Directives.directive('projects', [ 'Project', function (Project) { return ({ restrict: 'E', - templateUrl: 'home/projects.html', + template: require('../../../../templates/home/projects.html'), link ($scope, element, attributes) { // The last projects published/documented on the platform $scope.lastProjects = null; diff --git a/app/frontend/src/javascript/directives/home/twitter.js b/app/frontend/src/javascript/directives/home/twitter.js index 73e518ae4..67a3178fd 100644 --- a/app/frontend/src/javascript/directives/home/twitter.js +++ b/app/frontend/src/javascript/directives/home/twitter.js @@ -8,7 +8,7 @@ Application.Directives.directive('twitter', ['Setting', function (Setting) { return ({ restrict: 'E', - templateUrl: 'home/twitter.html', + template: require('../../../../templates/home/twitter.html'), link ($scope, element, attributes) { // Twitter username $scope.twitterName = null; diff --git a/app/frontend/src/javascript/directives/members.js b/app/frontend/src/javascript/directives/members.js index 2fda6a4e3..9c794bb44 100644 --- a/app/frontend/src/javascript/directives/members.js +++ b/app/frontend/src/javascript/directives/members.js @@ -2,7 +2,7 @@ Application.Directives.directive('members', [ 'Member', function (Member) { return ({ restrict: 'E', - templateUrl: 'home/members.html', + template: require('../../../templates/home/members.html'), link ($scope, element, attributes) { // The last registered members who confirmed their addresses $scope.lastMembers = null; diff --git a/app/frontend/src/javascript/directives/selectMember.js b/app/frontend/src/javascript/directives/selectMember.js index 02db456f1..2aa6e2ad0 100644 --- a/app/frontend/src/javascript/directives/selectMember.js +++ b/app/frontend/src/javascript/directives/selectMember.js @@ -11,7 +11,7 @@ Application.Directives.directive('selectMember', [ 'Diacritics', 'Member', function (Diacritics, Member) { return ({ restrict: 'E', - templateUrl: 'shared/_member_select.html', + template: require('../../../templates/shared/_member_select.html'), link (scope, element, attributes) { return scope.autoCompleteName = function (nameLookup) { if (!nameLookup) { diff --git a/app/frontend/src/javascript/directives/settings/boolean-setting.js b/app/frontend/src/javascript/directives/settings/boolean-setting.js index f65af7c04..6b1ef1f63 100644 --- a/app/frontend/src/javascript/directives/settings/boolean-setting.js +++ b/app/frontend/src/javascript/directives/settings/boolean-setting.js @@ -11,7 +11,7 @@ Application.Directives.directive('booleanSetting', ['Setting', 'growl', '_t', classes: '@', onBeforeSave: '=' }, - templateUrl: 'admin/settings/boolean.html', + template: require('../../../../templates/admin/settings/boolean.html'), link ($scope, element, attributes) { // The setting $scope.setting = { diff --git a/app/frontend/src/javascript/directives/settings/number-setting.js b/app/frontend/src/javascript/directives/settings/number-setting.js index 415609bc5..9b6e6d709 100644 --- a/app/frontend/src/javascript/directives/settings/number-setting.js +++ b/app/frontend/src/javascript/directives/settings/number-setting.js @@ -12,7 +12,7 @@ Application.Directives.directive('numberSetting', ['Setting', 'growl', '_t', min: '@', required: '<' }, - templateUrl: 'admin/settings/number.html', + template: require('../../../../templates/admin/settings/number.html'), link ($scope, element, attributes) { // The setting $scope.setting = { diff --git a/app/frontend/src/javascript/directives/settings/select-multiple-setting.js b/app/frontend/src/javascript/directives/settings/select-multiple-setting.js index 92471dc93..811a00d91 100644 --- a/app/frontend/src/javascript/directives/settings/select-multiple-setting.js +++ b/app/frontend/src/javascript/directives/settings/select-multiple-setting.js @@ -12,7 +12,7 @@ Application.Directives.directive('selectMultipleSetting', ['Setting', 'growl', ' descriptionNew: '@', beforeAdd: '=' }, - templateUrl: 'admin/settings/select-multiple.html', + template: require('../../../../templates/admin/settings/select-multiple.html'), link ($scope, element, attributes) { // The setting $scope.setting = { @@ -44,7 +44,7 @@ Application.Directives.directive('selectMultipleSetting', ['Setting', 'growl', ' */ $scope.addItem = function() { $uibModal.open({ - templateUrl: 'newSelectOption.html', + template: require('../../../../templates/newSelectOption.html'), resolve: { titleNew: function () { return $scope.titleNew; }, descriptionNew: function () { return $scope.descriptionNew; } diff --git a/app/frontend/src/javascript/directives/settings/select-setting.js b/app/frontend/src/javascript/directives/settings/select-setting.js index 2c2f55a1c..b3e21aee7 100644 --- a/app/frontend/src/javascript/directives/settings/select-setting.js +++ b/app/frontend/src/javascript/directives/settings/select-setting.js @@ -14,7 +14,7 @@ Application.Directives.directive('selectSetting', ['Setting', 'growl', '_t', option4: '<', option5: '<' }, - templateUrl: 'admin/settings/select.html', + template: require('../../../../templates/admin/settings/select.html'), link ($scope, element, attributes) { // The setting $scope.setting = { diff --git a/app/frontend/src/javascript/directives/settings/text-setting.js b/app/frontend/src/javascript/directives/settings/text-setting.js index aee419d7d..a4a284f29 100644 --- a/app/frontend/src/javascript/directives/settings/text-setting.js +++ b/app/frontend/src/javascript/directives/settings/text-setting.js @@ -15,7 +15,7 @@ Application.Directives.directive('textSetting', ['Setting', 'growl', '_t', minLength: '@', readOnly: '<' }, - templateUrl: 'admin/settings/text.html', + template: require('../../../../templates/admin/settings/text.html'), link ($scope, element, attributes) { // if type is not specified, use text as default if (typeof $scope.type === 'undefined') { diff --git a/app/frontend/src/javascript/directives/socialLink.js b/app/frontend/src/javascript/directives/socialLink.js index 33e77a7f8..ac84590f3 100644 --- a/app/frontend/src/javascript/directives/socialLink.js +++ b/app/frontend/src/javascript/directives/socialLink.js @@ -16,7 +16,7 @@ Application.Directives.directive('socialLink', [ function () { network: '@?', user: '=' }, - templateUrl: 'shared/_social_link.html', + template: require('../../../templates/shared/_social_link.html'), link (scope, element, attributes) { if (scope.network === 'dailymotion') { scope.image = "social/dailymotion.png"; diff --git a/app/frontend/src/javascript/lib/devise-modal.js b/app/frontend/src/javascript/lib/devise-modal.js index 7b7eade2f..0fac4ea92 100644 --- a/app/frontend/src/javascript/lib/devise-modal.js +++ b/app/frontend/src/javascript/lib/devise-modal.js @@ -28,7 +28,7 @@ } if (!promise) { promise = $uibModal.open({ - templateUrl: 'deviseModal.html', + template: require('../../../templates/deviseModal.html'), controller: function ($scope, $uibModalInstance) { var user = $scope.user = {}; $scope.login = function () { diff --git a/app/frontend/src/javascript/router.js b/app/frontend/src/javascript/router.js index ca5202b1b..d8489c659 100644 --- a/app/frontend/src/javascript/router.js +++ b/app/frontend/src/javascript/router.js @@ -21,14 +21,14 @@ angular.module('application.router', ['ui.router']) abstract: true, views: { header: { - templateUrl: 'shared/header.html' + template: require('../../templates/shared/header.html.erb') }, leftnav: { - templateUrl: 'shared/leftnav.html', + template: require('../../templates/shared/leftnav.html'), controller: 'MainNavController' }, cookies: { - templateUrl: 'shared/cookies.html', + template: require('../../templates/shared/cookies.html'), controller: 'CookiesController' }, main: {} @@ -92,7 +92,7 @@ angular.module('application.router', ['ui.router']) url: '/about', views: { 'content@': { - templateUrl: 'shared/about.html', + template: require('../../templates/shared/about.html'), controller: 'AboutController' } } @@ -101,7 +101,7 @@ angular.module('application.router', ['ui.router']) url: '/?reset_password_token', views: { 'main@': { - templateUrl: 'home.html', + template: require('../../templates/home.html'), controller: 'HomeController' } }, @@ -113,7 +113,7 @@ angular.module('application.router', ['ui.router']) url: '/privacy-policy', views: { 'content@': { - templateUrl: 'shared/privacy.html', + template: require('../../templates/shared/privacy.html'), controller: 'PrivacyController' } } @@ -124,7 +124,7 @@ angular.module('application.router', ['ui.router']) url: '/profile_completion', views: { 'main@': { - templateUrl: 'profile/complete.html', + template: require('../../templates/profile/complete.html'), controller: 'CompleteProfileController' } }, @@ -150,7 +150,7 @@ angular.module('application.router', ['ui.router']) url: '/profile', views: { 'main@': { - templateUrl: 'dashboard/profile.html', + template: require('../../templates/dashboard/profile.html'), controller: 'DashboardController' } } @@ -159,7 +159,7 @@ angular.module('application.router', ['ui.router']) url: '/settings', views: { 'main@': { - templateUrl: 'dashboard/settings.html', + template: require('../../templates/dashboard/settings.html'), controller: 'EditProfileController' } }, @@ -173,7 +173,7 @@ angular.module('application.router', ['ui.router']) url: '/projects', views: { 'main@': { - templateUrl: 'dashboard/projects.html', + template: require('../../templates/dashboard/projects.html'), controller: 'DashboardController' } } @@ -182,7 +182,7 @@ angular.module('application.router', ['ui.router']) url: '/trainings', views: { 'main@': { - templateUrl: 'dashboard/trainings.html', + template: require('../../templates/dashboard/trainings.html'), controller: 'DashboardController' } } @@ -191,7 +191,7 @@ angular.module('application.router', ['ui.router']) url: '/events', views: { 'main@': { - templateUrl: 'dashboard/events.html', + template: require('../../templates/dashboard/events.html'), controller: 'DashboardController' } } @@ -200,7 +200,7 @@ angular.module('application.router', ['ui.router']) url: '/invoices', views: { 'main@': { - templateUrl: 'dashboard/invoices.html', + template: require('../../templates/dashboard/invoices.html'), controller: 'DashboardController' } } @@ -210,7 +210,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.walletModule, views: { 'main@': { - templateUrl: 'dashboard/wallet.html', + template: require('../../templates/dashboard/wallet.html'), controller: 'WalletController' } }, @@ -225,7 +225,7 @@ angular.module('application.router', ['ui.router']) url: '/members/:id', views: { 'main@': { - templateUrl: 'members/show.html', + template: require('../../templates/members/show.html'), controller: 'ShowProfileController' } }, @@ -237,7 +237,7 @@ angular.module('application.router', ['ui.router']) url: '/members', views: { 'main@': { - templateUrl: 'members/index.html', + template: require('../../templates/members/index.html'), controller: 'MembersController' } }, @@ -251,7 +251,7 @@ angular.module('application.router', ['ui.router']) url: '/projects?q&page&theme_id&component_id&machine_id&from&whole_network', views: { 'main@': { - templateUrl: 'projects/index.html.erb', + template: require('../../templates/projects/index.html'), controller: 'ProjectsController' } }, @@ -267,7 +267,7 @@ angular.module('application.router', ['ui.router']) url: '/projects/new', views: { 'main@': { - templateUrl: 'projects/new.html', + template: require('../../templates/projects/new.html'), controller: 'NewProjectController' } }, @@ -279,7 +279,7 @@ angular.module('application.router', ['ui.router']) url: '/projects/:id', views: { 'main@': { - templateUrl: 'projects/show.html', + template: require('../../templates/projects/show.html'), controller: 'ShowProjectController' } }, @@ -292,7 +292,7 @@ angular.module('application.router', ['ui.router']) url: '/projects/:id/edit', views: { 'main@': { - templateUrl: 'projects/edit.html', + template: require('../../templates/projects/edit.html'), controller: 'EditProjectController' } }, @@ -307,7 +307,7 @@ angular.module('application.router', ['ui.router']) url: '/machines', views: { 'main@': { - templateUrl: 'machines/index.html.erb', + template: require('../../templates/machines/index.html'), controller: 'MachinesController' } }, @@ -320,7 +320,7 @@ angular.module('application.router', ['ui.router']) url: '/machines/new', views: { 'main@': { - templateUrl: 'machines/new.html', + template: require('../../templates/machines/new.html'), controller: 'NewMachineController' } } @@ -329,7 +329,7 @@ angular.module('application.router', ['ui.router']) url: '/machines/:id', views: { 'main@': { - templateUrl: 'machines/show.html', + template: require('../../templates/machines/show.html'), controller: 'ShowMachineController' } }, @@ -341,7 +341,7 @@ angular.module('application.router', ['ui.router']) url: '/machines/:id/reserve', views: { 'main@': { - templateUrl: 'machines/reserve.html', + template: require('../../templates/machines/reserve.html'), controller: 'ReserveMachineController' } }, @@ -362,7 +362,7 @@ angular.module('application.router', ['ui.router']) url: '/machines/:id/edit', views: { 'main@': { - templateUrl: 'machines/edit.html', + template: require('../../templates/machines/edit.html'), controller: 'EditMachineController' } }, @@ -377,7 +377,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.spacesModule, views: { 'main@': { - templateUrl: 'spaces/index.html', + template: require('../../templates/spaces/index.html'), controller: 'SpacesController' } }, @@ -391,7 +391,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.spacesModule, views: { 'main@': { - templateUrl: 'spaces/new.html', + template: require('../../templates/spaces/new.html'), controller: 'NewSpaceController' } } @@ -401,7 +401,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.spacesModule, views: { 'main@': { - templateUrl: 'spaces/show.html', + template: require('../../templates/spaces/show.html'), controller: 'ShowSpaceController' } }, @@ -414,7 +414,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.spacesModule, views: { 'main@': { - templateUrl: 'spaces/edit.html', + template: require('../../templates/spaces/edit.html'), controller: 'EditSpaceController' } }, @@ -427,7 +427,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.spacesModule, views: { 'main@': { - templateUrl: 'spaces/reserve.html', + template: require('../../templates/spaces/reserve.html'), controller: 'ReserveSpaceController' } }, @@ -451,7 +451,7 @@ angular.module('application.router', ['ui.router']) url: '/trainings', views: { 'main@': { - templateUrl: 'trainings/index.html.erb', + template: require('../../templates/trainings/index.html'), controller: 'TrainingsController' } }, @@ -463,7 +463,7 @@ angular.module('application.router', ['ui.router']) url: '/trainings/:id', views: { 'main@': { - templateUrl: 'trainings/show.html', + template: require('../../templates/trainings/show.html'), controller: 'ShowTrainingController' } }, @@ -475,7 +475,7 @@ angular.module('application.router', ['ui.router']) url: '/trainings/:id/reserve', views: { 'main@': { - templateUrl: 'trainings/reserve.html', + template: require('../../templates/trainings/reserve.html'), controller: 'ReserveTrainingController' } }, @@ -501,7 +501,7 @@ angular.module('application.router', ['ui.router']) url: '/notifications', views: { 'main@': { - templateUrl: 'notifications/index.html.erb', + template: require('../../templates/notifications/index.html'), controller: 'NotificationsController' } } @@ -513,7 +513,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.plansModule, views: { 'main@': { - templateUrl: 'plans/index.html.erb', + template: require('../../templates/plans/index.html'), controller: 'PlansIndexController' } }, @@ -530,7 +530,7 @@ angular.module('application.router', ['ui.router']) url: '/events', views: { 'main@': { - templateUrl: 'events/index.html.erb', + template: require('../../templates/events/index.html'), controller: 'EventsController' } }, @@ -545,7 +545,7 @@ angular.module('application.router', ['ui.router']) url: '/events/:id', views: { 'main@': { - templateUrl: 'events/show.html', + template: require('../../templates/events/show.html'), controller: 'ShowEventController' } }, @@ -561,7 +561,7 @@ angular.module('application.router', ['ui.router']) url: '/calendar', views: { 'main@': { - templateUrl: 'calendar/calendar.html', + template: require('../../templates/calendar/calendar.html'), controller: 'CalendarController' } }, @@ -581,7 +581,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/calendar', views: { 'main@': { - templateUrl: 'admin/calendar/calendar.html', + template: require('../../templates/admin/calendar/calendar.html'), controller: 'AdminCalendarController' } }, @@ -598,7 +598,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/calendar/icalendar', views: { 'main@': { - templateUrl: 'admin/calendar/icalendar.html', + template: require('../../templates/admin/calendar/icalendar.html'), controller: 'AdminICalendarController' } }, @@ -612,7 +612,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/projects', views: { 'main@': { - templateUrl: 'admin/projects/index.html.erb', + template: require('../../templates/admin/projects/index.html'), controller: 'AdminProjectsController' } }, @@ -632,7 +632,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/abuses', views: { 'main@': { - templateUrl: 'admin/abuses/index.html', + template: require('../../templates/admin/abuses/index.html'), controller: 'AbusesController' } }, @@ -646,7 +646,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/trainings', views: { 'main@': { - templateUrl: 'admin/trainings/index.html.erb', + template: require('../../templates/admin/trainings/index.html'), controller: 'TrainingsAdminController' } }, @@ -660,7 +660,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/trainings/new', views: { 'main@': { - templateUrl: 'admin/trainings/new.html', + template: require('../../templates/admin/trainings/new.html'), controller: 'NewTrainingController' } }, @@ -672,7 +672,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/trainings/:id/edit', views: { 'main@': { - templateUrl: 'admin/trainings/edit.html', + template: require('../../templates/admin/trainings/edit.html'), controller: 'EditTrainingController' } }, @@ -686,7 +686,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/events', views: { 'main@': { - templateUrl: 'admin/events/index.html.erb', + template: require('../../templates/admin/events/index.html'), controller: 'AdminEventsController' } }, @@ -703,7 +703,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/events/new', views: { 'main@': { - templateUrl: 'events/new.html', + template: require('../../templates/events/new.html'), controller: 'NewEventController' } }, @@ -718,7 +718,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/events/:id/edit', views: { 'main@': { - templateUrl: 'events/edit.html', + template: require('../../templates/events/edit.html'), controller: 'EditEventController' } }, @@ -734,7 +734,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/events/:id/reservations', views: { 'main@': { - templateUrl: 'admin/events/reservations.html', + template: require('../../templates/admin/events/reservations.html'), controller: 'ShowEventReservationsController' } }, @@ -749,7 +749,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/pricing', views: { 'main@': { - templateUrl: 'admin/pricing/index.html.erb', + template: require('../../templates/admin/pricing/index.html'), controller: 'EditPricingController' } }, @@ -783,7 +783,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/plans/new', views: { 'main@': { - templateUrl: 'admin/plans/new.html', + template: require('../../templates/admin/plans/new.html'), controller: 'NewPlanController' } } @@ -792,7 +792,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/plans/:id/edit', views: { 'main@': { - templateUrl: 'admin/plans/edit.html', + template: require('../../templates/admin/plans/edit.html'), controller: 'EditPlanController' } }, @@ -809,7 +809,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/coupons/new', views: { 'main@': { - templateUrl: 'admin/coupons/new.html', + template: require('../../templates/admin/coupons/new.html'), controller: 'NewCouponController' } } @@ -818,7 +818,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/coupons/:id/edit', views: { 'main@': { - templateUrl: 'admin/coupons/edit.html', + template: require('../../templates/admin/coupons/edit.html'), controller: 'EditCouponController' } }, @@ -832,7 +832,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/invoices', views: { 'main@': { - templateUrl: 'admin/invoices/index.html.erb', + template: require('../../templates/admin/invoices/index.html'), controller: 'InvoicesController' } }, @@ -865,19 +865,19 @@ angular.module('application.router', ['ui.router']) url: '/admin/members', views: { 'main@': { - templateUrl: 'admin/members/index.html.erb', + template: require('../../templates/admin/members/index.html'), controller: 'AdminMembersController' }, 'groups@app.admin.members': { - templateUrl: 'admin/groups/index.html.erb', + template: require('../../templates/admin/groups/index.html'), controller: 'GroupsController' }, 'tags@app.admin.members': { - templateUrl: 'admin/tags/index.html.erb', + template: require('../../templates/admin/tags/index.html'), controller: 'TagsController' }, 'authentification@app.admin.members': { - templateUrl: 'admin/authentications/index.html.erb', + template: require('../../templates/admin/authentications/index.html'), controller: 'AuthentificationController' } }, @@ -896,7 +896,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/members/new', views: { 'main@': { - templateUrl: 'admin/members/new.html', + template: require('../../templates/admin/members/new.html'), controller: 'NewMemberController' } }, @@ -908,7 +908,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/members/import', views: { 'main@': { - templateUrl: 'admin/members/import.html', + template: require('../../templates/admin/members/import.html'), controller: 'ImportMembersController' } }, @@ -920,7 +920,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/members/import/:id/results', views: { 'main@': { - templateUrl: 'admin/members/import_result.html', + template: require('../../templates/admin/members/import_result.html'), controller: 'ImportMembersResultController' } }, @@ -932,7 +932,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/members/:id/edit', views: { 'main@': { - templateUrl: 'admin/members/edit.html', + template: require('../../templates/admin/members/edit.html'), controller: 'EditMemberController' } }, @@ -949,7 +949,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/admins/new', views: { 'main@': { - templateUrl: 'admin/admins/new.html', + template: require('../../templates/admin/admins/new.html'), controller: 'NewAdminController' } }, @@ -961,7 +961,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/managers/new', views: { 'main@': { - templateUrl: 'admin/managers/new.html', + template: require('../../templates/admin/managers/new.html'), controller: 'NewManagerController' } }, @@ -976,7 +976,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/authentications/new', views: { 'main@': { - templateUrl: 'admin/authentications/new.html', + template: require('../../templates/admin/authentications/new.html'), controller: 'NewAuthenticationController' } }, @@ -989,7 +989,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/authentications/:id/edit', views: { 'main@': { - templateUrl: 'admin/authentications/edit.html', + template: require('../../templates/admin/authentications/edit.html'), controller: 'EditAuthenticationController' } }, @@ -1005,7 +1005,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.statisticsModule, views: { 'main@': { - templateUrl: 'admin/statistics/index.html.erb', + template: require('../../templates/admin/statistics/index.html'), controller: 'StatisticsController' } }, @@ -1020,7 +1020,7 @@ angular.module('application.router', ['ui.router']) abstract: !Fablab.statisticsModule, views: { 'main@': { - templateUrl: 'admin/statistics/graphs.html', + template: require('../../templates/admin/statistics/graphs.html'), controller: 'GraphsController' } } @@ -1031,7 +1031,7 @@ angular.module('application.router', ['ui.router']) url: '/admin/settings', views: { 'main@': { - templateUrl: 'admin/settings/index.html.erb', + template: require('../../templates/admin/settings/index.html'), controller: 'SettingsController' } }, @@ -1064,7 +1064,7 @@ angular.module('application.router', ['ui.router']) url: '/open_api_clients', views: { 'main@': { - templateUrl: 'admin/open_api_clients/index.html.erb', + template: require('../../templates/admin/open_api_clients/index.html.erb'), controller: 'OpenAPIClientsController' } }, diff --git a/app/frontend/src/javascript/services/dialogs.js b/app/frontend/src/javascript/services/dialogs.js index aaec43d16..be6df91f9 100644 --- a/app/frontend/src/javascript/services/dialogs.js +++ b/app/frontend/src/javascript/services/dialogs.js @@ -4,7 +4,7 @@ Application.Services.factory('dialogs', ['$uibModal', function ($uibModal) { return ({ confirm (options, success, error) { const defaultOpts = { - templateUrl: 'shared/confirm_modal.html', + template: require('../../../templates/shared/confirm_modal.html'), size: 'sm', resolve: { object () { diff --git a/app/frontend/src/javascript/services/help.js b/app/frontend/src/javascript/services/help.js index bb473782a..be44be300 100644 --- a/app/frontend/src/javascript/services/help.js +++ b/app/frontend/src/javascript/services/help.js @@ -34,7 +34,7 @@ Application.Services.factory('Help', ['$rootScope', '$uibModal', '$state', 'Auth $uibModal.open({ animation: true, - templateUrl: 'shared/help_modal.html', + template: require('../../../templates/shared/help_modal.html'), resolve: { tourName: function () { return tourName; } }, diff --git a/config/webpack/environment.js b/config/webpack/environment.js index 83fbc3c1b..8fa831aea 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -14,6 +14,8 @@ environment.plugins.prepend('Provide', new webpack.ProvidePlugin({ 'window.jQuery': 'jquery', Hone: 'hone', Tether: 'tether', + Humanize: path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/lib/humanize.js')), + moment: 'moment', Application: [path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/app.js')), 'Application'] })); diff --git a/config/webpack/loaders/html_erb.js b/config/webpack/loaders/html_erb.js index 1e676649d..a2d552295 100644 --- a/config/webpack/loaders/html_erb.js +++ b/config/webpack/loaders/html_erb.js @@ -2,6 +2,6 @@ module.exports = { test: /\.html\.erb$/, loader: [ 'html-loader', - 'rails-erb-loader', + 'rails-erb-loader' ] }; diff --git a/package.json b/package.json index 72681ed2a..b566107b6 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,6 @@ "eslint-plugin-node": "~11.0.0", "eslint-plugin-promise": "~4.2.1", "eslint-plugin-standard": "~4.0.1", - "exports-loader": "^1.1.0", - "expose-loader": "^1.0.0", "file-loader": "^6.1.0", "html-loader": "^1.3.0", "rails-erb-loader": "^5.5.2", diff --git a/yarn.lock b/yarn.lock index 8e608e0cc..b1cfc7c35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3488,23 +3488,6 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -exports-loader@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/exports-loader/-/exports-loader-1.1.0.tgz#26a16706e4cf533145de24c1419baf33b624fb5c" - integrity sha512-zGB2SujiAyO0Rwn4GQ17/HlT8cwmT8abcBeZpr2R3sItJ5sI5Y9BzNzus3H9tH1iWLAoJLi9N3TP54D2+j859Q== - dependencies: - loader-utils "^2.0.0" - schema-utils "^2.7.0" - source-map "^0.6.1" - -expose-loader@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-1.0.0.tgz#1676dde8fce6662584e17f8531e24d2afe8dae11" - integrity sha512-xgt47+pEQrlCyCoO09cMKWf5qiurK6qMtvjUPm8+Uso5WwkNHeD47P0Zb3R9Kvk5zUcJWLax95xaaXDJCmoNjw== - dependencies: - loader-utils "^2.0.0" - schema-utils "^2.6.6" - express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134"