Unverified Commit cd09440d authored by Gabriel Antônio da Silva's avatar Gabriel Antônio da Silva Committed by GitHub
Browse files

Merge pull request #60 from lmts-ufape/dataSubmissao

Data submissao
parents 2cb4ff42 ede2c6bd
...@@ -35,8 +35,10 @@ class EventoController extends Controller ...@@ -35,8 +35,10 @@ class EventoController extends Controller
$eventos = Evento::all(); $eventos = Evento::all();
// $comissaoEvento = ComissaoEvento::all(); // $comissaoEvento = ComissaoEvento::all();
// $eventos = Evento::where('coordenadorId', Auth::user()->id)->get(); // $eventos = Evento::where('coordenadorId', Auth::user()->id)->get();
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('coordenador.home',['eventos'=>$eventos]); return view('coordenador.home',['eventos'=>$eventos, 'hoje'=>$hoje]);
} }
......
...@@ -10,6 +10,7 @@ use App\User; ...@@ -10,6 +10,7 @@ use App\User;
use App\Trabalho; use App\Trabalho;
use App\Proponente; use App\Proponente;
use App\Evento; use App\Evento;
use Carbon\Carbon;
class ProponenteController extends Controller class ProponenteController extends Controller
{ {
...@@ -24,7 +25,9 @@ class ProponenteController extends Controller ...@@ -24,7 +25,9 @@ class ProponenteController extends Controller
public function editais(){ public function editais(){
$eventos = Evento::all(); $eventos = Evento::all();
return view('proponente.editais', ['eventos'=> $eventos] ); $hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.editais', ['eventos'=> $eventos, 'hoje'=>$hoje] );
} }
public function store(Request $request){ public function store(Request $request){
...@@ -89,7 +92,9 @@ class ProponenteController extends Controller ...@@ -89,7 +92,9 @@ class ProponenteController extends Controller
public function projetosEdital($id) { public function projetosEdital($id) {
$edital = Evento::find($id); $edital = Evento::find($id);
$projetos = Trabalho::where('evento_id', '=', $id)->get(); $projetos = Trabalho::where('evento_id', '=', $id)->get();
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos]); return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos, 'hoje'=>$hoje]);
} }
} }
...@@ -82,8 +82,10 @@ ...@@ -82,8 +82,10 @@
@if(Auth::user()->proponentes == null) @if(Auth::user()->proponentes == null)
<br><a href="{{ route('proponente.create' )}}" class="visualizarEvento">Criar projeto</a> <br><a href="{{ route('proponente.create' )}}" class="visualizarEvento">Criar projeto</a>
@else @else
@if($evento->inicioSubmissao <= $hoje && $hoje <= $evento->fimSubmissao)
<br><a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="visualizarEvento">Criar projeto</a> <br><a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="visualizarEvento">Criar projeto</a>
@endif @endif
@endif
@else @else
<a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" class="visualizarEvento">Visualizar edital</a> <a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" class="visualizarEvento">Visualizar edital</a>
@endif @endif
......
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
<div class="card" style="margin-top:50px"> <div class="card" style="margin-top:50px">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Enviar Projeto</h5> <h5 class="card-title">Enviar Projeto</h5>
{{-- @if($errors->any())
<div class="col-md-12" style="margin-top: 100px;">
<div class="alert alert-success">
<p>{{ $errors}}</p>
</div>
</div>
@endif --}}
<p class="card-text"> <p class="card-text">
<form method="POST" name="formTrabalho" action="{{route('trabalho.store')}}" enctype="multipart/form-data"> <form method="POST" name="formTrabalho" action="{{route('trabalho.store')}}" enctype="multipart/form-data">
@csrf @csrf
...@@ -317,7 +325,7 @@ ...@@ -317,7 +325,7 @@
<div class="col-sm-5"> <div class="col-sm-5">
<label>Nome Completo*</label> <label>Nome Completo*</label>
<input type="text" style="margin-bottom:10px" class="form-control @error('nomeParticipante') is-invalid @enderror" name="nomeParticipante[]" placeholder="Nome" value="{{old('nomeParticipante.'.$i)}}"> <input type="text" style="margin-bottom:10px" class="form-control @error('nomeParticipante') is-invalid @enderror" name="nomeParticipante[]" placeholder="Nome" value="{{old('nomeParticipante.'.$i)}}">
@error('nomeParticipante') @error('nomeParticipante.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
...@@ -326,7 +334,7 @@ ...@@ -326,7 +334,7 @@
<div class="col-sm-4"> <div class="col-sm-4">
<label>E-mail*</label> <label>E-mail*</label>
<input type="email" style="margin-bottom:10px" class="form-control @error('emailParticipante') is-invalid @enderror" name="emailParticipante[]" placeholder="email" value="{{old('emailParticipante.'.$i)}}"> <input type="email" style="margin-bottom:10px" class="form-control @error('emailParticipante') is-invalid @enderror" name="emailParticipante[]" placeholder="email" value="{{old('emailParticipante.'.$i)}}">
@error('emailParticipante') @error('emailParticipante.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
...@@ -339,13 +347,12 @@ ...@@ -339,13 +347,12 @@
@foreach($funcaoParticipantes as $funcaoParticipante) @foreach($funcaoParticipantes as $funcaoParticipante)
<option @if(old('funcaoParticipante.'.$i)==$funcaoParticipante->id ) selected @endif value="{{$funcaoParticipante->id}}">{{$funcaoParticipante->nome}}</option> <option @if(old('funcaoParticipante.'.$i)==$funcaoParticipante->id ) selected @endif value="{{$funcaoParticipante->id}}">{{$funcaoParticipante->nome}}</option>
@endforeach @endforeach
</select>
@error('funcaoParticipante') @error('funcaoParticipante')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</select>
</div> </div>
</div> </div>
<h6 class="mb-1">Possui plano de trabalho?</h6> <h6 class="mb-1">Possui plano de trabalho?</h6>
...@@ -612,8 +619,8 @@ ...@@ -612,8 +619,8 @@
"@foreach($funcaoParticipantes as $funcaoParticipante)"+ "@foreach($funcaoParticipantes as $funcaoParticipante)"+
"<option value='{{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}}</option>"+ "<option value='{{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}}</option>"+
"@endforeach"+ "@endforeach"+
"@error('funcaoParticipante')" + "@error('funcaoParticipante'. $i)" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" + "<span class='invalid-feedback'" + " role='alert'" + " style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" + "<strong>{{ $message }}</strong>" +
"</span>" + "</span>" +
"@enderror" + "@enderror" +
...@@ -666,39 +673,6 @@ ...@@ -666,39 +673,6 @@
"</div>"; "</div>";
} }
// function montarLinhaInputPlanoTrabalho(){
// return "<div class="+"row"+">"+
// "<div class="+"col-sm-4"+">"+
// "<label>Nome Completo</label>"+
// "<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+'form-control emailCoautor'+" name="+'nomePlanoTrabalho[]'+" placeholder="+"Nome"+" required>"+
// "</div>"+
// "<div class="+"col-sm-7" +">"+
// "<label for="+"nomeTrabalho"+">Anexo </label>"+
// "<div class="+"input-group"+">"+
// "<div class='input-group-prepend'>"+
// "<span class='input-group-text' id='inputGroupFileAddon01'>Selecione um arquivo:</span>"+
// "</div>"+
// "<div class='custom-file'>"+
// "<input type='file' class='custom-file-input' id='inputGroupFile01'"+
// "aria-describedby='inputGroupFileAddon01' name='anexoPlanoTrabalho[]'>"+
// "<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"+
// "</div>"+
// "</div>"+
// "@error('arquivo')"+
// "<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+
// "<strong>{{ $message }}</strong>"+
// "</span>"+
// "@enderror"+
// "</div>"+
// "<div class="+"col-sm-1"+">"+
// "<a class="+"deletePlano"+">"+
// "<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+
// "</a>"+
// "</div>"+
// "</div>";
// }
function areas() { function areas() {
var grandeArea = $('#grandeArea').val(); var grandeArea = $('#grandeArea').val();
......
...@@ -49,9 +49,11 @@ ...@@ -49,9 +49,11 @@
<a href="{{ route('proponente.projetosEdital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('proponente.projetosEdital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center">
Projetos submetidos Projetos submetidos
</a> </a>
@if($evento->inicioSubmissao <= $hoje && $hoje <= $evento->fimSubmissao)
<a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="dropdown-item" style="text-align: center">
Criar projeto Criar projeto
</a> </a>
@endif
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Visualizar resultado Visualizar resultado
</a> --}} </a> --}}
......
...@@ -25,8 +25,13 @@ ...@@ -25,8 +25,13 @@
<h3>Projetos do edital {{ $edital->nome }}</h3> <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> <h6 style="color: rgb(4, 78, 4);">Submissão irá até o dia {{ date('d-m-Y', strtotime($edital->fimSubmissao)) }}</h6>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-1">
<a href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-primary" style="position:relative; float: right;">Criar projeto</a> <a href="{{ route('proponente.editais') }}" class="btn btn-primary" style="position:relative; float: right;">Voltar</a>
</div>
<div class="col-sm-2">
<a @if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-primary" @else href="#" class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="O periodo de submissão foi encerrado." @endif style="position:relative; float: right;">Criar projeto</a>
</div> </div>
</div> </div>
</div> </div>
......
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