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

Adicionando tela/modal de resultado projeto

parent d8afe55f
...@@ -82,6 +82,13 @@ class AdministradorController extends Controller ...@@ -82,6 +82,13 @@ class AdministradorController extends Controller
return view('administrador.listaProjetos', compact('projetos', 'evento','editais')); return view('administrador.listaProjetos', compact('projetos', 'evento','editais'));
} }
public function showResultados(Request $request){
$evento = Evento::where('id', $request->evento_id)->first();
$trabalhos = $evento->trabalhos;
return view('administrador.resultadosProjetos')->with(['evento' => $evento, 'trabalhos' => $trabalhos]);
}
public function visualizarParecer(Request $request){ public function visualizarParecer(Request $request){
$avaliador = Avaliador::find($request->avaliador_id); $avaliador = Avaliador::find($request->avaliador_id);
......
...@@ -78,6 +78,10 @@ ...@@ -78,6 +78,10 @@
<a href="{{route('admin.analisar', ['evento_id' => $evento->id])}}" class="dropdown-item text-center"> <a href="{{route('admin.analisar', ['evento_id' => $evento->id])}}" class="dropdown-item text-center">
Analisar projetos Analisar projetos
</a> </a>
<hr class="dropdown-hr">
<a href="{{route('admin.showResultados', ['evento_id' => $evento->id])}}" class="dropdown-item text-center">
Resultados
</a>
<hr class="dropdown-hr"> <hr class="dropdown-hr">
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="dropdown-item dropdown-item-delete text-center" data-toggle="modal" data-target="#exampleModal{{ $evento->id }}"> <button type="button" class="dropdown-item dropdown-item-delete text-center" data-toggle="modal" data-target="#exampleModal{{ $evento->id }}">
......
@extends('layouts.app')
@section('content')
<div class="container" style="margin-top: 100px;">
<div class="row justify-content-center">
<div class="col-sm-12">
<div class="row" >
<div class="col-sm-4">
<div class="row">
<div class="col-sm-2">
<button class="btn" onclick="buscarProjeto(this.parentElement.parentElement.children[1].children[0])">
<img src="{{asset('img/icons/logo_lupa.png')}}" alt="">
</button>
</div>
<div class="col-sm-10">
<input type="text" class="form-control form-control-edit" placeholder="Digite o nome do projeto" onkeyup="buscarProjeto(this)">
</div>
</div>
</div>
<div class="col-sm-1">
</div>
<div class="col-sm-5" style="float: center;">
<h4 class="titulo-table">Resultados</h4>
</div>
</div>
<hr>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-12">
<table class="table table-bordered" style="display: block; white-space: nowrap; border-radius:10px; margin-bottom:0px">
<thead>
<tr>
<th scope="col" style="width: 100%;">Nome do projeto</th>
<th scope="col">Autor</th>
<th scope="col">Área</th>
<th scope="col">N. Planos</th>
<th scope="col">Av. Externo</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody id="projetos">
@foreach($trabalhos as $trabalho)
<tr>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">
{{$trabalho->titulo}}
</td>
<td>
{{$trabalho->proponente->user->name}}
</td>
<td>
{{$trabalho->area->nome}}
</td>
<td>
{{$trabalho->participantes->count()}}
</td>
<td>
@if($trabalho->avaliadors->count() > 0)
{{$trabalho->avaliadors->first()->user->name}}
@endif
</td>
@if($trabalho->avaliadors->first()->pivot->recomendacao == 'RECOMENDADO')
<td style="color:rgb(6, 85, 6)">
APROVADO
</td>
@elseif($trabalho->avaliadors->first()->pivot->recomendacao == 'NAO-RECOMENDADO')
<td style="color: darkred">
REPROVADO
</td>
@else
<td>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@section('javascript')
<script>
function buscarProjeto(input) {
var projetos = document.getElementById('projetos').children;
if(input.value.length > 2) {
for(var i = 0; i < projetos.length; i++) {
var nomeProjeto = projetos[i].innerText;
if(nomeProjeto.substr(0).indexOf(input.value) >= 0) {
projetos[i].style.display = "";
} else {
projetos[i].style.display = "none";
}
}
} else {
for(var i = 0; i < projetos.length; i++) {
projetos[i].style.display = "";
}
}
}
</script>
@endsection
\ No newline at end of file
...@@ -102,11 +102,14 @@ ...@@ -102,11 +102,14 @@
<hr class="dropdown-hr"> <hr class="dropdown-hr">
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Recorrer Recorrer
</a>
<a href="" class="dropdown-item" style="text-align: center">
Resultado
</a> --}} </a> --}}
<!-- Button trigger modal --> @if($projeto->evento->resultado_preliminar <= $hoje)
<a href="" class="dropdown-item" style="text-align: center" data-toggle="modal" data-target="#modalResult{{$projeto->id}}">
Resultado
</a>
@endif
<!-- Button trigger modal deletar -->
<button type="button" class="dropdown-item dropdown-item-delete" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center"> <button type="button" class="dropdown-item dropdown-item-delete" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center">
<img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar <img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar
</button> </button>
...@@ -115,7 +118,8 @@ ...@@ -115,7 +118,8 @@
</td> </td>
</tr> </tr>
@endif @endif
<!-- Modal -->
<!-- Modal deletar -->
<div class="modal fade" id="modal{{$projeto->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="modal{{$projeto->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
...@@ -137,6 +141,80 @@ ...@@ -137,6 +141,80 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Modal Resultado -->
<div class="modal fade" id="modalResult{{$projeto->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header" style="overflow-x:auto">
<h5 class="modal-title" id="exampleModalLabel" style= "color:#1492E6">Resultado Do Projeto: {{$projeto->titulo}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="padding-top: 8px; color:#1492E6">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-4">
<label class="control-label">Área</label>
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" value="{{$projeto->area->nome}}" disabled>
</div>
</div>
<div class="row mt-2" >
<div class="col-6">
<label class="control-label">N. Planos</label>
</div>
<div class="col-6">
<label class="control-label">Avaliador Externo</label>
</div>
</div>
<div class="row">
<div class="col-6">
<input type="text" class="form-control" value="{{$projeto->participantes->count()}}" disabled>
</div>
<div class="col-6">
@if($projeto->avaliadors->count() > 0)
<input type="text" class="form-control" value="{{$projeto->avaliadors->first()->user->name}}" disabled>
@else
<input type="text" class="form-control" value="" disabled>
@endif
</div>
</div>
<div class="row">
<div class="col-4">
<label class="control-label mt-2">Status</label>
</div>
</div>
<div class="row">
<div class="col-12">
@if($projeto->avaliadors->first()->pivot->recomendacao == 'RECOMENDADO')
<input type="text" class="form-control" value="APROVADO" disabled style="color:rgb(6, 85, 6)">
@elseif($projeto->avaliadors->first()->pivot->recomendacao == 'NAO-RECOMENDADO')
<input type="text" class="form-control" value="REPROVADO" disabled style="color: darkred">
@else
<input type="text" class="form-control" value="" disabled>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
{{ $projeto->titulo }} {{ $projeto->titulo }}
</td> </td>
<td style="text-align: center">{{ date('d-m-Y', strtotime($projeto->updated_at)) }}</td> <td style="text-align: center">{{ date('d-m-Y', strtotime($projeto->updated_at)) }}</td>
@if($projeto->status == 'Avaliado') @if($projeto->status == 'Avaliado' || $projeto->status == 'avaliado')
<td style="color: rgb(6, 85, 6); text-align: center">Avaliado</td> <td style="color: rgb(6, 85, 6); text-align: center">Avaliado</td>
@elseif($projeto->status == 'Submetido' || $projeto->status == 'submetido') @elseif($projeto->status == 'Submetido' || $projeto->status == 'submetido')
<td style="color: rgb(0, 0, 0); text-align: center">Submetido</td> <td style="color: rgb(0, 0, 0); text-align: center">Submetido</td>
...@@ -115,10 +115,14 @@ ...@@ -115,10 +115,14 @@
<hr class="dropdown-hr"> <hr class="dropdown-hr">
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Recorrer Recorrer
</a>
<a href="" class="dropdown-item" style="text-align: center">
Resultado
</a> --}} </a> --}}
@if($projeto->evento->resultado_preliminar <= $hoje)
<a href="" class="dropdown-item" style="text-align: center" data-toggle="modal" data-target="#modalResult{{$projeto->id}}">
Resultado
</a>
@endif
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="dropdown-item dropdown-item-delete" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center"> <button type="button" class="dropdown-item dropdown-item-delete" data-toggle="modal" data-target="#modal{{$projeto->id}}" style="text-align: center">
<img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar <img src="{{asset('img/icons/logo_lixeira.png')}}" alt=""> Deletar
...@@ -128,7 +132,7 @@ ...@@ -128,7 +132,7 @@
</td> </td>
</tr> </tr>
@endif @endif
<!-- Modal --> <!-- Modal deletar -->
<div class="modal fade" id="modal{{$projeto->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="modal{{$projeto->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
...@@ -150,6 +154,79 @@ ...@@ -150,6 +154,79 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Modal Resultado -->
<div class="modal fade" id="modalResult{{$projeto->id}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header" style="overflow-x:auto">
<h5 class="modal-title" id="exampleModalLabel" style= "color:#1492E6">Resultado Do Projeto: {{$projeto->titulo}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="padding-top: 8px; color:#1492E6">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-4">
<label class="control-label">Área</label>
</div>
</div>
<div class="row">
<div class="col-12">
<input type="text" class="form-control" value="{{$projeto->area->nome}}" disabled>
</div>
</div>
<div class="row mt-2" >
<div class="col-6">
<label class="control-label">N. Planos</label>
</div>
<div class="col-6">
<label class="control-label">Avaliador Externo</label>
</div>
</div>
<div class="row">
<div class="col-6">
<input type="text" class="form-control" value="{{$projeto->participantes->count()}}" disabled>
</div>
<div class="col-6">
@if($projeto->avaliadors->count() > 0)
<input type="text" class="form-control" value="{{$projeto->avaliadors->first()->user->name}}" disabled>
@else
<input type="text" class="form-control" value="" disabled>
@endif
</div>
</div>
<div class="row">
<div class="col-4">
<label class="control-label mt-2">Status</label>
</div>
</div>
<div class="row">
<div class="col-12">
@if($projeto->avaliadors->first()->pivot->recomendacao == 'RECOMENDADO')
<input type="text" class="form-control" value="APROVADO" disabled style="color:rgb(6, 85, 6)">
@elseif($projeto->avaliadors->first()->pivot->recomendacao == 'NAO-RECOMENDADO')
<input type="text" class="form-control" value="REPROVADO" disabled style="color: darkred">
@else
<input type="text" class="form-control" value="" disabled>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
......
...@@ -119,16 +119,16 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){ ...@@ -119,16 +119,16 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route::get( '/trabalho/submeter/{id}', 'TrabalhoController@index' )->name('trabalho.index'); Route::get( '/trabalho/submeter/{id}', 'TrabalhoController@index' )->name('trabalho.index');
// Route::get( '/trabalho/visualizar/{id}','TrabalhoController@show' )->name('trabalho.show'); // Route::get( '/trabalho/visualizar/{id}','TrabalhoController@show' )->name('trabalho.show');
Route::post( '/trabalho/novaVersao', 'TrabalhoController@novaVersao' )->name('trabalho.novaVersao'); Route::post( '/trabalho/novaVersao', 'TrabalhoController@novaVersao' )->name('trabalho.novaVersao');
Route::post( '/trabalho/criar', 'TrabalhoController@salvar' )->name('trabalho.store'); Route::post( '/trabalho/criar', 'TrabalhoController@salvar' )->name('trabalho.store');
Route::post( '/trabalho/criarRascunho', 'TrabalhoController@storeParcial' )->name('trabalho.storeParcial'); Route::post( '/trabalho/criarRascunho', 'TrabalhoController@storeParcial' )->name('trabalho.storeParcial');
Route::get( '/edital/{id}/projetos', 'TrabalhoController@projetosDoEdital' )->name('projetos.edital'); Route::get( '/edital/{id}/projetos', 'TrabalhoController@projetosDoEdital' )->name('projetos.edital');
Route::get( '/projeto/visualizar/{id}', 'TrabalhoController@show' )->name('trabalho.show'); Route::get( '/projeto/visualizar/{id}', 'TrabalhoController@show' )->name('trabalho.show');
Route::get( '/projeto/{id}/editar', 'TrabalhoController@edit' )->name('trabalho.editar'); Route::get( '/projeto/{id}/editar', 'TrabalhoController@edit' )->name('trabalho.editar');
Route::post( '/projeto/{id}/atualizar', 'TrabalhoController@update' )->name('trabalho.update'); Route::post( '/projeto/{id}/atualizar', 'TrabalhoController@update' )->name('trabalho.update');
Route::get( '/projeto/{id}/excluir', 'TrabalhoController@destroy' )->name('trabalho.destroy'); Route::get( '/projeto/{id}/excluir', 'TrabalhoController@destroy' )->name('trabalho.destroy');
Route::get( '/projeto/{id}/excluirParticipante','TrabalhoController@excluirParticipante')->name('trabalho.excluirParticipante'); Route::get( '/projeto/{id}/excluirParticipante','TrabalhoController@excluirParticipante')->name('trabalho.excluirParticipante');
Route::get( '/projeto/exportar/{id}','TrabalhoController@exportProjeto' )->name('exportar.projeto'); Route::get( '/projeto/exportar/{id}','TrabalhoController@exportProjeto' )->name('exportar.projeto');
Route::get( '/projeto/substituirParticipante', 'TrabalhoController@telaTrocaPart' )->name('trabalho.trocaParticipante');
//######### Atribuição ####################################### //######### Atribuição #######################################
Route::get( '/atribuir', 'AtribuicaoController@distribuicaoAutomatica' )->name('distribuicao'); Route::get( '/atribuir', 'AtribuicaoController@distribuicaoAutomatica' )->name('distribuicao');
...@@ -182,6 +182,7 @@ Route::prefix('usuarios')->name('admin.')->group(function(){ ...@@ -182,6 +182,7 @@ Route::prefix('usuarios')->name('admin.')->group(function(){
Route::get('/pareceresProjetos', 'AdministradorController@pareceres' )->name('pareceres'); Route::get('/pareceresProjetos', 'AdministradorController@pareceres' )->name('pareceres');
Route::get('/analisarProjetos', 'AdministradorController@analisar' )->name('analisar'); Route::get('/analisarProjetos', 'AdministradorController@analisar' )->name('analisar');
Route::get('/showrProjetos', 'AdministradorController@showProjetos' )->name('showProjetos'); Route::get('/showrProjetos', 'AdministradorController@showProjetos' )->name('showProjetos');
Route::get('/showResultados', 'AdministradorController@showResultados' )->name('showResultados');
}); });
Route::prefix('naturezas')->group(function(){ Route::prefix('naturezas')->group(function(){
......
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