diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index 4d05f6b56..781e170ba 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -97,6 +97,7 @@ class API::EventsController < API::APIController event_preparams = params.required(:event).permit(:title, :description, :start_date, :start_time, :end_date, :end_time, :amount, :nb_total_places, :availability_id, :all_day, :recurrence, :recurrence_end_at, :category_id, :event_theme_ids, :age_range_id, :event_type, + :pre_registration, :pre_registration_end_date, event_theme_ids: [], event_image_attributes: %i[id attachment], event_files_attributes: %i[id attachment _destroy], diff --git a/app/frontend/src/javascript/components/events/event-form.tsx b/app/frontend/src/javascript/components/events/event-form.tsx index 5ed6a7036..0d8c0b81b 100644 --- a/app/frontend/src/javascript/components/events/event-form.tsx +++ b/app/frontend/src/javascript/components/events/event-form.tsx @@ -55,6 +55,7 @@ export const EventForm: React.FC = ({ action, event, onError, on const [updatingEvent, setUpdatingEvent] = useState(null); const [isActiveAccounting, setIsActiveAccounting] = useState(false); const [isActiveFamilyAccount, setIsActiveFamilyAccount] = useState(false); + const [isAcitvePreRegistration, setIsActivePreRegistration] = useState(event?.pre_registration); useEffect(() => { EventCategoryAPI.index() @@ -241,6 +242,19 @@ export const EventForm: React.FC = ({ action, event, onError, on formState={formState} options={ageRangeOptions} label={t('app.admin.event_form.age_range')} />} + + {isAcitvePreRegistration && + + } diff --git a/app/frontend/src/javascript/models/event.ts b/app/frontend/src/javascript/models/event.ts index 892ca95dc..7f72b1974 100644 --- a/app/frontend/src/javascript/models/event.ts +++ b/app/frontend/src/javascript/models/event.ts @@ -66,6 +66,8 @@ export interface Event { recurrence_end_at: Date, advanced_accounting_attributes?: AdvancedAccounting, event_type: EventType, + pre_registration?: boolean, + pre_registration_end_date?: TDateISODate | Date, } export interface EventDecoration { diff --git a/app/frontend/templates/events/show.html b/app/frontend/templates/events/show.html index 66f217f80..6a3c9652e 100644 --- a/app/frontend/templates/events/show.html +++ b/app/frontend/templates/events/show.html @@ -255,11 +255,11 @@ -