Commit f0a74ad5 authored by José Rômulo's avatar José Rômulo
Browse files

Correção desatribuir avaliador

parent 0a213633
......@@ -450,6 +450,12 @@ class AdministradorController extends Controller
$aval = Avaliador::where('id', $request->avaliador_id)->first();
$trabalho = Trabalho::where('id', $request->trabalho_id)->first();
$aval->trabalhos()->detach($trabalho);
if($trabalho->status === 'avaliado'){
$trabalho->status = 'submetido';
$trabalho->save();
}
$aval->save();
return redirect()->back();
......
......@@ -50,7 +50,7 @@
<tbody id="projetos">
@foreach ($trabalhos as $trabalho)
<tr>
<td>{{ $trabalho->titulo}}</td>
<td style="max-width:100px; overflow-x:scroll; text-overflow:ellipsis">{{ $trabalho->titulo}}</td>
<td>{{ App\Area::find($trabalho->area_id)->nome}}</td>
<td>{{ $trabalho->proponente->user->name }}</td>
<td style="text-align:center">
......@@ -127,7 +127,7 @@
<tr>
<td>{{ $avaliador->user->name }}</td>
<td>{{ $avaliador->user->email }}</td>
<td>{{ $trabalho->titulo }}</td>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $trabalho->titulo }}</td>
{{-- <td>{{ $contador }} / {{ $avaliador->trabalhos->where('evento_id', $evento->id)->count() }}</td> --}}
<td>@if($trabalho->pivot->parecer == null) Pendente @else Avaliado @endif</td>
<td>
......@@ -140,11 +140,11 @@
<a href="{{ route('admin.visualizarParecer', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id]) }}" class="dropdown-item text-center">
Vizualizar Parecer
</a>
@else
@endif
<a href="{{ route('admin.removerProjAval', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id]) }}" class="dropdown-item text-center">
Desatribuir Avaliador
</a>
@endif
</div>
</div>
</td>
......
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