Unverified Commit f8b1b7d8 authored by GuilhermeGz's avatar GuilhermeGz Committed by GitHub
Browse files

Merge pull request #591 from S-Nathalia/master

Restrição do envio de parecer | adição de coluna para status
parents fab038ea c4834eb8
......@@ -135,6 +135,8 @@ class AvaliadorController extends Controller
//
$participantes = $trabalho->participantes;
$arquivos = Arquivo::where('trabalhoId', $trabalho->id)->get();
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('avaliador.parecerInterno',
['trabalho'=>$trabalho,
......@@ -147,6 +149,7 @@ class AvaliadorController extends Controller
'enum_turno' => Participante::ENUM_TURNO,
'arquivos' => $arquivos,
'estados' => $this->estados,
'hoje' => $hoje
]);
}
......@@ -271,16 +274,12 @@ class AvaliadorController extends Controller
}
// dd($trabalho);
return view('avaliador.listarTrabalhos', ['trabalhosEx'=>$trabalhosEx,'trabalhosIn'=>$trabalhosIn, 'evento'=>$evento ]);
return redirect(route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id]));
}
public function conviteResposta(Request $request){
//dd($request->all());
$user = User::find(Auth::user()->id);
$evento = Evento::find($request->evento_id);
$user->avaliadors->eventos()->updateExistingPivot($evento->id, ['convite'=> $request->resposta]);
//dd( $user->avaliadors->eventos->where('id', $evento->id)->first()->pivot);
return redirect()->back();
}
......
......@@ -64,9 +64,9 @@
@if(Auth::user()->avaliadors->tipo == 'Externo' || Auth::user()->avaliadors->tipo == null)
<th scope="col">Projeto</th>
<th scope="col">Plano de Trabalho</th>
<th scope="col">Parecer Externo</th>
<th scope="col" style="text-align: center">Status</th>
@else
<th scope="col">Status Parecer</th>
<th scope="col" style="text-align: center">Status</th>
<th scope="col">Parecer Interno</th>
@endif
......@@ -78,13 +78,13 @@
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $trabalho->titulo }}</td>
<td style="text-align: center">{{ $trabalho->created_at->format('d/m/Y') }}</td>
@if(Auth::user()->avaliadors->tipo == 'Externo' || Auth::user()->avaliadors->tipo == null)
<td style="text-align: center">
<td>
{{-- --}}
<a href="{{route('download', ['file' => $trabalho->anexoProjeto])}}" target="_new" style="font-size: 20px; color: #114048ff;" class="btn btn-light">
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px">
</a>
</td>
<td style="text-align: center">
<td>
@foreach( $trabalho->participantes as $participante)
@php
if( App\Arquivo::where('participanteId', $participante->id)->first() != null){
......@@ -124,8 +124,16 @@
@php
$parecer = App\ParecerInterno::where([['avaliador_id',Auth::user()->avaliadors->id],['trabalho_id',$trabalho->id]])->first();
@endphp
<td style="text-align: center">
@if($parecer != null && $parecer->statusParecer !=null){{$parecer->statusParecer}} @else Sem Parecer @endif
<td>
@if($parecer != null && $parecer->statusParecer !=null)
@if($parecer->statusParecer == 'RECOMENDADO')
Recomendado
@else
Não Recomendado
@endif
@else
Pendente
@endif
</td>
<td>
<div class="row justify-content-center">
......@@ -161,12 +169,14 @@
<th scope="col">Data de Criação</th>
<th scope="col">Projeto</th>
<th scope="col">Plano de Trabalho</th>
<th scope="col" style="text-align: center">Status</th>
<th scope="col">Parecer Externo</th>
</tr>
</thead>
<tbody>
@foreach ($trabalhosEx as $trabalho)
<tr>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $trabalho->titulo }}</td>
<td style="text-align: center">{{ $trabalho->created_at->format('d/m/Y') }}</td>
......@@ -194,20 +204,24 @@
@endif
@endforeach
</td>
<td style="text-align: center">
@if($trabalho->pivot->recomendacao == 'RECOMENDADO')
Recomendado
@elseif($trabalho->pivot->recomendacao == null)
Pendente
@else
Não Recomendado
@endif
</td>
<td>
<div class="row justify-content-center">
<form action="{{ route('avaliador.parecer', ['evento' => $evento]) }}" method="POST">
@csrf
<input type="hidden" name="trabalho_id" value="{{ $trabalho->id }}" >
@if($trabalho->pivot->AnexoParecer == null)
<button type="submit" class="btn btn-primary mr-2 ml-2" >
Parecer
</button>
@else
<button type="submit" class="btn btn-secondary mr-2 ml-2" >
Enviado
</button>
@endif
</form>
</div>
......
......@@ -235,9 +235,9 @@
<div><hr></div>
<div class="d-flex justify-content-end">
<div style="margin-right: 15px"><a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id])}}" class="btn btn-light" style="color: red;">Cancelar</a></div>
<div><button type="submit" class="btn btn-success">Enviar meu parecer</button></div>
<div>
<button type="submit" class="btn btn-success" @if($evento->inicioRevisao > $hoje || $evento->fimRevisao < $hoje) disabled @endif>Enviar meu parecer</button></div>
</div>
</form>
</div>
</div>
......
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