rdv: twig layout + teleport calendar controls

This commit is contained in:
nobohan 2021-08-19 18:45:59 +02:00
parent 7e64ec0a45
commit 1a025ead1b
12 changed files with 62 additions and 45 deletions

View File

@ -48,13 +48,13 @@ class CalendarType extends AbstractType
->add('comment', CommentType::class, [
'required' => false
])
->add('cancelReason', EntityType::class, [
'required' => false,
'class' => CancelReason::class,
'choice_label' => function (CancelReason $entity) {
return $entity->getCanceledBy();
},
])
// ->add('cancelReason', EntityType::class, [
// 'required' => false,
// 'class' => CancelReason::class,
// 'choice_label' => function (CancelReason $entity) {
// return $entity->getCanceledBy();
// },
// ])
->add('sendSMS', ChoiceType::class, [
'required' => false,
'choices' => [

View File

@ -0,0 +1 @@
require('./scss/calendar.scss');

View File

@ -0,0 +1,10 @@
div#calendarControls {
height: 50%;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
div#fullCalendar{
}

View File

@ -1,5 +1,6 @@
<template>
<concerned-groups></concerned-groups>
<teleport to="#calendarControls">
<calendar-user-selector
v-bind:users="users"
v-bind:calendarEvents="calendarEvents"
@ -7,12 +8,14 @@
v-bind:showMyCalendar="showMyCalendar"
v-bind:toggleMyCalendar="toggleMyCalendar" >
</calendar-user-selector>
<h2 class="chill-red">{{ $t('choose_your_date') }}</h2>
</teleport>
<teleport to="#fullCalendar">
<FullCalendar ref="fullCalendar" :options="calendarOptions">
<template v-slot:eventContent='arg'>
<b>{{ arg.timeText }}</b>
</template>
</FullCalendar>
</teleport>
</template>
<script>

View File

@ -1,6 +1,6 @@
<template>
<div class="calendar__controls">
<h2 class="chill-red">{{ $t('choose_your_calendar_user') }}</h2>
<div>
<VueMultiselect
name="field"
id="calendarUserSelector"
@ -196,3 +196,12 @@ export default {
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
<style lang="scss" scoped>
div.calendar__controls {
background-color: 'black';
height: 50%;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
</style>

View File

@ -2,7 +2,7 @@ const calendarUserSelectorMessages = {
fr: {
choose_your_calendar_user: "Afficher les plages de disponibilités",
select_user: "Sélectionnez des calendriers",
show_my_calendar: "Affichez mon calendrier"
show_my_calendar: "Afficher mon calendrier"
}
};

View File

@ -40,10 +40,6 @@
.. location
{%- if form.cancelReason is defined -%}
{{ form_row(form.cancelReason) }}
{% endif %}
{%- if form.comment is defined -%}
{{ form_row(form.comment) }}
{% endif %}
@ -52,8 +48,7 @@
{{ form_row(form.sendSMS) }}
{% endif %}
..calendarRange
<div id="fullCalendar"></div>
<ul class="record_actions sticky-form-buttons">
<li class="cancel">

View File

@ -36,3 +36,7 @@
{{ parent() }}
{{ encore_entry_link_tags('vue_calendar') }}
{% endblock %}
{% block block_post_menu %}
<div id="calendarControls"></div>
{% endblock %}

View File

@ -1,4 +1,4 @@
<h1>{{ "Calendar item creation"|trans ~ ' :' }}</h1>
<h1>{{ "Calendar item creation"|trans }}</h1>
{{ form_start(form) }}
{{ form_errors(form) }}
@ -34,16 +34,8 @@
{{ form_row(form.endDate) }}
{% endif %}
{%- if form.calendarRange is defined -%}
{{ form_row(form.calendarRange) }}
{% endif %}
.. location
{%- if form.cancelReason is defined -%}
{{ form_row(form.cancelReason) }}
{% endif %}
{%- if form.comment is defined -%}
{{ form_row(form.comment) }}
{% endif %}
@ -52,10 +44,7 @@
{{ form_row(form.sendSMS) }}
{% endif %}
..calendarRange
<div id="fullCalendar"></div>
<ul class="record_actions sticky-form-buttons">
<li class="cancel">

View File

@ -34,4 +34,6 @@
<link rel="stylesheet" href="{{ asset('build/vue_calendar.css') }}"/>
{% endblock %}
{% block block_post_menu %}
<div id="calendarControls"></div>
{% endblock %}

View File

@ -1,6 +1,6 @@
// this file loads all assets from the Chill calendar bundle
module.exports = function(encore, entries) {
//entries.push(__dirname + '/Resources/public/index.js');
entries.push(__dirname + '/Resources/public/chill/index.js');
encore.addAliases({
ChillCalendarAssets: __dirname + '/Resources/public'

View File

@ -17,6 +17,10 @@
'layout': '@ChillPerson/menu.html.twig',
'args' : { 'accompanyingCourse': accompanyingCourse }
}) }}
{% block block_post_menu %}
{% endblock %}
{% endblock %}
{% block css %}