Unverified Commit b389bf4b authored by José Fernando Mendes da Costa's avatar José Fernando Mendes da Costa Committed by GitHub
Browse files

Merge pull request #818 from jofernando/master

tela do participante no middleware istemp
parents 028d117e 1525469e
...@@ -52,8 +52,22 @@ class UserController extends Controller ...@@ -52,8 +52,22 @@ class UserController extends Controller
$cursoPart = null; $cursoPart = null;
if ($user->participantes()->exists() && $user->participantes()->first()->curso_id) if ($user->participantes()->exists() && $user->participantes()->first()->curso_id)
$cursoPart = Curso::find($user->participantes()->first()->curso_id); $cursoPart = Curso::find($user->participantes()->first()->curso_id);
$view = 'user.perfilUser';
if ($user->tipo == 'participante')
$view = 'user.perfilParticipante';
return view('user.perfilUser', ['user' => $user, 'cursoPart' => $cursoPart]); $naturezas = Natureza::orderBy('nome')->get();
$cursos = Curso::orderBy('nome')->get();
$areaTematica = AreaTematica::orderBy('nome')->get();
return view($view)
->with([
'user' => $user,
'cursos' => $cursos,
'naturezas' => $naturezas,
'cursoPart' => $cursoPart,
'areaTematica' => $areaTematica
]);
} }
function editarPerfil(Request $request) function editarPerfil(Request $request)
...@@ -242,7 +256,7 @@ class UserController extends Controller ...@@ -242,7 +256,7 @@ class UserController extends Controller
$adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first(); $adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first();
$avaliador = Avaliador::where('user_id', '=', $id)->first(); $avaliador = Avaliador::where('user_id', '=', $id)->first();
$proponente = Proponente::where('user_id', '=', $id)->first(); $proponente = Proponente::where('user_id', '=', $id)->first();
$participante = Participante::where('user_id', '=', $id)->first(); $participante = $user->participantes()->first();
$naturezas = Natureza::orderBy('nome')->get(); $naturezas = Natureza::orderBy('nome')->get();
$cursos = Curso::orderBy('nome')->get(); $cursos = Curso::orderBy('nome')->get();
...@@ -252,14 +266,17 @@ class UserController extends Controller ...@@ -252,14 +266,17 @@ class UserController extends Controller
if ($user->tipo == 'participante') if ($user->tipo == 'participante')
$view = 'user.perfilParticipante'; $view = 'user.perfilParticipante';
return view($view)->with(['user' => $user, return view($view)
'adminResp' => $adminResp, ->with([
'avaliador' => $avaliador, 'user' => $user,
'proponente' => $proponente, 'adminResp' => $adminResp,
'participante' => $participante, 'avaliador' => $avaliador,
'cursos' => $cursos, 'proponente' => $proponente,
'naturezas' => $naturezas, 'participante' => $participante,
'cursoPart' => $cursoPart, 'cursos' => $cursos,
'areaTematica' => $areaTematica]); 'naturezas' => $naturezas,
} 'cursoPart' => $cursoPart,
'areaTematica' => $areaTematica
]);
}
} }
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