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