mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
display of calendar form
This commit is contained in:
parent
c31886fea3
commit
543d30acb9
@ -168,7 +168,7 @@ class CalendarController extends AbstractController
|
|||||||
|
|
||||||
$params = $this->buildParamsToUrl($user, $accompanyingPeriod);
|
$params = $this->buildParamsToUrl($user, $accompanyingPeriod);
|
||||||
|
|
||||||
return $this->redirectToRoute('chill_calendar_calendar_list', $params);
|
return $this->redirectToRoute('chill_calendar_calendar_list_by_period', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($form->isSubmitted() && !$form->isValid()) {
|
if ($form->isSubmitted() && !$form->isValid()) {
|
||||||
@ -403,7 +403,7 @@ class CalendarController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $accompanyingPeriod) {
|
if (null !== $accompanyingPeriod) {
|
||||||
$params['accompanying_period_id'] = $accompanyingPeriod->getId();
|
$params['id'] = $accompanyingPeriod->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
|
@ -486,7 +486,10 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->calendarRange = $calendarRange;
|
$this->calendarRange = $calendarRange;
|
||||||
$this->calendarRange->setCalendar($this);
|
|
||||||
|
if ($this->calendarRange instanceof CalendarRange) {
|
||||||
|
$this->calendarRange->setCalendar($this);
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<teleport to="#mainUser">
|
<teleport to="#mainUser">
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">
|
<h2 class="chill-red">Utilisateur principal</h2>
|
||||||
<label>Utilisateur principal</label>
|
<div>
|
||||||
</div>
|
<div>
|
||||||
<div class="col-md-8 align-content-end">
|
<div v-if="null !== this.$store.getters.getMainUser">
|
||||||
|
<calendar-active :user="this.$store.getters.getMainUser" ></calendar-active>
|
||||||
|
</div>
|
||||||
<pick-entity
|
<pick-entity
|
||||||
:multiple="false"
|
:multiple="false"
|
||||||
:types="['user']"
|
:types="['user']"
|
||||||
:uniqid="'main_user_calendar'"
|
:uniqid="'main_user_calendar'"
|
||||||
:picked="null !== this.$store.getters.getMainUser ? [this.$store.getters.getMainUser] : []"
|
:picked="null !== this.$store.getters.getMainUser ? [this.$store.getters.getMainUser] : []"
|
||||||
:removableIfSet="false"
|
:removableIfSet="false"
|
||||||
|
:displayPicked="false"
|
||||||
@addNewEntity="setMainUser"
|
@addNewEntity="setMainUser"
|
||||||
></pick-entity>
|
></pick-entity>
|
||||||
</div>
|
</div>
|
||||||
@ -20,27 +23,40 @@
|
|||||||
|
|
||||||
<concerned-groups></concerned-groups>
|
<concerned-groups></concerned-groups>
|
||||||
|
|
||||||
|
<teleport to="#schedule">
|
||||||
|
<div class="row mb-3" v-if="activity.startDate !== null">
|
||||||
|
<label class="col-form-label col-sm-4">Date</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
{{ $d(activity.startDate, 'long') }} - {{ $d(activity.endDate, 'hoursOnly') }}
|
||||||
|
<span v-if="activity.calendarRange === null">(Pas de plage de disponibilité sélectionnée)</span>
|
||||||
|
<span v-else>(Une plage de disponibilité sélectionnée)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</teleport>
|
||||||
|
|
||||||
<location></location>
|
<location></location>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<teleport to="#fullCalendar">
|
<teleport to="#fullCalendar">
|
||||||
<div>
|
<div class="calendar-actives">
|
||||||
<template class="" v-for="u in getActiveUsers" :key="u.id">
|
<template class="" v-for="u in getActiveUsers" :key="u.id">
|
||||||
<calendar-active :user="u" ></calendar-active>
|
<calendar-active :user="u" ></calendar-active>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-between">
|
<div class="display-options row justify-content-between">
|
||||||
<div class="col-sm-4 col-xs-12">
|
<div class="col-sm col-xs-12">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<label class="input-group-text" for="slotDuration">Durée des créneaux</label>
|
<label class="input-group-text" for="slotDuration">Durée des créneaux</label>
|
||||||
<select v-model="this.slotDuration" id="slotDuration" class="form-select">
|
<select v-model="this.slotDuration" id="slotDuration" class="form-select">
|
||||||
<option value="00:05:00">5</option>
|
<option value="00:05:00">5 minutes</option>
|
||||||
<option value="00:10:00">10</option>
|
<option value="00:10:00">10 minutes</option>
|
||||||
<option value="00:15:00">15</option>
|
<option value="00:15:00">15 minutes</option>
|
||||||
<option value="00:30:00">30</option>
|
<option value="00:30:00">30 minutes</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 col-xs-12">
|
<div class="col-sm col-xs-12">
|
||||||
<div class="float-end">
|
<div class="float-end">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
@ -210,3 +226,14 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.calendar-actives {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.display-options {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="style" style="display: inline-block;">
|
<div :style="style" class="calendar-active">
|
||||||
<span class="badge-user">{{ user.text }}</span>
|
<span class="badge-user">{{ user.text }}</span>
|
||||||
<span class="form-check-inline form-switch">
|
<span class="form-check-inline form-switch">
|
||||||
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault" v-model="rangeShow">
|
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault" v-model="rangeShow">
|
||||||
<label class="form-check-label" for="flexSwitchCheckDefault">Disponibilité</label>
|
<label class="form-check-label" for="flexSwitchCheckDefault" title="Disponibilités"><i class="fa fa-calendar-check-o"></i></label>
|
||||||
</span>
|
</span>
|
||||||
<span class="form-check-inline form-switch">
|
<span class="form-check-inline form-switch">
|
||||||
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault" v-model="remoteShow">
|
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault" v-model="remoteShow">
|
||||||
<label class="form-check-label" for="flexSwitchCheckDefault">Agenda</label>
|
<label class="form-check-label" for="flexSwitchCheckDefault" title="Agenda"><i class="fa fa-calendar"></i></label>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -45,6 +45,16 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
.calendar-active {
|
||||||
|
margin: 0 0.25rem 0.25rem 0;
|
||||||
|
padding: 0.5rem;
|
||||||
|
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
|
||||||
|
& > .badge-user {
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -62,8 +62,6 @@ export default {
|
|||||||
const userData = state.usersData.get(userId);
|
const userData = state.usersData.get(userId);
|
||||||
|
|
||||||
if (kinds.ranges && userData.calendarRanges.length > 0) {
|
if (kinds.ranges && userData.calendarRanges.length > 0) {
|
||||||
console.log('first range', userData.calendarRanges[0]);
|
|
||||||
console.log('state activity', state.activity);
|
|
||||||
const s = {
|
const s = {
|
||||||
id: `ranges_${userId}`,
|
id: `ranges_${userId}`,
|
||||||
events: userData.calendarRanges.filter(r => state.activity.calendarRange === null || r.calendarRangeId !== state.activity.calendarRange.calendarRangeId),
|
events: userData.calendarRanges.filter(r => state.activity.calendarRange === null || r.calendarRangeId !== state.activity.calendarRange.calendarRangeId),
|
||||||
@ -92,7 +90,6 @@ export default {
|
|||||||
return sources;
|
return sources;
|
||||||
},
|
},
|
||||||
getInitialDate(state) {
|
getInitialDate(state) {
|
||||||
console.log('initialDate', state.activity.startDate);
|
|
||||||
return state.activity.startDate;
|
return state.activity.startDate;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -47,8 +47,6 @@ const store = createStore({
|
|||||||
actions,
|
actions,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('calendar event', store.state.activity);
|
|
||||||
|
|
||||||
whoami().then(me => {
|
whoami().then(me => {
|
||||||
store.commit('setWhoAmiI', me);
|
store.commit('setWhoAmiI', me);
|
||||||
});
|
});
|
||||||
@ -61,4 +59,6 @@ for (let u of store.state.activity.users) {
|
|||||||
store.commit('showUserOnCalendar', {ranges: false, remotes: false, user: u});
|
store.commit('showUserOnCalendar', {ranges: false, remotes: false, user: u});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('store', store);
|
||||||
|
|
||||||
export default store;
|
export default store;
|
||||||
|
@ -53,7 +53,7 @@ const createUserData = (user, colorIndex) => {
|
|||||||
const calendarRangeToFullCalendarEvent = (entity) => {
|
const calendarRangeToFullCalendarEvent = (entity) => {
|
||||||
return {
|
return {
|
||||||
id: `range_${entity.id}`,
|
id: `range_${entity.id}`,
|
||||||
title: "",
|
title: "(" + entity.user.text + ")",
|
||||||
start: entity.startDate.datetime8601,
|
start: entity.startDate.datetime8601,
|
||||||
end: entity.endDate.datetime8601,
|
end: entity.endDate.datetime8601,
|
||||||
allDay: false,
|
allDay: false,
|
||||||
|
@ -24,12 +24,15 @@
|
|||||||
|
|
||||||
<div id="add-persons"></div>
|
<div id="add-persons"></div>
|
||||||
|
|
||||||
|
<h2 class="chill-red">{{ 'Calendar data'|trans }}</h2>
|
||||||
|
|
||||||
|
<div id="schedule"></div>
|
||||||
|
|
||||||
{%- if form.location is defined -%}
|
{%- if form.location is defined -%}
|
||||||
{{ form_row(form.location) }}
|
{{ form_row(form.location) }}
|
||||||
<div id="location"></div>
|
<div id="location"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h2 class="chill-red">{{ 'Calendar data'|trans }}</h2>
|
|
||||||
|
|
||||||
{%- if form.startDate is defined -%}
|
{%- if form.startDate is defined -%}
|
||||||
{{ form_row(form.startDate) }}
|
{{ form_row(form.startDate) }}
|
||||||
@ -77,7 +80,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-create" type="submit">
|
<button class="btn btn-create" type="submit">
|
||||||
{{ 'Update'|trans }}
|
{{ 'Save'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('DOMContentLoaded', function (e) {
|
|
||||||
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ form.vars.form.vars.name }}"]',
|
|
||||||
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
|
||||||
});
|
|
||||||
window.entity = {{ entity_json|json_encode|raw }};
|
window.entity = {{ entity_json|json_encode|raw }};
|
||||||
window.startDate = {{ entity.startDate|date('Y-m-d H:i:s')|json_encode|raw }};
|
window.startDate = {{ entity.startDate|date('Y-m-d H:i:s')|json_encode|raw }};
|
||||||
window.endDate = {{ entity.endDate|date('Y-m-d H:i:s')|json_encode|raw }};
|
window.endDate = {{ entity.endDate|date('Y-m-d H:i:s')|json_encode|raw }};
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('DOMContentLoaded', function (e) {
|
|
||||||
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
|
|
||||||
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
|
||||||
});
|
|
||||||
window.entity = {{ entity_json|json_encode|raw }};
|
window.entity = {{ entity_json|json_encode|raw }};
|
||||||
</script>
|
</script>
|
||||||
{{ encore_entry_script_tags('vue_calendar') }}
|
{{ encore_entry_script_tags('vue_calendar') }}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul :class="listClasses" v-if="picked.length">
|
<ul :class="listClasses" v-if="picked.length && displayPicked">
|
||||||
<li v-for="p in picked" @click="removeEntity(p)" :key="p.type+p.id">
|
<li v-for="p in picked" @click="removeEntity(p)" :key="p.type+p.id">
|
||||||
<span class="chill_denomination">{{ p.text }}</span>
|
<span class="chill_denomination">{{ p.text }}</span>
|
||||||
</li>
|
</li>
|
||||||
@ -44,6 +44,11 @@ export default {
|
|||||||
removableIfSet: {
|
removableIfSet: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
|
},
|
||||||
|
displayPicked: {
|
||||||
|
// display picked entities.
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['addNewEntity', 'removeEntity'],
|
emits: ['addNewEntity', 'removeEntity'],
|
||||||
|
@ -17,6 +17,11 @@ export default {
|
|||||||
hour: "numeric",
|
hour: "numeric",
|
||||||
minute: "numeric",
|
minute: "numeric",
|
||||||
hour12: false
|
hour12: false
|
||||||
|
},
|
||||||
|
hoursOnly: {
|
||||||
|
hour: "numeric",
|
||||||
|
minute: "numeric",
|
||||||
|
hour12: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user