Commit 838d399b authored by GuilhermeGz's avatar GuilhermeGz
Browse files

Merge branch 'master' of https://github.com/GuilhermeGz/submeta

parents 6b5e5824 38c26e70
......@@ -109,6 +109,8 @@ class AvaliadorController extends Controller
$avaliador = $user->avaliadors->where('user_id',$user->id)->first();
$trabalho = $avaliador->trabalhos->find($request->trabalho_id);
$evento = Evento::find($request->evento);
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
// Verficação de pendencia de substituição
$aux = count(Substituicao::where('status','Em Aguardo')->whereIn('participanteSubstituido_id',$trabalho->participantes->pluck('id'))->get());
......@@ -116,7 +118,7 @@ class AvaliadorController extends Controller
return redirect()->back()->withErrors("A proposta ".$trabalho->titulo." possui substituições pendentes");
}
return view('avaliador.parecer', ['trabalho'=>$trabalho, 'evento'=>$evento]);
return view('avaliador.parecer', ['trabalho'=>$trabalho, 'evento'=>$evento, 'hoje' => $hoje]);
}
public function parecerInterno(Request $request){
......
......@@ -30,6 +30,10 @@ class StoreTrabalho extends FormRequest
//dd($this->all());
$evento = Evento::find($this->editalId);
$rules = [];
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
......@@ -65,7 +69,7 @@ class StoreTrabalho extends FormRequest
}
if ($this->has('rascunho')) {
if($this->has('rascunho')) {
$rules = [];
return $rules;
}else{
......
......@@ -32,6 +32,9 @@ class UpdateTrabalho extends FormRequest
$projeto = Trabalho::find($this->id);
$evento = Evento::find($this->editalId);
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
......
......@@ -67,23 +67,11 @@
</a>
<div class="dropdown-menu">
@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 )
@if($hoje >= $evento->inicioRevisao && $hoje <= $evento->fimRevisao)
@if($evento->flag==0)
<button disabled="disabled" class="dropdown-item">
Não ainda avaliação atribuída para você neste edital.
</button>
@else
<a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id]) }}" class="dropdown-item">
<img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt="">
Avaliar Propostas
</a>
@endif
@else
<button disabled="disabled" class="dropdown-item">
Hoje({{ date('d/m/Y', strtotime($hoje)) }}) não faz parte do período de revisão(avaliação)
</button>
@endif
<a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id]) }}" class="dropdown-item">
<img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt="">
Avaliar Propostas
</a>
@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">
Convite recusado
......
......@@ -151,7 +151,8 @@
<hr style="border-top: 1px solid#1492E6">
<div class="d-flex justify-content-end">
<div style="margin-right: 15px"><a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id])}}" class="btn btn-light" style="color: red;">Cancelar</a></div>
<div><button type="submit" class="btn btn-success">Enviar meu parecer</button></div>
<div><button type="submit" class="btn btn-success" @if($evento->inicioRevisao > $hoje || $evento->fimRevisao < $hoje) disabled @endif>Enviar meu parecer</button></div>
</div>
</form>
......
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