1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

fix loading angular-ui-tour templates + use templateUrl instead of template:require()

This commit is contained in:
Sylvain 2020-09-22 14:46:13 +02:00
parent 4e4ab9c4c2
commit a398ba8b8e
37 changed files with 154 additions and 134 deletions

View File

@ -87,7 +87,7 @@ class AuthenticationController {
*/
$scope.defineDataMapping = function (mapping) {
$uibModal.open({
template: require('../../../../templates/admin/authentications/_data_mapping.html'),
templateUrl: '../../../../templates/admin/authentications/_data_mapping.html',
size: 'md',
resolve: {
field () { return mapping; },

View File

@ -273,7 +273,7 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state
// open a confirmation dialog
const modalInstance = $uibModal.open({
animation: true,
template: require('../../../../templates/admin/calendar/deleteRecurrent.html'),
templateUrl: '../../../../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({
template: require('../../../../templates/admin/calendar/eventModal.html'),
templateUrl: '../../../../templates/admin/calendar/eventModal.html',
controller: 'CreateEventModalController',
backdrop: 'static',
keyboard: false,

View File

@ -279,7 +279,7 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state',
*/
$scope.newPriceCategory = function () {
$uibModal.open({
template: require('../../../../templates/admin/events/price_form.html'),
templateUrl: '../../../../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({
template: require('../../../../templates/admin/events/price_form.html'),
templateUrl: '../../../../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,
template: require('../../../../templates/events/editRecurrent.html'),
templateUrl: '../../../../templates/events/editRecurrent.html',
size: 'md',
controller: 'EditRecurrentEventController',
resolve: {

View File

@ -220,7 +220,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
$scope.generateAvoirForInvoice = function (invoice) {
// open modal
const modalInstance = $uibModal.open({
template: require('../../../../templates/admin/invoices/avoirModal.html'),
templateUrl: '../../../../templates/admin/invoices/avoirModal.html',
controller: 'AvoirModalController',
resolve: {
invoice () { return invoice; },
@ -578,7 +578,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
$scope.closeAnAccountingPeriod = function () {
// open modal
$uibModal.open({
template: require('../../../../templates/admin/invoices/closePeriodModal.html'),
templateUrl: '../../../../templates/admin/invoices/closePeriodModal.html',
controller: 'ClosePeriodModalController',
backdrop: 'static',
keyboard: false,
@ -592,7 +592,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
$scope.toggleExportModal = function () {
$uibModal.open({
template: require('../../../../templates/admin/invoices/accountingExportModal.html'),
templateUrl: '../../../../templates/admin/invoices/accountingExportModal.html',
controller: 'AccountingExportModalController',
size: 'xl'
});

View File

@ -236,7 +236,7 @@ Application.Controllers.controller('AdminMembersController', ['$scope', '$sce',
$scope.openPartnerNewModal = function () {
const modalInstance = $uibModal.open({
animation: true,
template: require('../../../../templates/shared/_partner_new_modal.html'),
templateUrl: '../../../../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,
template: require('../../../../templates/admin/members/change_role_modal.html'),
templateUrl: '../../../../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,
template: require('../../../../templates/admin/subscriptions/expired_at_modal.html'),
templateUrl: '../../../../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,
template: require('../../../../templates/admin/subscriptions/create_modal.html'),
templateUrl: '../../../../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,
template: require('../../../../templates/wallet/credit_modal.html'),
templateUrl: '../../../../templates/wallet/credit_modal.html',
controller: ['$scope', '$uibModalInstance', 'Wallet', function ($scope, $uibModalInstance, Wallet) {
// default: do not generate a refund invoice
$scope.generate_avoir = false;

View File

@ -106,7 +106,7 @@ Application.Controllers.controller('NewPlanController', ['$scope', '$uibModal',
$scope.openPartnerNewModal = function (subscription) {
const modalInstance = $uibModal.open({
animation: true,
template: require('../../../../templates/shared/_partner_new_modal.html'),
templateUrl: '../../../../templates/shared/_partner_new_modal.html',
size: 'lg',
controller: ['$scope', '$uibModalInstance', 'User', function ($scope, $uibModalInstance, User) {
$scope.partner = {};

View File

@ -570,7 +570,7 @@ Application.Controllers.controller('EditPricingController', ['$scope', '$state',
*/
$scope.sendCouponToUser = function (coupon) {
$uibModal.open({
template: require('../../../../templates/admin/pricing/sendCoupon.html'),
templateUrl: '../../../../templates/admin/pricing/sendCoupon.html',
resolve: {
coupon () { return coupon; }
},

View File

@ -173,7 +173,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
$scope.savePrivacyPolicy = function () {
// open modal
const modalInstance = $uibModal.open({
template: require('../../../../templates/admin/settings/save_policy.html'),
templateUrl: '../../../../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({
template: require('../../../../templates/admin/settings/analyticsModal.html'),
templateUrl: '../../../../templates/admin/settings/analyticsModal.html',
controller: 'AnalyticsModalController',
size: 'lg',
resolve: {

View File

@ -311,7 +311,7 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state',
*/
$scope.exportToExcel = function () {
const options = {
template: require('../../../../templates/admin/statistics/export.html'),
templateUrl: '../../../../templates/admin/statistics/export.html',
size: 'sm',
controller: 'ExportStatisticsController',
resolve: {

View File

@ -221,7 +221,7 @@ Application.Controllers.controller('TrainingsAdminController', ['$scope', '$stat
*/
$scope.showReservations = function (training, availability) {
$uibModal.open({
template: require('../../../../templates/admin/trainings/validTrainingModal.html'),
templateUrl: '../../../../templates/admin/trainings/validTrainingModal.html',
controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {
$scope.availability = availability;

View File

@ -89,7 +89,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco
<% else %>
return $uibModal.open({
template: require('../../../templates/shared/signupModal.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/passwordEditModal.html'),
templateUrl: '../../../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({
template: require('../../../templates/admin/versions/upgradeModal.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/deviseModal.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/passwordNewModal.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/ConfirmationNewModal.html'),
templateUrl: '../../../templates/shared/ConfirmationNewModal.html',
size: 'sm',
controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) {
$scope.user = { email: '' };

View File

@ -186,7 +186,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', '
// open a confirmation dialog
const modalInstance = $uibModal.open({
animation: true,
template: require('../../../templates/events/deleteRecurrent.html'),
templateUrl: '../../../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({
template: require('../../../templates/events/modify_event_reservation_modal.html'),
templateUrl: '../../../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({
template: require('../../../templates/stripe/payment_modal.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/valid_reservation_modal.html'),
templateUrl: '../../../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,
template: require('../../../templates/shared/_reserve_slot_same_time.html'),
templateUrl: '../../../templates/shared/_reserve_slot_same_time.html',
size: 'md',
controller: 'ReserveSlotSameTimeController',
resolve: {

View File

@ -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({
template: require('../../../templates/machines/training_reservation_modal.html'),
templateUrl: '../../../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({
template: require('../../../templates/machines/request_training_modal.html'),
templateUrl: '../../../templates/machines/request_training_modal.html',
controller: ['$scope', '$uibModalInstance', '$state', function ($scope, $uibModalInstance, $state) {
$scope.machine = machine;
$scope.member = _this.$scope.currentUser;

View File

@ -235,7 +235,7 @@ Application.Controllers.controller('PlansIndexController', ['$scope', '$rootScop
*/
const payByStripe = function () {
$uibModal.open({
template: require('../../../templates/stripe/payment_modal.html'),
templateUrl: '../../../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({
template: require('../../../templates/plans/payment_modal.html'),
templateUrl: '../../../templates/plans/payment_modal.html',
size: 'sm',
resolve: {
selectedPlan () { return $scope.selectedPlan; },

View File

@ -167,7 +167,7 @@ Application.Controllers.controller('CompleteProfileController', ['$scope', '$roo
event.stopPropagation();
dialogs.confirm(
{
template: require('../../../templates/profile/resend_code_modal.html'),
templateUrl: '../../../templates/profile/resend_code_modal.html',
resolve: {
object () {
return { email: memberPromise.email };

View File

@ -587,7 +587,7 @@ Application.Controllers.controller('ShowProjectController', ['$scope', '$state',
if (e) { e.preventDefault(); }
$uibModal.open({
template: require('../../../templates/shared/signalAbuseModal.html'),
templateUrl: '../../../templates/shared/signalAbuseModal.html',
size: 'md',
resolve: {
project () { return $scope.project; }

View File

@ -39,7 +39,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
reservableName: '@',
limitToOneSlot: '@'
},
template: require('../../../templates/shared/_cart.html'),
templateUrl: '../../../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,
template: require('../../../templates/shared/_reserve_slot_without_plan.html'),
templateUrl: '../../../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,
template: require('../../../templates/shared/_reserve_slot_tags_mismatch.html'),
templateUrl: '../../../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,
template: require('../../../templates/shared/_reserve_slot_same_time.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/confirm_modify_slot_modal.html'),
templateUrl: '../../../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({
template: require('../../../templates/stripe/payment_modal.html'),
templateUrl: '../../../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({
template: require('../../../templates/shared/valid_reservation_modal.html'),
templateUrl: '../../../templates/shared/valid_reservation_modal.html',
size: 'sm',
resolve: {
reservation () {

View File

@ -18,7 +18,7 @@ Application.Directives.directive('coupon', [ '$rootScope', 'Coupon', '_t', funct
total: '=',
userId: '@'
},
template: require('../../../templates/shared/_coupon.html'),
templateUrl: '../../../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 =

View File

@ -15,6 +15,6 @@ Application.Directives.directive('fabUserAvatar', [ function () {
userAvatar: '=ngModel',
avatarClass: '@'
},
template: require('../../../templates/shared/_user_avatar.html')
templateUrl: '../../../templates/shared/_user_avatar.html'
});
}]);

View File

@ -2,7 +2,7 @@ Application.Directives.directive('events', [ 'Event',
function (Event) {
return ({
restrict: 'E',
template: require('../../../../templates/home/events.html'),
templateUrl: '../../../../templates/home/events.html',
link ($scope, element, attributes) {
// The closest upcoming events
$scope.upcomingEvents = null;

View File

@ -2,7 +2,7 @@ Application.Directives.directive('news', [ 'Setting',
function (Setting) {
return ({
restrict: 'E',
template: require('../../../../templates/home/news.html'),
templateUrl: '../../../../templates/home/news.html',
link ($scope, element, attributes) {
// The admin blogpost
$scope.homeBlogpost = null;

View File

@ -2,7 +2,7 @@ Application.Directives.directive('projects', [ 'Project',
function (Project) {
return ({
restrict: 'E',
template: require('../../../../templates/home/projects.html'),
templateUrl: '../../../../templates/home/projects.html',
link ($scope, element, attributes) {
// The last projects published/documented on the platform
$scope.lastProjects = null;

View File

@ -8,7 +8,7 @@ Application.Directives.directive('twitter', ['Setting',
function (Setting) {
return ({
restrict: 'E',
template: require('../../../../templates/home/twitter.html'),
templateUrl: '../../../../templates/home/twitter.html',
link ($scope, element, attributes) {
// Twitter username
$scope.twitterName = null;

View File

@ -2,7 +2,7 @@ Application.Directives.directive('members', [ 'Member',
function (Member) {
return ({
restrict: 'E',
template: require('../../../templates/home/members.html'),
templateUrl: '../../../templates/home/members.html',
link ($scope, element, attributes) {
// The last registered members who confirmed their addresses
$scope.lastMembers = null;

View File

@ -11,7 +11,7 @@
Application.Directives.directive('selectMember', [ 'Diacritics', 'Member', function (Diacritics, Member) {
return ({
restrict: 'E',
template: require('../../../templates/shared/_member_select.html'),
templateUrl: '../../../templates/shared/_member_select.html',
link (scope, element, attributes) {
return scope.autoCompleteName = function (nameLookup) {
if (!nameLookup) {

View File

@ -11,7 +11,7 @@ Application.Directives.directive('booleanSetting', ['Setting', 'growl', '_t',
classes: '@',
onBeforeSave: '='
},
template: require('../../../../templates/admin/settings/boolean.html'),
templateUrl: '../../../../templates/admin/settings/boolean.html',
link ($scope, element, attributes) {
// The setting
$scope.setting = {

View File

@ -12,7 +12,7 @@ Application.Directives.directive('numberSetting', ['Setting', 'growl', '_t',
min: '@',
required: '<'
},
template: require('../../../../templates/admin/settings/number.html'),
templateUrl: '../../../../templates/admin/settings/number.html',
link ($scope, element, attributes) {
// The setting
$scope.setting = {

View File

@ -12,7 +12,7 @@ Application.Directives.directive('selectMultipleSetting', ['Setting', 'growl', '
descriptionNew: '@',
beforeAdd: '='
},
template: require('../../../../templates/admin/settings/select-multiple.html'),
templateUrl: '../../../../templates/admin/settings/select-multiple.html',
link ($scope, element, attributes) {
// The setting
$scope.setting = {

View File

@ -14,7 +14,7 @@ Application.Directives.directive('selectSetting', ['Setting', 'growl', '_t',
option4: '<',
option5: '<'
},
template: require('../../../../templates/admin/settings/select.html'),
templateUrl: '../../../../templates/admin/settings/select.html',
link ($scope, element, attributes) {
// The setting
$scope.setting = {

View File

@ -15,7 +15,7 @@ Application.Directives.directive('textSetting', ['Setting', 'growl', '_t',
minLength: '@',
readOnly: '<'
},
template: require('../../../../templates/admin/settings/text.html'),
templateUrl: '../../../../templates/admin/settings/text.html',
link ($scope, element, attributes) {
// if type is not specified, use text as default
if (typeof $scope.type === 'undefined') {

View File

@ -16,7 +16,7 @@ Application.Directives.directive('socialLink', [ function () {
network: '@?',
user: '='
},
template: require('../../../templates/shared/_social_link.html'),
templateUrl: '../../../templates/shared/_social_link.html',
link (scope, element, attributes) {
if (scope.network === 'dailymotion') {
scope.image = "social/dailymotion.png";

View File

@ -21,14 +21,14 @@ angular.module('application.router', ['ui.router'])
abstract: true,
views: {
header: {
template: require('../../templates/shared/header.html.erb')
templateUrl: '../../templates/shared/header.html.erb'
},
leftnav: {
template: require('../../templates/shared/leftnav.html'),
templateUrl: '../../templates/shared/leftnav.html',
controller: 'MainNavController'
},
cookies: {
template: require('../../templates/shared/cookies.html'),
templateUrl: '../../templates/shared/cookies.html',
controller: 'CookiesController'
},
main: {}
@ -92,7 +92,7 @@ angular.module('application.router', ['ui.router'])
url: '/about',
views: {
'content@': {
template: require('../../templates/shared/about.html'),
templateUrl: '../../templates/shared/about.html',
controller: 'AboutController'
}
}
@ -101,7 +101,7 @@ angular.module('application.router', ['ui.router'])
url: '/?reset_password_token',
views: {
'main@': {
template: require('../../templates/home.html'),
templateUrl: '../../templates/home.html',
controller: 'HomeController'
}
},
@ -113,7 +113,7 @@ angular.module('application.router', ['ui.router'])
url: '/privacy-policy',
views: {
'content@': {
template: require('../../templates/shared/privacy.html'),
templateUrl: '../../templates/shared/privacy.html',
controller: 'PrivacyController'
}
}
@ -124,7 +124,7 @@ angular.module('application.router', ['ui.router'])
url: '/profile_completion',
views: {
'main@': {
template: require('../../templates/profile/complete.html'),
templateUrl: '../../templates/profile/complete.html',
controller: 'CompleteProfileController'
}
},
@ -150,7 +150,7 @@ angular.module('application.router', ['ui.router'])
url: '/profile',
views: {
'main@': {
template: require('../../templates/dashboard/profile.html'),
templateUrl: '../../templates/dashboard/profile.html',
controller: 'DashboardController'
}
}
@ -159,7 +159,7 @@ angular.module('application.router', ['ui.router'])
url: '/settings',
views: {
'main@': {
template: require('../../templates/dashboard/settings.html'),
templateUrl: '../../templates/dashboard/settings.html',
controller: 'EditProfileController'
}
},
@ -173,7 +173,7 @@ angular.module('application.router', ['ui.router'])
url: '/projects',
views: {
'main@': {
template: require('../../templates/dashboard/projects.html'),
templateUrl: '../../templates/dashboard/projects.html',
controller: 'DashboardController'
}
}
@ -182,7 +182,7 @@ angular.module('application.router', ['ui.router'])
url: '/trainings',
views: {
'main@': {
template: require('../../templates/dashboard/trainings.html'),
templateUrl: '../../templates/dashboard/trainings.html',
controller: 'DashboardController'
}
}
@ -191,7 +191,7 @@ angular.module('application.router', ['ui.router'])
url: '/events',
views: {
'main@': {
template: require('../../templates/dashboard/events.html'),
templateUrl: '../../templates/dashboard/events.html',
controller: 'DashboardController'
}
}
@ -200,7 +200,7 @@ angular.module('application.router', ['ui.router'])
url: '/invoices',
views: {
'main@': {
template: require('../../templates/dashboard/invoices.html'),
templateUrl: '../../templates/dashboard/invoices.html',
controller: 'DashboardController'
}
}
@ -210,7 +210,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.walletModule,
views: {
'main@': {
template: require('../../templates/dashboard/wallet.html'),
templateUrl: '../../templates/dashboard/wallet.html',
controller: 'WalletController'
}
},
@ -225,7 +225,7 @@ angular.module('application.router', ['ui.router'])
url: '/members/:id',
views: {
'main@': {
template: require('../../templates/members/show.html'),
templateUrl: '../../templates/members/show.html',
controller: 'ShowProfileController'
}
},
@ -237,7 +237,7 @@ angular.module('application.router', ['ui.router'])
url: '/members',
views: {
'main@': {
template: require('../../templates/members/index.html'),
templateUrl: '../../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@': {
template: require('../../templates/projects/index.html'),
templateUrl: '../../templates/projects/index.html',
controller: 'ProjectsController'
}
},
@ -267,7 +267,7 @@ angular.module('application.router', ['ui.router'])
url: '/projects/new',
views: {
'main@': {
template: require('../../templates/projects/new.html'),
templateUrl: '../../templates/projects/new.html',
controller: 'NewProjectController'
}
},
@ -279,7 +279,7 @@ angular.module('application.router', ['ui.router'])
url: '/projects/:id',
views: {
'main@': {
template: require('../../templates/projects/show.html'),
templateUrl: '../../templates/projects/show.html',
controller: 'ShowProjectController'
}
},
@ -292,7 +292,7 @@ angular.module('application.router', ['ui.router'])
url: '/projects/:id/edit',
views: {
'main@': {
template: require('../../templates/projects/edit.html'),
templateUrl: '../../templates/projects/edit.html',
controller: 'EditProjectController'
}
},
@ -307,7 +307,7 @@ angular.module('application.router', ['ui.router'])
url: '/machines',
views: {
'main@': {
template: require('../../templates/machines/index.html'),
templateUrl: '../../templates/machines/index.html',
controller: 'MachinesController'
}
},
@ -320,7 +320,7 @@ angular.module('application.router', ['ui.router'])
url: '/machines/new',
views: {
'main@': {
template: require('../../templates/machines/new.html'),
templateUrl: '../../templates/machines/new.html',
controller: 'NewMachineController'
}
}
@ -329,7 +329,7 @@ angular.module('application.router', ['ui.router'])
url: '/machines/:id',
views: {
'main@': {
template: require('../../templates/machines/show.html'),
templateUrl: '../../templates/machines/show.html',
controller: 'ShowMachineController'
}
},
@ -341,7 +341,7 @@ angular.module('application.router', ['ui.router'])
url: '/machines/:id/reserve',
views: {
'main@': {
template: require('../../templates/machines/reserve.html'),
templateUrl: '../../templates/machines/reserve.html',
controller: 'ReserveMachineController'
}
},
@ -362,7 +362,7 @@ angular.module('application.router', ['ui.router'])
url: '/machines/:id/edit',
views: {
'main@': {
template: require('../../templates/machines/edit.html'),
templateUrl: '../../templates/machines/edit.html',
controller: 'EditMachineController'
}
},
@ -377,7 +377,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.spacesModule,
views: {
'main@': {
template: require('../../templates/spaces/index.html'),
templateUrl: '../../templates/spaces/index.html',
controller: 'SpacesController'
}
},
@ -391,7 +391,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.spacesModule,
views: {
'main@': {
template: require('../../templates/spaces/new.html'),
templateUrl: '../../templates/spaces/new.html',
controller: 'NewSpaceController'
}
}
@ -401,7 +401,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.spacesModule,
views: {
'main@': {
template: require('../../templates/spaces/show.html'),
templateUrl: '../../templates/spaces/show.html',
controller: 'ShowSpaceController'
}
},
@ -414,7 +414,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.spacesModule,
views: {
'main@': {
template: require('../../templates/spaces/edit.html'),
templateUrl: '../../templates/spaces/edit.html',
controller: 'EditSpaceController'
}
},
@ -427,7 +427,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.spacesModule,
views: {
'main@': {
template: require('../../templates/spaces/reserve.html'),
templateUrl: '../../templates/spaces/reserve.html',
controller: 'ReserveSpaceController'
}
},
@ -451,7 +451,7 @@ angular.module('application.router', ['ui.router'])
url: '/trainings',
views: {
'main@': {
template: require('../../templates/trainings/index.html'),
templateUrl: '../../templates/trainings/index.html',
controller: 'TrainingsController'
}
},
@ -463,7 +463,7 @@ angular.module('application.router', ['ui.router'])
url: '/trainings/:id',
views: {
'main@': {
template: require('../../templates/trainings/show.html'),
templateUrl: '../../templates/trainings/show.html',
controller: 'ShowTrainingController'
}
},
@ -475,7 +475,7 @@ angular.module('application.router', ['ui.router'])
url: '/trainings/:id/reserve',
views: {
'main@': {
template: require('../../templates/trainings/reserve.html'),
templateUrl: '../../templates/trainings/reserve.html',
controller: 'ReserveTrainingController'
}
},
@ -501,7 +501,7 @@ angular.module('application.router', ['ui.router'])
url: '/notifications',
views: {
'main@': {
template: require('../../templates/notifications/index.html'),
templateUrl: '../../templates/notifications/index.html',
controller: 'NotificationsController'
}
}
@ -513,7 +513,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.plansModule,
views: {
'main@': {
template: require('../../templates/plans/index.html'),
templateUrl: '../../templates/plans/index.html',
controller: 'PlansIndexController'
}
},
@ -530,7 +530,7 @@ angular.module('application.router', ['ui.router'])
url: '/events',
views: {
'main@': {
template: require('../../templates/events/index.html'),
templateUrl: '../../templates/events/index.html',
controller: 'EventsController'
}
},
@ -545,7 +545,7 @@ angular.module('application.router', ['ui.router'])
url: '/events/:id',
views: {
'main@': {
template: require('../../templates/events/show.html'),
templateUrl: '../../templates/events/show.html',
controller: 'ShowEventController'
}
},
@ -561,7 +561,7 @@ angular.module('application.router', ['ui.router'])
url: '/calendar',
views: {
'main@': {
template: require('../../templates/calendar/calendar.html'),
templateUrl: '../../templates/calendar/calendar.html',
controller: 'CalendarController'
}
},
@ -581,7 +581,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/calendar',
views: {
'main@': {
template: require('../../templates/admin/calendar/calendar.html'),
templateUrl: '../../templates/admin/calendar/calendar.html',
controller: 'AdminCalendarController'
}
},
@ -598,7 +598,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/calendar/icalendar',
views: {
'main@': {
template: require('../../templates/admin/calendar/icalendar.html'),
templateUrl: '../../templates/admin/calendar/icalendar.html',
controller: 'AdminICalendarController'
}
},
@ -612,7 +612,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/projects',
views: {
'main@': {
template: require('../../templates/admin/projects/index.html'),
templateUrl: '../../templates/admin/projects/index.html',
controller: 'AdminProjectsController'
}
},
@ -632,7 +632,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/abuses',
views: {
'main@': {
template: require('../../templates/admin/abuses/index.html'),
templateUrl: '../../templates/admin/abuses/index.html',
controller: 'AbusesController'
}
},
@ -646,7 +646,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/trainings',
views: {
'main@': {
template: require('../../templates/admin/trainings/index.html'),
templateUrl: '../../templates/admin/trainings/index.html',
controller: 'TrainingsAdminController'
}
},
@ -660,7 +660,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/trainings/new',
views: {
'main@': {
template: require('../../templates/admin/trainings/new.html'),
templateUrl: '../../templates/admin/trainings/new.html',
controller: 'NewTrainingController'
}
},
@ -672,7 +672,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/trainings/:id/edit',
views: {
'main@': {
template: require('../../templates/admin/trainings/edit.html'),
templateUrl: '../../templates/admin/trainings/edit.html',
controller: 'EditTrainingController'
}
},
@ -686,7 +686,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/events',
views: {
'main@': {
template: require('../../templates/admin/events/index.html'),
templateUrl: '../../templates/admin/events/index.html',
controller: 'AdminEventsController'
}
},
@ -703,7 +703,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/events/new',
views: {
'main@': {
template: require('../../templates/events/new.html'),
templateUrl: '../../templates/events/new.html',
controller: 'NewEventController'
}
},
@ -718,7 +718,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/events/:id/edit',
views: {
'main@': {
template: require('../../templates/events/edit.html'),
templateUrl: '../../templates/events/edit.html',
controller: 'EditEventController'
}
},
@ -734,7 +734,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/events/:id/reservations',
views: {
'main@': {
template: require('../../templates/admin/events/reservations.html'),
templateUrl: '../../templates/admin/events/reservations.html',
controller: 'ShowEventReservationsController'
}
},
@ -749,7 +749,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/pricing',
views: {
'main@': {
template: require('../../templates/admin/pricing/index.html'),
templateUrl: '../../templates/admin/pricing/index.html',
controller: 'EditPricingController'
}
},
@ -783,7 +783,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/plans/new',
views: {
'main@': {
template: require('../../templates/admin/plans/new.html'),
templateUrl: '../../templates/admin/plans/new.html',
controller: 'NewPlanController'
}
}
@ -792,7 +792,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/plans/:id/edit',
views: {
'main@': {
template: require('../../templates/admin/plans/edit.html'),
templateUrl: '../../templates/admin/plans/edit.html',
controller: 'EditPlanController'
}
},
@ -809,7 +809,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/coupons/new',
views: {
'main@': {
template: require('../../templates/admin/coupons/new.html'),
templateUrl: '../../templates/admin/coupons/new.html',
controller: 'NewCouponController'
}
}
@ -818,7 +818,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/coupons/:id/edit',
views: {
'main@': {
template: require('../../templates/admin/coupons/edit.html'),
templateUrl: '../../templates/admin/coupons/edit.html',
controller: 'EditCouponController'
}
},
@ -832,7 +832,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/invoices',
views: {
'main@': {
template: require('../../templates/admin/invoices/index.html'),
templateUrl: '../../templates/admin/invoices/index.html',
controller: 'InvoicesController'
}
},
@ -865,19 +865,19 @@ angular.module('application.router', ['ui.router'])
url: '/admin/members',
views: {
'main@': {
template: require('../../templates/admin/members/index.html'),
templateUrl: '../../templates/admin/members/index.html',
controller: 'AdminMembersController'
},
'groups@app.admin.members': {
template: require('../../templates/admin/groups/index.html'),
templateUrl: '../../templates/admin/groups/index.html',
controller: 'GroupsController'
},
'tags@app.admin.members': {
template: require('../../templates/admin/tags/index.html'),
templateUrl: '../../templates/admin/tags/index.html',
controller: 'TagsController'
},
'authentification@app.admin.members': {
template: require('../../templates/admin/authentications/index.html'),
templateUrl: '../../templates/admin/authentications/index.html',
controller: 'AuthentificationController'
}
},
@ -896,7 +896,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/members/new',
views: {
'main@': {
template: require('../../templates/admin/members/new.html'),
templateUrl: '../../templates/admin/members/new.html',
controller: 'NewMemberController'
}
},
@ -908,7 +908,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/members/import',
views: {
'main@': {
template: require('../../templates/admin/members/import.html'),
templateUrl: '../../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@': {
template: require('../../templates/admin/members/import_result.html'),
templateUrl: '../../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@': {
template: require('../../templates/admin/members/edit.html'),
templateUrl: '../../templates/admin/members/edit.html',
controller: 'EditMemberController'
}
},
@ -949,7 +949,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/admins/new',
views: {
'main@': {
template: require('../../templates/admin/admins/new.html'),
templateUrl: '../../templates/admin/admins/new.html',
controller: 'NewAdminController'
}
},
@ -961,7 +961,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/managers/new',
views: {
'main@': {
template: require('../../templates/admin/managers/new.html'),
templateUrl: '../../templates/admin/managers/new.html',
controller: 'NewManagerController'
}
},
@ -976,7 +976,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/authentications/new',
views: {
'main@': {
template: require('../../templates/admin/authentications/new.html'),
templateUrl: '../../templates/admin/authentications/new.html',
controller: 'NewAuthenticationController'
}
},
@ -989,7 +989,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/authentications/:id/edit',
views: {
'main@': {
template: require('../../templates/admin/authentications/edit.html'),
templateUrl: '../../templates/admin/authentications/edit.html',
controller: 'EditAuthenticationController'
}
},
@ -1005,7 +1005,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.statisticsModule,
views: {
'main@': {
template: require('../../templates/admin/statistics/index.html'),
templateUrl: '../../templates/admin/statistics/index.html',
controller: 'StatisticsController'
}
},
@ -1020,7 +1020,7 @@ angular.module('application.router', ['ui.router'])
abstract: !Fablab.statisticsModule,
views: {
'main@': {
template: require('../../templates/admin/statistics/graphs.html'),
templateUrl: '../../templates/admin/statistics/graphs.html',
controller: 'GraphsController'
}
}
@ -1031,7 +1031,7 @@ angular.module('application.router', ['ui.router'])
url: '/admin/settings',
views: {
'main@': {
template: require('../../templates/admin/settings/index.html'),
templateUrl: '../../templates/admin/settings/index.html',
controller: 'SettingsController'
}
},
@ -1064,7 +1064,7 @@ angular.module('application.router', ['ui.router'])
url: '/open_api_clients',
views: {
'main@': {
template: require('../../templates/admin/open_api_clients/index.html.erb'),
templateUrl: '../../templates/admin/open_api_clients/index.html.erb',
controller: 'OpenAPIClientsController'
}
},

View File

@ -4,7 +4,7 @@ Application.Services.factory('dialogs', ['$uibModal', function ($uibModal) {
return ({
confirm (options, success, error) {
const defaultOpts = {
template: require('../../../templates/shared/confirm_modal.html'),
templateUrl: '../../../templates/shared/confirm_modal.html',
size: 'sm',
resolve: {
object () {

View File

@ -34,7 +34,7 @@ Application.Services.factory('Help', ['$rootScope', '$uibModal', '$state', 'Auth
$uibModal.open({
animation: true,
template: require('../../../templates/shared/help_modal.html'),
templateUrl: '../../../templates/shared/help_modal.html',
resolve: {
tourName: function () { return tourName; }
},

View File

@ -1,12 +1,14 @@
const { environment } = require('@rails/webpacker');
const webpack = require('webpack');
const path = require('path');
const htmlErb = require('./loaders/html_erb');
const js = require('./loaders/js');
const jsErb = require('./loaders/js_erb');
const sass = require('./loaders/sass');
const sassErb = require('./loaders/sass_erb');
const html = require('./loaders/html');
const webpack = require('webpack');
const path = require('path');
const uiTour = require('./loaders/ui-tour');
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
$: 'jquery',
@ -25,6 +27,7 @@ environment.loaders.prepend('sass-erb', sassErb);
environment.loaders.prepend('js', js);
environment.loaders.append('html', html);
environment.loaders.append('sass', sass);
environment.loaders.append('uiTour', uiTour);
environment.splitChunks();

View File

@ -5,7 +5,7 @@ module.exports = {
{
loader: 'auto-ngtemplate-loader',
options: {
pathResolver: (p) => p.replace(/src\/javascript\/.*$/, 'templates')
pathResolver: (p) => p.replace(/src\/javascript\/.*$/, 'templates/')
}
}
]

View File

@ -0,0 +1,17 @@
const path = require('path');
module.exports = {
test: /angular-ui-tour\/.*\.html$/i,
use: [
{
loader: 'ngtemplate-loader',
options: {
relativeTo: path.join(__dirname, '../../../node_modules/angular-ui-tour/app/templates'),
requireAngular: true
}
},
{
loader: 'html-loader'
}
]
};