@(title: String)(content: Html)

@usuario() = @{
	Http.Context.current().args.get("usuario").asInstanceOf[Usuario]
}

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>@title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" media="screen" href="@routes.Assets.versioned("bootstrap/css/bootstrap.min.css")">
        <link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png")">
    </head>
    <body>
	    	<header class="navbar navbar-default">
		  <div class="container" role="presentation">
		    <ul class="nav navbar-nav navbar-right">
		      @if(usuario() != null) {
			      <li><a href="@routes.UsuarioController.painel">Painel</a></li>
			      @if(usuario().isAdmin()) {
			      <li><a href="@routes.AdminController.usuarios">Usuários</a></li>
			      <li><a href="@routes.AdminController.produtos">Produtos</a></li>
			      }
			      <li><a href="@routes.UsuarioController.fazLogout">Logout</a></li>
		      }
		    </ul>
		  </div>
		</header>
		@notificacoes()
		<main class="container">
			@content
		</main>
		<script type="text/javascript" src="@routes.Assets.versioned("bootstrap/js/jquery.min.js")"></script>
		<script type="text/javascript" src="@routes.Assets.versioned("bootstrap/js/bootstrap.min.js")"></script>
    </body>
</html>
