<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- CSRF Token -->
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>{{ config('app.name') }} @yield('title')</title>

        <!--favicon link-->
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

        <!-- Styles -->
        <link href="{{ asset('css/app.css') }}" rel="stylesheet">
        @yield('third_party_styles')
        <link href="{{ asset('css/layout.css') }}" rel="stylesheet">
        @yield('styles')
    </head>
    <body>
        <a name="top"></a>
        <!-- Set adminmode -->
        @guest
        {{session()->put(["adminmode",false])}}
        @else
        {{session()->has("adminmode") ? "" : session("adminmode",false)}}
        @endguest
        <div id="app">
            <div class="header-section">
                <div class="row no-gutters">
                    <div class="col-sm-12">
                        @include('layouts.segments.banner')
                    </div>
                    <div>
                        <nav class="navbar navbar-default navbar-static-top navbar-right right-nav">
                            <div class="navbar-header">
                                <!-- Collapsed Hamburger -->
                                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".main-nav" aria-expanded="false">
                                    <span class="sr-only">Toggle Navigation</span>
                                    <span class="icon-bar"></span>
                                    <span class="icon-bar"></span>
                                    <span class="icon-bar"></span>
                                </button>
                            </div>
                        </nav>
                    </div>
                </div>
                <nav class="navbar navbar-default navbar-static-top left-nav">
                    <div class="container">
                        <div class="navbar-header">
                            <div class="collapse navbar-collapse main-nav">
                                <!-- Left Side Of Navbar -->
                                <ul class="nav navbar-nav">
                                    @include('layouts.segments.navigation')
                                </ul>
                            </div>
                        </div>
                    </div>
                </nav>
            </div>
            <!--this is a line
<hr class="divider">-->
            <div class="container alerts">
                <!-- display normal messages -->
                @if(Session::has('message'))
                <div class="alert alert-success">{!! session('message') !!}</div>
                @endif
                <!-- display error messages -->
                @if(!empty($errors->all()))
                <div class="alert alert-error">
                    @foreach ($errors->all() as $error)
                    <div>{{ $error }}</div>
                    @endforeach
                </div>
                @endif
                @yield('content_wrapper')
            </div>

            <!--push footer to bottom of page-->
            <div class="footer" >
                @include('layouts.segments.footer')
            </div>
        </div>

        <!-- Scripts -->
        <script src="{{ asset('js/app.js') }}"></script>
        @yield('scripts')
        <script>
            $(window).resize(function(){
                setTimeout(function(){
                    showBTT();
                },100);
            });
            function showBTT(){
                if($(window).height()*1.5<$(document).height()){
                    $('.back-to-top').show();
                }else{
                    $('.back-to-top').hide();
               }
            }
        </script>
    </body>
</html>
