@include('clumsy::templates.head')

<div class="master">
    <div class="filters">
        <a href="{{ route('admin.jury-vote.jury-votes') }}" class="btn btn-lg {{ $selection ? 'btn-default' : 'btn-info' }}">Todos</a>

        <?php
                if (Contest::showShortPreSelectionButtonInJuriAdmin()){?>
                    <a href="{{ route('admin.jury-vote.jury-votes', ['selection' => true]) }}" class="btn btn-lg {{ !$selection ? 'btn-default' : 'btn-info' }}">Pré-selecção</a>
                <?php }

                ?>




    </div>

    @foreach ($bands as $band)
        <table border="0" cellpadding="0" cellspacing="0" align="center" width="96%" height="0" class="bandaforjuri">
            <tr align="left" valign="top">
                <td colspan="3">
                    <h2><b>{{ $band->name }}</b></h2>
                </td>
            </tr>
            <tr align="left" valign="top">
                <td width="33.33%">
                    <span>Primeira música</span>
                </td>
                <td width="33.33%">
                    <span>Segunda música</span>
                </td>
                <td width="33.33%">
                    <span>ID</span>
                </td>
            </tr>
            <tr align="left" valign="top">
                <td width="33.33%">
                    <iframe src="//www.youtube.com/embed/{{ $band->youtube_id }}?rel=0" width="310" height="200" frameborder="0" allowfullscreen="true"></iframe>
                </td>
                <td width="33.33%">
                    @if ($band->second_youtube_id !== '')
                    <iframe src="//www.youtube.com/embed/{{ $band->second_youtube_id }}?rel=0" width="310" height="200" frameborder="0" allowfullscreen="true"></iframe>
                    @else
                    Não há segundo video
                    @endif
                </td>
                <td width="33.33%">
                    @if ($band->interview_youtube_id !== '')
                    <iframe src="//www.youtube.com/embed/{{ $band->interview_youtube_id }}?rel=0" width="310" height="200" frameborder="0" allowfullscreen="true"></iframe>
                    @else
                    Não há entrevista
                    @endif
                </td>
            </tr>
            <tr align="left" valign="top">
                <td>
                    <h3>Bio</h3>
                    <p>{{ $band->bio }}</p>
                </td>
                <td>
                    <h3>Elementos</h3>
                    @foreach ($band->elements as $elem)
                        <span><b>{{$elem->name}}</b> - {{$elem->function}} </span>
                    @endforeach
                </td>
                <td align="center">
                    <h3>Votar</h3>
                    <select class="rating" name="rating-{{ $band->id }}">
                        @foreach($ratings as $rating)
                        <option {{ $band->hasJurorRating($user->id) === $rating ? 'selected' : '' }} value="{{ route('admin.vote.post-jury-votes', $band->id) }}">{{ $rating }}</option>
                        @endforeach
                    </select>
                </td>
            </tr>
        </table>
    @endforeach
    {{ $bands->links() }}
</div>

@include('clumsy::templates.footer')
