Commit 7b04089f authored by Gabriel-31415's avatar Gabriel-31415
Browse files

add de planos de trabalho em avaliador e restricao em editar projeto

parent 7ccae9d4
...@@ -86,8 +86,11 @@ class ProponenteController extends Controller ...@@ -86,8 +86,11 @@ class ProponenteController extends Controller
$proponente = Proponente::where('user_id', Auth()->user()->id)->first(); $proponente = Proponente::where('user_id', Auth()->user()->id)->first();
$projetos = Trabalho::where('proponente_id', $proponente->id)->get(); $projetos = Trabalho::where('proponente_id', $proponente->id)->get();
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.projetos')->with(['projetos' => $projetos]); return view('proponente.projetos')->with(['projetos' => $projetos, 'hoje'=>$hoje]);
} }
public function projetosEdital($id) { public function projetosEdital($id) {
$edital = Evento::find($id); $edital = Evento::find($id);
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<div class="container" > <div class="container" >
<div class="row" > <div class="row" >
<div class="col-sm-12"> <div class="col-sm-12">
<h3>Meus Editais</h3> <h3>Meus Editais</h3>
</div> </div>
</div> </div>
</div> </div>
<hr> <hr>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th scope="col">Nome do Edital</th> <th scope="col">Nome do Edital</th>
<th scope="col">Data de Inicio da Revisão</th> <th scope="col">Data de Inicio da Revisão</th>
<th scope="col">Data de Fim da Revisão</th> <th scope="col">Data de Fim da Revisão</th>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<tbody> <tbody>
@foreach ($eventos as $evento) @foreach ($eventos as $evento)
<tr> <tr>
<td> <td>
{{ $evento->nome }} {{ $evento->nome }}
</td> </td>
<td>{{ date('d/m/Y', strtotime($evento->inicioRevisao)) }}</td> <td>{{ date('d/m/Y', strtotime($evento->inicioRevisao)) }}</td>
...@@ -32,15 +32,15 @@ ...@@ -32,15 +32,15 @@
<td> <td>
<div class="btn-group dropright dropdown-options"> <div class="btn-group dropright dropdown-options">
<a id="options" class="dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <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"> <img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px">
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
@if(!is_null(Auth::user()->avaliadors->eventos->where('id', 1)->first()->pivot->convite) && Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite == true ) @if(!is_null(Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite) && Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite == true )
<a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id]) }}" class="dropdown-item"> <a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id]) }}" class="dropdown-item">
<img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt=""> <img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt="">
Projetos para avaliar Projetos para avaliar
</a> </a>
@elseif(!is_null(Auth::user()->avaliadors->eventos->where('id', 1)->first()->pivot->convite) && Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite == false) @elseif(!is_null(Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite) && Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite == false)
<button disabled="disabled" class="dropdown-item"> <button disabled="disabled" class="dropdown-item">
Convite recusado Convite recusado
</button> </button>
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
Recusar Convite Recusar Convite
</a> </a>
@endif @endif
</div> </div>
</div> </div>
</td> </td>
...@@ -71,6 +71,6 @@ ...@@ -71,6 +71,6 @@
@section('javascript') @section('javascript')
<script> <script>
</script> </script>
@endsection @endsection
...@@ -7,17 +7,18 @@ ...@@ -7,17 +7,18 @@
<div class="container" > <div class="container" >
<div class="row" > <div class="row" >
<div class="col-sm-10"> <div class="col-sm-10">
<h3>Trabalhos do Edital: {{ $evento->nome }}</h3> <h3>Trabalhos do Edital: {{ $evento->nome }}</h3>
</div> </div>
</div> </div>
</div> </div>
<hr> <hr>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th scope="col">Nome do Projeto</th> <th scope="col">Nome do Projeto</th>
<th scope="col">Data de Criação</th> <th scope="col">Data de Criação</th>
<th scope="col">Baixar</th> <th scope="col">Projeto</th>
<th scope="col">Plano de Trabalho</th>
<th scope="col">Parecer</th> <th scope="col">Parecer</th>
</tr> </tr>
</thead> </thead>
...@@ -32,6 +33,24 @@ ...@@ -32,6 +33,24 @@
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px"> <img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a> </a>
</td> </td>
<td>
@foreach( $trabalho->participantes as $participante)
@php
if( App\Arquivo::where('participanteId', $participante->pivot->participante_id)->first() != null){
$planoTrabalho = App\Arquivo::where('participanteId', $participante->pivot->participante_id)->first()->nome;
}else{
$planoTrabalho = null;
}
@endphp
@if ($planoTrabalho != null)
<a href="{{route('download', ['file' => $planoTrabalho])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a>
@else
Não planos de trabalho.
@endif
@endforeach
</td>
<td> <td>
<div class="row"> <div class="row">
<form action="{{ route('avaliador.parecer', ['evento' => $evento]) }}" method="POST"> <form action="{{ route('avaliador.parecer', ['evento' => $evento]) }}" method="POST">
...@@ -40,7 +59,7 @@ ...@@ -40,7 +59,7 @@
<button type="submit" class="btn btn-primary mr-2 ml-2" > <button type="submit" class="btn btn-primary mr-2 ml-2" >
Parecer Parecer
</button> </button>
</form> </form>
</div> </div>
</td> </td>
...@@ -54,6 +73,6 @@ ...@@ -54,6 +73,6 @@
@section('javascript') @section('javascript')
<script> <script>
</script> </script>
@endsection @endsection
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
<div class="container" > <div class="container" >
<div class="row" > <div class="row" >
<div class="col-sm-12"> <div class="col-sm-12">
<h3>Meus Projetos</h3> <h3>Meus Projetos</h3>
</div> </div>
</div> </div>
</div> </div>
<hr> <hr>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th scope="col">Nome do projeto</th> <th scope="col">Nome do projeto</th>
<th scope="col">Status</th> <th scope="col">Status</th>
<th scope="col">Data de Criação</th> <th scope="col">Data de Criação</th>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</thead> </thead>
<tbody> <tbody>
@foreach ($projetos as $projeto) @foreach ($projetos as $projeto)
<tr> <tr>
<td> <td>
{{ $projeto->titulo }} {{ $projeto->titulo }}
...@@ -42,16 +42,19 @@ ...@@ -42,16 +42,19 @@
@elseif($projeto->status == 'Rascunho') @elseif($projeto->status == 'Rascunho')
<td style="color: rgb(0, 0, 0)">Rascunho</td> <td style="color: rgb(0, 0, 0)">Rascunho</td>
@endif @endif
<td>{{ date('d-m-Y', strtotime($projeto->updated_at)) }}</td> <td>{{ date('d-m-Y', strtotime($projeto->updated_at)) }}</td>
<td> <td>
<div class="btn-group dropright dropdown-options"> <div class="btn-group dropright dropdown-options">
<a id="options" class="dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <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"> <img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px">
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
@if($projeto->evento->inicioSubmissao <= $hoje && $hoje <= $projeto->evento->fimSubmissao)
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;"> <a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar projeto Editar projeto
</a> </a>
@else
@endif
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar projeto Visualizar projeto
</a> </a>
...@@ -61,13 +64,13 @@ ...@@ -61,13 +64,13 @@
<a href="" class="dropdown-item" style="text-align: center"> <a href="" class="dropdown-item" style="text-align: center">
Resultado Resultado
</a> --}} </a> --}}
@if($projeto->status == 'Submetido') @if($projeto->status == 'Submetido')
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="dropdown-item" style="text-align: center" data-toggle="modal" data-target="#modal{{$projeto->id}}"> <button type="button" class="dropdown-item" style="text-align: center" data-toggle="modal" data-target="#modal{{$projeto->id}}">
Excluir projeto Excluir projeto
</button> </button>
@endif @endif
</div> </div>
</div> </div>
</td> </td>
...@@ -105,4 +108,4 @@ ...@@ -105,4 +108,4 @@
<script> <script>
</script> </script>
@endsection @endsection
\ No newline at end of file
...@@ -66,9 +66,12 @@ ...@@ -66,9 +66,12 @@
<img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px"> <img src="{{asset('img/icons/ellipsis-v-solid.svg')}}" style="width:8px">
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
@if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao)
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;"> <a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar projeto Editar projeto
</a> </a>
@else
@endif
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar projeto Visualizar projeto
</a> </a>
......
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