diff --git a/app/frontend/src/javascript/components/events/events-settings.tsx b/app/frontend/src/javascript/components/events/events-settings.tsx index 715b6c95e..51d52390d 100644 --- a/app/frontend/src/javascript/components/events/events-settings.tsx +++ b/app/frontend/src/javascript/components/events/events-settings.tsx @@ -10,18 +10,21 @@ import { EditorialKeys, EditorialBlockForm } from '../editorial-block/editorial- import SettingAPI from '../../api/setting'; import SettingLib from '../../lib/setting'; import { SettingName, SettingValue, eventsSettings } from '../../models/setting'; +import { UnsavedFormAlert } from '../form/unsaved-form-alert'; +import { UIRouter } from '@uirouter/angularjs'; declare const Application: IApplication; interface EventsSettingsProps { onError: (message: string) => void, onSuccess: (message: string) => void + uiRouter: UIRouter } /** * Events settings */ -export const EventsSettings: React.FC = ({ onError, onSuccess }) => { +export const EventsSettings: React.FC = ({ onError, onSuccess, uiRouter }) => { const { t } = useTranslation('admin'); const { register, control, formState, handleSubmit, reset } = useForm>(); @@ -57,6 +60,7 @@ export const EventsSettings: React.FC = ({ onError, onSucce {t('app.admin.events_settings.save')}
+
= (props) => { ); }; -Application.Components.component('eventsSettings', react2angular(EventsSettingsWrapper, ['onError', 'onSuccess'])); +Application.Components.component('eventsSettings', react2angular(EventsSettingsWrapper, ['onError', 'onSuccess', 'uiRouter'])); diff --git a/app/frontend/src/javascript/components/trainings/trainings.tsx b/app/frontend/src/javascript/components/trainings/trainings.tsx index 5fffd35fe..908bf6b9d 100644 --- a/app/frontend/src/javascript/components/trainings/trainings.tsx +++ b/app/frontend/src/javascript/components/trainings/trainings.tsx @@ -14,10 +14,6 @@ import type { Machine } from '../../models/machine'; import TrainingAPI from '../../api/training'; import MachineAPI from '../../api/machine'; import { EditDestroyButtons } from '../base/edit-destroy-buttons'; -import { EditorialBlock } from '../editorial-block/editorial-block'; -import { SettingValue, trainingsSettings } from '../../models/setting'; -import SettingAPI from '../../api/setting'; -import SettingLib from '../../lib/setting'; declare const Application: IApplication; diff --git a/app/frontend/src/javascript/controllers/admin/events.js b/app/frontend/src/javascript/controllers/admin/events.js index b9efd4302..61a2bd6c3 100644 --- a/app/frontend/src/javascript/controllers/admin/events.js +++ b/app/frontend/src/javascript/controllers/admin/events.js @@ -51,8 +51,8 @@ class EventsController { /** * Controller used in the events listing page (admin view) */ -Application.Controllers.controller('AdminEventsController', ['$scope', '$state', 'dialogs', '$uibModal', 'growl', 'AuthService', 'Event', 'Category', 'EventTheme', 'AgeRange', 'PriceCategory', 'eventsPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t', 'Member', 'uiTourService', 'settingsPromise', - function ($scope, $state, dialogs, $uibModal, growl, AuthService, Event, Category, EventTheme, AgeRange, PriceCategory, eventsPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t, Member, uiTourService, settingsPromise) { +Application.Controllers.controller('AdminEventsController', ['$scope', '$state', 'dialogs', '$uibModal', 'growl', 'AuthService', 'Event', 'Category', 'EventTheme', 'AgeRange', 'PriceCategory', 'eventsPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t', 'Member', 'uiTourService', 'settingsPromise', '$uiRouter', + function ($scope, $state, dialogs, $uibModal, growl, AuthService, Event, Category, EventTheme, AgeRange, PriceCategory, eventsPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t, Member, uiTourService, settingsPromise, $uiRouter) { /* PUBLIC SCOPE */ /** @@ -62,6 +62,9 @@ Application.Controllers.controller('AdminEventsController', ['$scope', '$state', growl.success(message); }; + // the following item is used by the UnsavedFormAlert component to detect a page change + $scope.uiRouter = $uiRouter; + /** * Callback triggered by react components */ diff --git a/app/frontend/src/stylesheets/application.scss b/app/frontend/src/stylesheets/application.scss index 1a8661447..990e450ef 100644 --- a/app/frontend/src/stylesheets/application.scss +++ b/app/frontend/src/stylesheets/application.scss @@ -48,6 +48,7 @@ @import "modules/dashboard/reservations/reservations-dashboard"; @import "modules/dashboard/reservations/reservations-panel"; @import "modules/events/event"; +@import "modules/events/events"; @import "modules/events/event-form"; @import "modules/events/update-recurrent-modal"; @import "modules/events/events-settings.scss"; @@ -65,6 +66,7 @@ @import "modules/invoices/invoices-settings-panel"; @import "modules/invoices/vat-settings-modal"; @import "modules/layout/header-page"; +@import "modules/machines/machines"; @import "modules/machines/machine-card"; @import "modules/machines/machine-categories"; @import "modules/machines/machine-form"; diff --git a/app/frontend/src/stylesheets/modules/events/events.scss b/app/frontend/src/stylesheets/modules/events/events.scss new file mode 100644 index 000000000..6d6339fa4 --- /dev/null +++ b/app/frontend/src/stylesheets/modules/events/events.scss @@ -0,0 +1,7 @@ +.events { + max-width: 1600px; + margin: 2rem; + padding-bottom: 6rem; + display: grid; + gap: 2.4rem; +} diff --git a/app/frontend/src/stylesheets/modules/machines/machines.scss b/app/frontend/src/stylesheets/modules/machines/machines.scss new file mode 100644 index 000000000..a1e6da033 --- /dev/null +++ b/app/frontend/src/stylesheets/modules/machines/machines.scss @@ -0,0 +1,7 @@ +.machines { + max-width: 1600px; + margin: 2rem; + padding-bottom: 6rem; + display: grid; + gap: 2.4rem; +} diff --git a/app/frontend/templates/admin/events/index.html b/app/frontend/templates/admin/events/index.html index b9ae49dc4..9d4d8bd93 100644 --- a/app/frontend/templates/admin/events/index.html +++ b/app/frontend/templates/admin/events/index.html @@ -29,7 +29,7 @@
- + diff --git a/app/frontend/templates/events/index.html b/app/frontend/templates/events/index.html index 985e52bf3..d851bea07 100644 --- a/app/frontend/templates/events/index.html +++ b/app/frontend/templates/events/index.html @@ -19,23 +19,23 @@
-
+
-
-
+
+
-
+
-
+
diff --git a/app/frontend/templates/machines/index.html b/app/frontend/templates/machines/index.html index 19cb6de75..2bb53d553 100644 --- a/app/frontend/templates/machines/index.html +++ b/app/frontend/templates/machines/index.html @@ -13,7 +13,7 @@
-