137 lines
4.8 KiB
PHP
137 lines
4.8 KiB
PHP
@extends('layout.app')
|
|
|
|
@push('customCss')
|
|
<style>
|
|
.grid-1week {
|
|
display: grid;
|
|
grid-template-columns: 3fr repeat(5, 1fr);
|
|
grid-auto-rows: minmax(10px, auto);
|
|
}
|
|
.grid-2week {
|
|
display: grid;
|
|
grid-template-columns: 3fr repeat(10, 1fr);
|
|
grid-auto-rows: minmax(10px, auto);
|
|
align-items: center;
|
|
}
|
|
.grid-week div {
|
|
border: 1px solid;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-self: stretch;
|
|
align-items: center;
|
|
}
|
|
.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 {
|
|
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(-($nbweek*7))->format('d/m/Y')}}">←</a>
|
|
</div>
|
|
<div class="col-10 grid-week grid-{{$nbweek}}week">
|
|
<!--line header-->
|
|
<div class="empty"></div>
|
|
@for ($i = 0; $i < ($nbweek*5); $i++)
|
|
<div class="day">{{$date->addDays($i)->format('d/m/Y')}}</div>
|
|
@endfor
|
|
@foreach($users as $user)
|
|
<!-- user $j -->
|
|
<div class="name">{{$user->name}}</div>
|
|
@for ($k=0; $k < 4; $k++)
|
|
<!--line slot $k-->
|
|
@for ($i = 0; $i < ($nbweek*5); $i++)
|
|
<div class="day {{ $schedules[$user->id][$date->addDays($i)->format('d/m/Y')][$k]['type'] ?? '' }}">
|
|
{{$schedules[$user->id][$date->addDays($i)->format('d/m/Y')][$k]['text'] ?? ''}}
|
|
</div>
|
|
@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($nbweek*7)->format('d/m/Y')}}">→</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{--<div class="grid-week grid-2week">
|
|
<!--line header-->
|
|
<div class="empty"></div>
|
|
@for ($i = 0; $i < 10; $i++)
|
|
<div class="day"></div>
|
|
@endfor
|
|
@for ($j = 0; $j < 4; $j++)
|
|
<!-- user $j -->
|
|
<!--line slot1-->
|
|
<div class="name"></div>
|
|
@for ($i = 0; $i < 10; $i++)
|
|
<div class="day"></div>
|
|
@endfor
|
|
<!--line slot2-->
|
|
@for ($i = 0; $i < 10; $i++)
|
|
<div class="day"></div>
|
|
@endfor
|
|
<!--line slot 3-->
|
|
@for ($i = 0; $i < 10; $i++)
|
|
<div class="day"></div>
|
|
@endfor
|
|
<!--line slot 4-->
|
|
@for ($i = 0; $i < 10; $i++)
|
|
<div class="day"></div>
|
|
@endfor
|
|
@endfor
|
|
</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
|