Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,9 @@ RESERVA_CAMPOS_EXTRAS=
# se true, todo e-mail enviado será copiado para o endereço remetente do próprio sistema
# Colocar true para fazer essa cópia; colocar false ou deixar em branco ou comentado ou ausente para não fazer essa cópia
MAIL_COPIAR_REMETENTE=

# Configura o calendário da sala de modo a exibir horários não de 0 a 24hs, mas menos horários
# Se não estiver preenchido, o calendário exibirá das 0 às 24hs, como sempre foi até a criação destes campos
# O formato de preenchimento é "hh:mm" (com aspas e dois dígitos para hora e dois dígitos para minuto, separados por :)
CALENDARIO_HORA_INICIAL=
CALENDARIO_HORA_FINAL=
4 changes: 4 additions & 0 deletions config/salas.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@

// campos de preenchimento obrigatório quando de solicitação de reserva
'reservaCamposExtras' => env('RESERVA_CAMPOS_EXTRAS') ? explode(',', env('RESERVA_CAMPOS_EXTRAS')) : null,

// configurações do calendário de sala
'calendarioHoraInicial' => env('CALENDARIO_HORA_INICIAL') ?: '00:00',
'calendarioHoraFinal' => env('CALENDARIO_HORA_FINAL' ) ?: '24:00',
];
15 changes: 9 additions & 6 deletions resources/views/sala/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>

<div id="calendar" class="mt-4"></div>
@endsection
@endsection

@section('styles')
@parent
Expand Down Expand Up @@ -66,6 +66,9 @@
},
views: {
timeGrid: {
slotMinTime: "{{ config('salas.calendarioHoraInicial') }}",
slotMaxTime: "{{ config('salas.calendarioHoraFinal') }}",

selectable: true,
eventContent: function(info){
let div = document.createElement('div');
Expand All @@ -90,9 +93,9 @@
select: function(time){
if (parseInt({{Gate::allows('members', $sala->id)}})) {
window.location.assign("{{route('reservas.create')}}"
+ "?data=" + time.start.toLocaleDateString('pt-BR')
+ "&start=" + time.start.getHours() + ":" + (time.start.getMinutes() < 10 ? '0' : '') + time.start.getMinutes()
+ "&end=" + time.end.getHours() + ":" + (time.end.getMinutes() < 10 ? '0' : '') + time.end.getMinutes()
+ "?data=" + time.start.toLocaleDateString('pt-BR')
+ "&start=" + time.start.getHours() + ":" + (time.start.getMinutes() < 10 ? '0' : '') + time.start.getMinutes()
+ "&end=" + time.end.getHours() + ":" + (time.end.getMinutes() < 10 ? '0' : '') + time.end.getMinutes()
+ "&sala={{$sala->id}}");
}
}
Expand All @@ -108,7 +111,7 @@

let nomesResponsaveis = info.event.extendedProps.responsaveis.join(', ');

bold.innerHTML = horarioDeInicio;
bold.innerHTML = horarioDeInicio;

div.innerHTML = info.event.title + '<br>' + nomesResponsaveis;
div.classList.add('text-wrap');
Expand Down Expand Up @@ -146,4 +149,4 @@
});

</script>
@endsection
@endsection