Commit 4e81e3a3 authored by alinetenorio's avatar alinetenorio
Browse files

view de projetos do participante

parent df0e9928
......@@ -3,6 +3,9 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Evento;
use App\Trabalho;
use App\Participante;
class ParticipanteController extends Controller
{
......@@ -10,4 +13,16 @@ class ParticipanteController extends Controller
return view('participante.index');
}
public function edital($id){
$edital = Evento::find($id);
$trabalhosId = Trabalho::where('evento_id', '=', $id)->select('id')->get();
$meusTrabalhosId = Participante::where('user_id', '=', Auth()->user()->id)
->whereIn('trabalho_id', $trabalhosId)->select('trabalho_id')->get();
$projetos = Trabalho::whereIn('id', $meusTrabalhosId)->get();
//dd($projetos);
return view('participante.projetos')->with(['edital' => $edital, 'projetos' => $projetos]);
}
}
......@@ -167,8 +167,8 @@
<img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px">
</a>
<div class="dropdown-menu">
<a href="{{ route('projetos.edital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center">
Projetos submetidos
<a href="{{ route('participante.edital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center">
Meus projetos
</a>
<a href="" class="dropdown-item" style="text-align: center">
Visualizar resultado
......
@extends('layouts.app')
@section('content')
<div class="container" style="margin-top: 100px;">
<div class="container" >
<div class="row" >
<div class="col-sm-10">
<h3>Meus Editais</h3>
</div>
</div>
</div>
<hr>
@if(auth()->user()->tipo === "participante")
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome do Edital</th>
<th scope="col">Status</th>
<th scope="col">Data de Criação</th>
<th scope="col">Baixar edital</th>
<th scope="col">Opção</th>
</tr>
</thead>
<tbody>
@foreach ($eventos as $evento)
<tr>
<td>
<a href="{{ route('evento.visualizar',['id'=>$evento->id]) }}" class="visualizarEvento">
{{ $evento->nome }}
</a>
</td>
<td></td>
<td>{{ $evento->created_at }}</td>
<td style="text-align: center">
<a href="{{ route('baixar.edital', ['id' => $evento->id]) }}">
<img src="{{asset('img/icons/file-download-solid.svg')}}" width="15px">
</a>
</td>
<td>
<div class="btn-group dropright dropdown-options">
<a id="options" class="dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px">
</a>
<div class="dropdown-menu">
<a href="{{ route('projetos.edital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center">
Projetos submetidos
</a>
<a href="" class="dropdown-item" style="text-align: center">
Visualizar resultado
</a>
{{--
<a href="" class="dropdown-item" style="text-align: center">
Resultado preeliminar
</a>
<a href="" class="dropdown-item" style="text-align: center">
Resultado final
</a> --}}
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
\ No newline at end of file
@extends('layouts.app')
@section('content')
<div class="container" style="margin-top: 100px;">
<div class="container" >
<div class="row" >
<div class="col-sm-10">
<h3>Projetos do edital {{ $edital->nome }}</h3>
<h6 style="color: rgb(4, 78, 4);">Submissão irá até o dia {{ date('d-m-Y', strtotime($edital->fimSubmissao)) }}</h6>
</div>
<div class="col-sm-2">
<!-- Se usuário não é proponente, redirecionar para view de cadastro -->
@if(Auth::user()->proponentes == null)
<a href="{{ route('proponente.create' )}}" class="btn btn-primary">Criar projeto</a>
@else
<a href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-primary">Criar projeto</a>
@endif
</div>
</div>
</div>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome do projeto</th>
<th scope="col">Status</th>
<th scope="col">Data de Criação</th>
<th scope="col">Opção</th>
</tr>
</thead>
<tbody>
@foreach ($projetos as $projeto)
<tr>
<td>
{{ $projeto->titulo }}
</td>
@if($projeto->status == 'Avaliado')
<td style="color: rgb(6, 85, 6)">Avaliado</td>
@elseif($projeto->status == 'Submetido')
<td style="color: rgb(0, 0, 0)">Submetido</td>
@endif
<td>{{ date('d-m-Y', strtotime($projeto->updated_at)) }}</td>
<td>
<div class="btn-group dropright dropdown-options">
<a id="options" class="dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px">
</a>
<div class="dropdown-menu">
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Visualizar projeto
</a>
@if($projeto->status == 'Submetido')
<a href="{{ route('trabalho.destroy', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Sair do projeto
</a>
@endif
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
@section('javascript')
<script>
</script>
@endsection
\ No newline at end of file
......@@ -35,6 +35,7 @@ Route::post('/proponente/cadastro', 'ProponenteController@store'
//######### Participante ########################################
Route::get('/participante/index', 'ParticipanteController@index' )->name('participante.index');
Route::get('/participante/edital/{id}', 'ParticipanteController@edital' )->name('participante.edital');
//######### Rotas Administrador #################################
Route::get('/perfil-usuario', 'UserController@minhaConta')->middleware('auth' )->name('user.perfil');
......
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