<?php
//echo '<pre>';
//dd($editionUrls);
//exit(__FILE__ . '--' . __LINE__);
?>

@include('partials.head')

@include('partials.login-modal')

@section('after-head')
    @if (!$errors->isEmpty())
    <div id="general-error" class="reveal-modal">
        <p class="title">{{ $errors->first() }}</p>
        <a class="close-reveal-modal">x</a>
    </div>
    @endif
@show

<div id="container">

    @include("editions.{$edition}.cookies")
    

    <header>
        <div class="menu">
            
             <a class="logo-bands" href="{{ route('home') }}">
                <img src="{{ url('/assets/img/logo-bands.png') }}" width="100%" height="100%" border="0" alt="logo Bands">
            </a>

            @if($displayNav)
            
            <nav>
                <div id="langSelector">
                    <a class='active' href="{{$editionUrls['active']['link']}}">{{$editionUrls['active']['country']}}</a>
                    <div id='inactiveLangsContainer'>
                    @foreach ($editionUrls['inactive'] as $country)
                        <a class='' href="{{ $country['link'] }}">{{ $country['country'] }}</a>
                    @endforeach
                    </div>
                </div>
                <a href="{{ route('contest') }}" class="{{ Route::currentRouteName() === 'contest' ? 'select' : '' }}" title="{{ trans('frontend.menu.concurso') }}">{{ trans('frontend.menu.concurso') }}</a>
                <a href="{{ route('past-editions', array('edition' => 2019)) }}" class="{{ Route::currentRouteName() === 'past-editions' ? 'select' : '' }}" title="{{ trans('frontend.menu.anteriores') }}">{{ trans('frontend.menu.anteriores') }}</a>
                <a href="{{ route('participate') }}" class="{{ Route::currentRouteName() === 'participate' ? 'select' : '' }}" title="{{ trans('frontend.menu.inscricao') }}">{{ trans('frontend.menu.inscricao') }}</a>
                @if ($status === 'end')
                    @if ($winner)
                        <a href="{{ route('vote') }}" class="{{ Route::currentRouteName() === 'vote' ? 'select' : '' }}" title="{{ trans('frontend.menu.bandas') }}">{{ trans('frontend.menu.bandas') }}</a>
                    @elseif ($has_finalists)
                        <a href="{{ route('vote') }}" class="{{ Route::currentRouteName() === 'vote' ? 'select' : '' }}" title="{{ trans('frontend.menu.final') }}">{{ trans('frontend.menu.final') }}</a>
                    @else
                        <a href="{{ route('vote') }}" class="{{ Route::currentRouteName() === 'vote' ? 'select' : '' }}" title="{{ trans('frontend.menu.vote') }}">{{ trans('frontend.menu.bandas') }}</a>
                    @endif
                @else
                    @if (Contest::hasBegun())
                        <a href="{{ route('vote') }}" class="{{ Route::currentRouteName() === 'vote' ? 'select' : '' }}" title="{{ trans('frontend.menu.vote') }}">{{ trans('frontend.menu.vote') }}</a>
                    @endif
                @endif
                <a href="{{ route('faqs') }}" class="{{ Route::currentRouteName() === 'faqs' ? 'select' : '' }}"  title="{{ trans('frontend.menu.faqs') }}">{{ trans('frontend.menu.faqs') }}</a>
            </nav>
            @endif
            
            <a class="logo-edp" href="{{ Contest::institutionalUrl() }}" target="_blank">
                <img src="{{ $edpLogo }}" width="100%" height="100%" border="0" alt="logo EDP">
            </a>
           
            <div class="btn-menu">
                <div class="middle">
                    <div class="burger"></div>
                    <div class="close"></div>
                </div>
            </div>
            <br style="clear:both">
        </div>
    </header>

    @yield('before-content')

    @yield('master')

    <footer>
        <p>{{ trans('frontend.footer-sentence') }}</p>
        <p> &copy; Copyright {{date('Y') }} – EDP
            • <a target='_blank' href="{{trans('frontend.linkcookies')}}">{{trans('frontend.linkcookies-text')}}</a>
            • <a target='_blank' href="{{trans('frontend.linkterms')}}">{{trans('frontend.linkterms-text')}}</a>
            @if(Contest::getEdition() !='pt-BR')
            • <a target='_blank' href="{{trans('frontend.linkprivacy')}}">{{trans('frontend.linkprivacy-text')}}</a>
            @endif
            • <a target='_blank' href="mailto:{{Contest::email()}}">{{Contest::email()}}</a> 
            @if(Contest::getEdition() =='pt')
                • {{trans('frontend.footer-follow-us')}} <a target='_blank' class="footerSpotifyLink" href="{{trans('frontend.footer-spotifylist')}}"></a>
            @endif
            @if(Contest::getEdition() =='pt-BR')
            • {{trans('frontend.footer-follow-us')}} <a target='_blank' class="footerSpotifyLink" href="{{trans('frontend.footer-spotifylist')}}">
                <a target='_blank' class="footerFbLink" href="https://pt-pt.facebook.com/edplivebandsbrasil/">
            </a>
            @endif
            @if(Contest::getEdition() =='es')
            • {{trans('frontend.footer-follow-us')}} <a target='_blank' class="footerSpotifyLink" href="{{trans('frontend.footer-spotifylist')}}">
            </a>
            @endif
        </p>
    </footer>

</div>

@yield('after-content')

@include('partials.footer')
