diff --git a/web/components/Account/Place/Schedule.tsx b/web/components/Account/Place/Schedule.tsx index a07125e..ffc117c 100644 --- a/web/components/Account/Place/Schedule.tsx +++ b/web/components/Account/Place/Schedule.tsx @@ -28,6 +28,7 @@ export const StyleWrapper = styled.div` z-index: 11; border-radius: 8px; margin: 3px 2px 3px 2px; + mix-blend-mode: multiply; } ` diff --git a/web/components/Account/Place/ScheduleSlot.tsx b/web/components/Account/Place/ScheduleSlot.tsx index d0eae83..95e1a8f 100644 --- a/web/components/Account/Place/ScheduleSlot.tsx +++ b/web/components/Account/Place/ScheduleSlot.tsx @@ -4,6 +4,7 @@ import { ScheduleEventWhen } from '~@types/schedule-event.d' import isSameDay from 'date-fns/isSameDay' import ScheduleContext from '~components/Account/Place/ScheduleContext' import PeriodEvent from '~components/Place/PeriodEvent' +import useCampaignContext from '~components/Campaign/useCampaignContext' const styleSelected = { border: '1px dashed', @@ -58,6 +59,7 @@ const Event = ({ isCampaignMode = false, }) => { const { setToDelete, eventsIdToDelete, place } = useContext(ScheduleContext) + const { currentCampaign } = useCampaignContext() const isPeriod = useMemo(() => { if (!range) return null return !isSameDay(range.start, range.end) @@ -68,8 +70,14 @@ const Event = ({ id, ]) - const isDisabled = + const isFromOtherTab = (isCampaignMode && !isCampaignEvent) || (!isCampaignMode && isCampaignEvent) + const isClosedDispoMode = + isCampaignMode && + isCampaignEvent && + currentCampaign.mode !== 'disponibilities' + + const isDisabled = isFromOtherTab || isClosedDispoMode return ( {isPeriod && ( { - + + + {showForm ? ( diff --git a/web/components/Campaign/Places/Admin/CampaignScheduleForm.tsx b/web/components/Campaign/Places/Admin/CampaignScheduleForm.tsx index 50ce874..bb77af4 100644 --- a/web/components/Campaign/Places/Admin/CampaignScheduleForm.tsx +++ b/web/components/Campaign/Places/Admin/CampaignScheduleForm.tsx @@ -23,6 +23,7 @@ import { client } from '~api/client-api' import { setHours } from 'date-fns' import useCampaignContext from '~components/Campaign/useCampaignContext' import { format } from '~utils/date' +import Schedule from '~components/Account/Place/Schedule' export const STAFF_VALUES = ['no', 'light', 'sound', 'video', 'scene'] @@ -132,6 +133,10 @@ const CampaignScheduleForm = ({ place, hideForm }: Props) => { + + + + { {currentCampaign?.mode === 'disponibilities' ? t( - `campaign.helpers.disponibilities.schedule.open_disponibilities`, + `campaign.helpers.disponibilities.schedule.${ + currentCampaign?.disponibilities_max === 1 + ? 'open_disponibility' + : 'open_disponibilities' + }`, { title: currentCampaign?.title }, ) : t( @@ -91,7 +95,7 @@ const CampaignScheduleInfo = ({ place, showForm }: Props) => { variant="outline" colorScheme="blue" as={Link} - href={`${ROUTE_ACCOUNT_APPLICATIONS}?espace=${place.id}&disponibility=${campaignDispos[0]?.id}`} + href={`${ROUTE_ACCOUNT_APPLICATIONS}?campaign=${currentCampaign?.id}&espace=${place.id}&disponibility=${campaignDispos[0]?.id}`} > {t('campaign.helpers.applications.schedule.see_applications')} diff --git a/web/public/locales/fr/place.json b/web/public/locales/fr/place.json index b1ba0a4..6360d21 100644 --- a/web/public/locales/fr/place.json +++ b/web/public/locales/fr/place.json @@ -586,7 +586,8 @@ "schedule": { "title": "Ajoutez ou modifiez vos créneaux avant le {{disponibility_end}}. ", "description": "\n Vous pouvez ajouter jusqu’à {{disponibilities_max}} créneaux dédiés au dispositif {{title}} pour un même espace. Les créneaux doivent impérativement faire {{duration}} jours, et se dérouler entre le {{campaign_start}} et le {{campaign_end}}", - "open_disponibilities": "créneaux qui seront ouverts à candidatures {{title}}" + "open_disponibilities": "créneaux qui seront ouverts à candidatures {{title}}", + "open_disponibility": "créneau qui sera ouvert à candidatures {{title}}" } } }