Unverified Commit c55a3b07 authored by Lucas Henrique's avatar Lucas Henrique Committed by GitHub
Browse files

Merge pull request #2 from Wolf-gangSE/feature/removendo-obrigatoriedade-discente

Feature/removendo obrigatoriedade discente
parents b780d76a a22c954b
......@@ -64,7 +64,7 @@
</div>
<div class="col-sm-2">
<label for="numParticipantes" class="col-form-label">{{ __('Nº de Discentes:') }}<span style="color: red; font-weight: bold;">*</span></label>
<input id="numParticipantes" type="number" min="1" max="20" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ $evento->numParticipantes }}" required autocomplete="numParticipantes" autofocus>
<input id="numParticipantes" type="number" min="0" max="20" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ $evento->numParticipantes }}" required autocomplete="numParticipantes" autofocus>
@error('numParticipantes')
<span class="invalid-feedback" role="alert">
......
......@@ -85,6 +85,38 @@
</div>
@endif
@if ($edital->numParticipantes == 0)
<div class="col-md-3">
<br>
<label for="nomePlanoTrabalho" class="col-form-label font-tam" style="font-weight: bold">{{ __('Título do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
</div>
<div class="col-md-9">
<br>
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho') ?? "" }}" name="nomePlanoTrabalho" maxlength="255" id="nomePlanoTrabalho" required>
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho">
</span>
@error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-3">
<br>
<label for="anexoPlanoTrabalho" class="col-form-label font-tam"
style="font-weight: bold">{{ __('Anexo do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
</div>
<div class="col-md-9">
<br>
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho') ?? "" }}" name="anexoPlanoTrabalho" accept=".pdf" placeholder="Anexo do Plano de Trabalho" required />
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
@endif
<div class="col-md-2">
<br>
<label for="conflitosInteresse" class="col-form-label font-tam"
......@@ -93,7 +125,7 @@
<div class="col-md-10">
<br>
<textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse"
autofocus id="conflitosInteresse" name="conflitosInteresse" rows="4">{{ old('conflitosInteresse') }}</textarea>
autofocus id="conflitosInteresse" name="conflitosInteresse" rows="3">{{ old('conflitosInteresse') }}</textarea>
@error('conflitosInteresse')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
......
......@@ -24,9 +24,11 @@
@component('evento.formulario.anexos')
@endcomponent
@if ($edital->numParticipantes != 0)
@component('evento.formulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno])
@endcomponent
@endif
@component('evento.formulario.finalizar')
@endcomponent
......@@ -34,11 +36,13 @@
</div>
</div>
</form>
@if ($edital->numParticipantes != 0)
<div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent
</div>
@endif
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
......
......@@ -17,9 +17,9 @@
@include('evento.formulario.proponente')
@if ($edital->numParticipantes != 0)
@include('evento.formulario.participantes')
@endif
@include('evento.formulario.anexos')
......@@ -36,11 +36,13 @@
</div>
</div>
</form>
@if ($edital->numParticipantes != 0)
<div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent
</div>
@endif
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
......@@ -97,9 +99,11 @@
let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
@if($edital->numParticipantes != 0)
let parts = document.getElementById('participante');
let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild;
@endif
let contador = 0;
buttonSubmit.addEventListener('click', (e)=>{
......@@ -112,6 +116,7 @@
$("#criarProjetoForm").append(input);
})
@if($edital->numParticipantes != 0)
function gerarPeriodo(e){
var select = e.parentElement.parentElement.nextElementSibling;
selectPeriodos = select.children[0].children[1];
......@@ -224,14 +229,14 @@
$("#atribuir1").attr('data-target','#exampleModal'+(id));
document.getElementById("exampleModal"+id).modal('hide');
}
@endif
</script>
<script>
$( document ).ready( function () {
@if($edital->numParticipantes != 0)
$('#nomeParticipante').keyup(function () {
$('#display').text($(this).val());
if($('#nomeParticipante').val() == ""){
......@@ -242,11 +247,13 @@
$('#pontos').show();
}
});
@endif
$.validator.addMethod("alpha", function(value, element) {
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
});
@if($edital->numParticipantes != 0)
$('input.cep:text').mask('00000-000');
$('input.cpf:text').mask('000.000.000-00');
$('.numero').mask('0000000000000');
......@@ -269,7 +276,7 @@
}
});
@endif
// $.validator.setDefaults( {
......
......@@ -21,18 +21,21 @@
<th scope="col" style="width:400px; text-align: center;">Projeto</th>
<th scope="col" style="width:400px; text-align: center;">Proponente</th>
<th scope="col" style="width:400px; text-align: center;">Título do Plano</th>
@if ($evento->numParticipantes != 0)
<th scope="col" style="width:200px; text-align: center;">Discente</th>
<th scope="col" style="width:200px; text-align: center;">Relatório Parcial</th>
<th scope="col" style="width:200px; text-align: center;">Relatório Final</th>
@endif
<th scope="col" style="width:200px; text-align: center;">Relatório Parcial</th>
<th scope="col" style="width:200px; text-align: center;">Relatório Final</th>
</tr>
</thead>
@foreach($arquivos as $arquivo)
<tbody>
<td style="text-align: center;" title="{{$arquivo->trabalho->titulo}}">{{$arquivo->trabalho->titulo}}</td>
<td style="text-align: center;" title="{{$arquivo->trabalho->proponente->user->name}}">{{$arquivo->trabalho->proponente->user->name}}</td>
<td style="text-align: center;" title="{{$arquivo->titulo}}">{{$arquivo->titulo}}</td>
@if ($evento->numParticipantes != 0)
<td style="text-align: center;" title="{{$arquivo->participante->user->name}}" id="td-nomeAluno">{{$arquivo->participante->user->name}}</td>
@endif
<td style="text-align: center;">
@if((Auth::user()->proponentes != null) && ($arquivo->relatorioParcial == null) &&
($arquivo->trabalho->evento->dt_inicioRelatorioParcial <= $hoje) && ($hoje <= $arquivo->trabalho->evento->dt_fimRelatorioParcial))
......
......@@ -181,7 +181,7 @@
</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js%22%3E"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
if("{{old('autorizacaoFlag')}}" == "sim"){
$('#radioSim').click();
......
......@@ -96,6 +96,49 @@
</div>
@endif
@if ($edital->numParticipantes == 0)
@php
$arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first();
@endphp
<div class="col-md-3">
<br>
<label for="nomePlanoTrabalho" class="col-form-label font-tam" style="font-weight: bold">{{ __('Título do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
</div>
<div class="col-md-9">
<br>
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho') ?? $arquivo->titulo ?? "" }}" name="nomePlanoTrabalho" maxlength="255" id="nomePlanoTrabalho" required>
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho">
</span>
@error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-3">
<br>
<label for="anexoPlanoTrabalho" class="col-form-label font-tam"
style="font-weight: bold">{{ __('Anexo do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
@if ($proponente != null && $arquivo)
<a style="margin-left: 5px"
href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a>
@else
<p><i class="fas fa-times-circle fa-2x"></i></p>
@endif
</div>
<div class="col-md-9">
<br>
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho') ?? '' }}" name="anexoPlanoTrabalho" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
@endif
<div class="col-md-2">
<br>
<label for="conflitosInteresse" class="col-form-label font-tam"
......
......@@ -34,7 +34,9 @@
@include('projeto.editaFormulario.proponente')
@include('projeto.editaFormulario.participantes')
@if ($edital->numParticipantes != 0)
@include('projeto.editaFormulario.participantes')
@endif
@include('projeto.editaFormulario.anexos')
......@@ -44,11 +46,13 @@
</div>
</div>
</form>
@if ($edital->numParticipantes != 0)
<div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent
</div>
@endif
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
......@@ -118,9 +122,11 @@
let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
@if($edital->numParticipantes != 0)
let parts = document.getElementById('participante');
let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild;
@endif
let contador = 0;
buttonSubmit.addEventListener('click', (e)=>{
......@@ -132,7 +138,7 @@
const input = '<input id="input_rascunho" type="hidden" name="rascunho" value="true">';
$("#updateProjetoForm").append(input);
})
@if($edital->numParticipantes != 0)
function gerarPeriodo(e){
var select = e.parentElement.parentElement.nextElementSibling;
selectPeriodos = select.children[0].children[1];
......@@ -251,17 +257,17 @@
$("#atribuir1").attr('data-target','#exampleModal'+(id));
document.getElementById("exampleModal"+id).modal('hide');
}
@endif
</script>
<script>
$( document ).ready( function () {
$.validator.addMethod("alpha", function(value, element) {
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
});
@if($edital->numParticipantes != 0)
$('input.cep:text').mask('00000-000');
//$('input.cpf:text').mask('000.000.000-00');
$('.numero').mask('0000000000000');
......@@ -284,7 +290,7 @@
}
});
@endif
// $.validator.setDefaults( {
......
......@@ -76,6 +76,23 @@
</div>
@endif
@if ($edital->numParticipantes == 0)
@php
$arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first();
@endphp
<div class="col-md-12">
<br>
<b style="color: #4D4D4D;">Título do Plano de Trabalho: </b>
<a style="color: #4D4D4D;">{{$arquivo->titulo}}</a>
</div>
<div class="col-sm-4" style="float: left">
<label for="anexoProjeto" class="col-form-label font-tam" style="font-weight: bold">{{ __('Anexo do Plano de Trabalho: ') }}</label>
<a href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div>
@endif
@if ($projeto->conflitosInteresse != null &&
(Auth::user()->tipo == 'administrador' ||
Auth::user()->tipo == 'administradorResponsavel' ||
......
......@@ -32,8 +32,10 @@
@component('projeto.formularioVisualizar.anexos2', ['edital' => $edital,'projeto' => $projeto])
@endcomponent
@if ($edital->numParticipantes != 0)
@component('projeto.formularioVisualizar.participantes2', ['projeto' => $projeto, 'edital' => $edital])
@endcomponent
@endif
@component('projeto.formularioVisualizar.relatorio',['edital' => $edital,'projeto' => $projeto,'flagSubstituicao' =>$flagSubstituicao])
@endcomponent
......
......@@ -104,7 +104,7 @@
<hr class="dropdown-hr">
@endif
@if( $projeto->status== 'aprovado')
@if( $projeto->status== 'aprovado' && $projeto->evento->numParticipantes != 0)
<a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;">
Solicitar Substituições
</a>
......
......@@ -124,7 +124,7 @@
<hr class="dropdown-hr">
@endif
@if( $projeto->status== 'aprovado')
@if( $projeto->status== 'aprovado' && $projeto->evento->numParticipantes != 0)
<a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;">
Solicitar Substituições
</a>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment