"git@sites.upe.br:walter.felipe/submeta.git" did not exist on "4cf7a411add16804de27c0e55d4d297578812985"
Commit b82be112 authored by Gabriel-31415's avatar Gabriel-31415
Browse files

add separacao de editar no user admin

parent f22ae55f
......@@ -67,11 +67,10 @@ class AdministradorController extends Controller
public function showProjetos(Request $request){
$evento = Evento::where('id', $request->evento_id)->first();
$editais = Evento::with('trabalhos')->get();
$projetos = Trabalho::all();
return view('administrador.listaProjetos')->with(['projetos' => $projetos, 'evento' => $evento]);
return view('administrador.listaProjetos', compact('projetos', 'evento','editais'));
}
public function visualizarParecer(Request $request){
......
......@@ -321,15 +321,16 @@ class TrabalhoController extends Controller
public function show($id)
{
$projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
if(Auth::user()->tipo == 'administrador'){
$projeto = Trabalho::find($id);
}
if(!$projeto){
// $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
// $projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
// if(Auth::user()->tipo == 'administrador'){
// $projeto = Trabalho::find($id);
// }
// if(!$projeto){
// // $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
return back()->withErrors(['Proposta não encontrada!']);
}
// return back()->withErrors(['Proposta não encontrada!']);
// }
$projeto = Trabalho::find($id);
$edital = Evento::find($projeto->evento_id);
$grandeAreas = GrandeArea::all();
$areas = Area::all();
......
......@@ -19,39 +19,67 @@
</div>
@endif
<div class="row">
<div class="col-md-12">
@foreach ($editais as $edital)
<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="headingOne">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapse{{ $edital->id }}" aria-expanded="true" aria-controls="collapse{{ $edital->id }}">
{{ $edital->nome }}
</button>
</h2>
</div>
<div id="collapse{{ $edital->id }}" class="collapse " aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome da Proposta</th>
<th scope="col">Autor</th>
<th scope="col">Email</th>
<th scope="col">Data de Criação</th>
<th scope="col">Status</th>
<th scope="col">Opção</th>
</tr>
</thead>
<tbody id="eventos">
@foreach ($edital->trabalhos as $projeto)
<tr>
<td>
<a href="{{ route('trabalho.show',['id'=>$projeto->id]) }}" class="visualizarEvento">
{{ $projeto->titulo }}
</a>
</td>
<td>{{ $projeto->proponente->user->name }}</td>
<td>{{ $projeto->proponente->user->email }}</td>
<td>{{ date('d/m/Y', strtotime($projeto->created_at)) }}</td>
<td>{{ $projeto->status }}</td>
<td>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endforeach
</div>
<div class="col-md-12">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome da Proposta</th>
<th scope="col">Autor</th>
<th scope="col">Email</th>
<th scope="col">Data de Criação</th>
<th scope="col">Status</th>
<th scope="col">Opção</th>
</tr>
</thead>
<tbody id="eventos">
@foreach ($projetos as $projeto)
<tr>
<td>
<a href="{{ route('trabalho.show',['id'=>$projeto->id]) }}" class="visualizarEvento">
{{ $projeto->titulo }}
</a>
</td>
<td>{{ $projeto->proponente->user->name }}</td>
<td>{{ $projeto->proponente->user->email }}</td>
<td>{{ date('d/m/Y', strtotime($projeto->created_at)) }}</td>
<td>{{ $projeto->status }}</td>
<td>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
\ No newline at end of file
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