diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index e8ee43a5345a6eb9f5157fef5c1686db9cf37f88..7d9c5388dc79e8743b48627873bf8a6e6617b06e 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -505,27 +505,27 @@ class TrabalhoController extends Controller public function show($id) { // - $projeto = Trabalho::find($id); - $edital = Evento::find($projeto->evento_id); - $grandeArea = GrandeArea::where('id', $projeto->grande_area_id)->select('nome')->first(); - $area = Area::where('id', $projeto->area_id)->select('nome')->first(); - $subarea = Subarea::where('id', $projeto->sub_area_id)->select('nome')->first(); - $proponente = Proponente::find($projeto->proponente_id); - $funcaoParticipantes = FuncaoParticipantes::all(); - $participantes = Participante::where('trabalho_id', $id)->get(); - $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get(); - $users = User::whereIn('id', $participantesUsersIds)->get(); - $arquivos = Arquivo::where('trabalhoId', $id)->get(); + $projeto = Trabalho::find($id); + $edital = Evento::find($projeto->evento_id); + $grandeAreas = GrandeArea::all(); + $areas = Area::all(); + $subareas = Subarea::all(); + $funcaoParticipantes = FuncaoParticipantes::all(); + $participantes = Participante::where('trabalho_id', $id)->get(); + $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get(); + $users = User::whereIn('id', $participantesUsersIds)->get(); + $arquivos = Arquivo::where('trabalhoId', $id)->get(); return view('projeto.visualizar')->with(['projeto' => $projeto, - 'grandeArea' => $grandeArea, - 'area' => $area, - 'subArea' => $subarea, - 'proponente' => $proponente, - 'edital' => $edital, - 'users' => $users, - 'funcaoParticipantes' => $funcaoParticipantes, - 'participantes' => $participantes, - 'arquivos' => $arquivos,]); + 'grandeAreas' => $grandeAreas, + 'areas' => $areas, + 'subAreas' => $subareas, + 'edital' => $edital, + 'users' => $users, + 'funcaoParticipantes' => $funcaoParticipantes, + 'participantes' => $participantes, + 'arquivos' => $arquivos, + 'enum_turno' => Participante::ENUM_TURNO, + ]); } /** @@ -1371,7 +1371,7 @@ class TrabalhoController extends Controller public function atualizar(Request $request, $id) { $edital = Evento::find($request->editalId); $hoje = now(); - + $projeto = Trabalho::find($id); if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) { diff --git a/resources/views/projeto/visualizar.blade.php b/resources/views/projeto/visualizar.blade.php index 57095e1caaa8e8ec25adb735f8e2a5c971c68d2c..9a375ee39bb246e352c0980ae09487c8d1cde12e 100644 --- a/resources/views/projeto/visualizar.blade.php +++ b/resources/views/projeto/visualizar.blade.php @@ -1,212 +1,2064 @@ @extends('layouts.app') @section('content') -