141 lines
5.2 KiB
PHP
141 lines
5.2 KiB
PHP
@extends('layout.app')
|
|
|
|
@push('customCss')
|
|
<style>
|
|
.grid-1week {
|
|
display: grid;
|
|
grid-template-columns: 2fr repeat(5, 1fr);
|
|
grid-auto-rows: minmax(50px, auto);
|
|
}
|
|
.grid-2week {
|
|
display: grid;
|
|
grid-template-columns: 2fr repeat(10, 1fr);
|
|
grid-auto-rows: minmax(50px, auto);
|
|
align-items: center;
|
|
}
|
|
.grid-week div {
|
|
border-width:0 1px 1px 0;
|
|
border-style: solid;
|
|
border-color: var(--bs-cyan);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-self: stretch;
|
|
align-items: center;
|
|
}
|
|
.grid-week div.Sat, .grid-week div.Sun {
|
|
//width: 0px;
|
|
}
|
|
.empty {
|
|
grid-column: auto;
|
|
grid-row: auto /span 2;
|
|
}
|
|
.week {
|
|
grid-column: auto /span 5;
|
|
grid-row: auto;
|
|
}
|
|
.name {
|
|
grid-column: auto;
|
|
grid-row: auto /span 4;
|
|
}
|
|
|
|
.support {
|
|
background-color: {{CellType::support()->value}};
|
|
}
|
|
.rnd {
|
|
background-color: {{CellType::rnd()->value}};
|
|
}
|
|
.dev {
|
|
background-color: {{CellType::dev()->value}};
|
|
}
|
|
.projects {
|
|
background-color: {{CellType::projects()->value}};
|
|
}
|
|
.management {
|
|
background-color: {{CellType::management()->value}};
|
|
}
|
|
.absence, .Sat, .Sun {
|
|
background-color: {{CellType::absence()->value}};
|
|
}
|
|
</style>
|
|
@endpush
|
|
|
|
@section('content')
|
|
<div id="planning" class="container container-xxl vueComponent">
|
|
<div class="row mb-3 sticky-top bg-white">
|
|
<div class="col-2">
|
|
<h1><a href="{{ route('schedule.index') }}">{{__('Planning') }}</a></h1>
|
|
</div>
|
|
<div class="col pt-2">
|
|
<h4 class="d-inline me-3">Légende</h4>
|
|
<div class="d-inline">
|
|
@foreach(CellType::toArray() as $type)
|
|
<span style="background-color: {{ $type->value }}; border: 1px solid black;">{{ $type->label }}</span>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="plannings">
|
|
<div class="row justify-content-center">
|
|
<div class="col-1 text-center">
|
|
<a class="sticky-top btn btn-primary mt-5" href="{{route('schedule.index')}}?p={{$date->addDays(-7)->format('d/m/Y')}}">←</a>
|
|
</div>
|
|
<div class="col-10 grid-week grid-{{$nbweek}}week">
|
|
<!--line header 1 -->
|
|
<div class="empty"></div>
|
|
@for ($i = 0; $i < $nbweek; $i++)
|
|
<div class="week">
|
|
S{{$date->addDays($i*7)->weekOfYear}} - {{$date->addDays($i*7)->shortLocaleMonth}} {{$date->addDays($i*7)->format('Y')}}
|
|
</div>
|
|
@endfor
|
|
<!--line header 2 -->
|
|
@for ($i = 0; $i < ($nbweek*7); $i++)
|
|
<div class="day {{$date->addDays($i)->shortEnglishDayOfWeek}}">
|
|
{{$date->addDays($i)->localeDayOfWeek}} {{$date->addDays($i)->format('d')}}
|
|
</div>
|
|
@php
|
|
if( $date->addDays($i)->dayOfWeek == 5) {
|
|
$i+=2;
|
|
}
|
|
@endphp
|
|
@endfor
|
|
@foreach($users as $user)
|
|
<!-- user $j -->
|
|
<div class="name">{{$user->name}}</div>
|
|
@for ($k=1; $k < 5; $k++)
|
|
<!--line slot $k-->
|
|
@for ($i = 0; $i < ($nbweek*7); $i++)
|
|
<div class="day {{ $arSchedules[$user->id][$date->addDays($i)->format('d/m/Y')][$k]['type'] ?? '' }} {{$date->addDays($i)->shortEnglishDayOfWeek}}">
|
|
{{$arSchedules[$user->id][$date->addDays($i)->format('d/m/Y')][$k]['text'] ?? ''}}
|
|
</div>
|
|
@php
|
|
if( $date->addDays($i)->dayOfWeek == 5) {
|
|
$i+=2;
|
|
}
|
|
@endphp
|
|
@endfor
|
|
@endfor
|
|
@endforeach
|
|
</div>
|
|
<div class="col-1 text-center">
|
|
<a class="sticky-top btn btn-primary mt-5" href="{{route('schedule.index')}}?p={{$date->addDays(7)->format('d/m/Y')}}">→</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@push('scriptsConstants')
|
|
<script>
|
|
window._routes = {
|
|
"planning.index": "{{ route('planning.index') }}",
|
|
"ticket.show": "{{ route('ticket.show', 'TICKET') }}",
|
|
"projects.show": "{{ route('projects.show', 'PROJECT') }}",
|
|
"sites.show": "{{ route('sites.show', 'SITE') }}",
|
|
"ticket.index": "{{ route('ticket.index') }}",
|
|
"projects.index": "{{ route('projects.index') }}",
|
|
"sites.index": "{{ route('sites.index') }}",
|
|
"planning.setCellContent": "{{ route('planning.setCellContent') }}",
|
|
"planning.eraseCellContent": "{{ route('planning.eraseCellContent') }}"
|
|
};
|
|
</script>
|
|
@endpush
|