<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Trees and fruits</title>
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.1/css/select2.min.css"/>
    <link rel="stylesheet" href="/css/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="/css/bootstrap.css">
    <link href="/css/all.css" rel="stylesheet">
    <link href="/css/bootstrap-rating.css" rel="stylesheet">

	<!-- Fonts -->
	<link href='//fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400italic,700,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
		<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
		<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
		<![endif]-->
</head>
<body>
<div id="locale" style="display:none">{{ Session::get('locale') }}</div>
	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only">Toggle Navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">Trees & Fruits</a>
			</div>

			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav">
					<li><a href="/">{{ Lang::get('nav.home') }}</a></li><li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ Lang::get('nav.products') }}<span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li><a href="/product/create">{{ Lang::get('nav.create') }}</a></li>
						</ul>
					</li>
                    <li><a href="/contact">{{ Lang::get('nav.contact') }}</a></li>
                    <li><a href="/about">{{ Lang::get('nav.about') }}</a></li>
				</ul>

				<ul class="nav navbar-nav navbar-right">
                    <li><a href="/lang?lang=et"><span class="badge">ET</span> eesti</a></li>
                    <li><a href="/lang?lang=en"><span class="badge">EN</span> English</a></li>
					@if (Auth::guest())
						<li><a href="/auth/login">{{ Lang::get('nav.login') }}</a></li>
						<li><a href="/auth/register">{{ Lang::get('nav.register') }}</a></li>
					@else

                        @if(Auth::user()->hasNewNotifications())
                            <li id="notifications" class="dropdown hasnew">
                        @else
                            <li id="notifications" class="dropdown">
                        @endif
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                                <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
                            </a>
                            <ul class="dropdown-menu" role="menu">
                                @foreach(Auth::user()->notifications as $notification)
                                <li><a href="{{ $notification->href }}">{{ $notification->message }}</a></li>
                                @endforeach
                            </ul>
                        </li>

                        <li><a href="#"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span></a></li>
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ Auth::user()->name }} <span class="caret"></span></a>
							<ul class="dropdown-menu" role="menu">
								<li><a href="/product/my">{{ Lang::get('nav.myproducts') }}</a></li>
                                <li><a href="/transactions">{{ Lang::get('nav.transactions') }}</a></li>
                                <li><a href="#">{{ Lang::get('nav.messages') }}</a></li>
								<li><a href="#">{{ Lang::get('nav.settings') }}</a></li>
								<li><a href="/auth/logout">{{ Lang::get('nav.logout') }}</a></li>
							</ul>
						</li>
					@endif
				</ul>
			</div>
		</div>
	</nav>
	<div class="container">
		@include('partials.flash')
		@yield('content')
	</div>
    <div class="footer">
        <hr>
        <p>Puud & Viljad</p>
        <p>Mihkel Allorg</p>
        <p>Kontakt: <a href="mailto:mihkel.allorg@gmail.com">mihkel.allorg@gmail.com</a></p>

        <!-- Scripts -->
        <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="text/javascript"></script>
        <script src="/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.1/js/select2.min.js" type="text/javascript"></script>
        <script src="//raw.githubusercontent.com/moment/moment/develop/min/moment-with-locales.min.js" type="text/javascript"></script>
        <script src="//raw.githubusercontent.com/Eonasdan/bootstrap-datetimepicker/master/src/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
        <script src="/js/jquerymain.js" type="text/javascript"></script>
        <script src="/js/bootstrap-rating.min.js" type="text/javascript"></script>
        @yield('footer')
    </div>
</body>
</html>
