@extends('layouts.app')

@section('content')

<div class="container" style="margin-top: 100px;">

  <div class="container" >
    <div class="row" >
      <div class="col-sm-10">
        <h3>Planos do Edital: {{ $evento->nome }}</h3>
      </div>
    </div>
  </div>
  <hr>
  <table class="table table-bordered">
    <thead>
      <tr>
        <th scope="col">Nome do Projeto</th>
        <th scope="col">Data de Criação</th>
        <th scope="col">Parecer</th>
      </tr>
    </thead>
    <tbody>
      @foreach ($planos as $plano)
        <tr>
          <td>{{ $plano->titulo }}</td>
          <td>{{ $plano->created_at }}</td>
          {{-- <td>
            <a href="{{route('download', ['file' => $trabalho->anexoProjeto])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
                <img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
            </a>
          </td>
          <td>
            @foreach( $trabalho->participantes as $participante)
              @php
                if( App\Arquivo::where('participanteId', $participante->id)->first() != null){
                  $planoTrabalho = App\Arquivo::where('participanteId', $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 há planos de trabalho.
              @endif
            @endforeach
          </td> --}}
          <td>
            <div class="row">
              <form action="{{ route('avaliador.parecer.plano', ['evento' => $evento]) }}" method="POST">
                @csrf
                <input type="hidden" name="plano_id" value="{{ $plano->id }}" >
                <button type="submit" class="btn btn-primary mr-2 ml-2" >
                  Parecer
                </button>

              </form>
            </div>
          </td>
        </tr>
      @endforeach
    </tbody>
  </table>
</div>

@endsection

@section('javascript')
<script>

</script>
@endsection
