// https://color.adobe.com/de/create/color-wheel/?base=2&rule=Analogous&selected=3&name=Mein%20Color-Thema&mode=rgb&rgbvalues=0.3333333333333333,0.4666666666666667,0.1450980392156863,0.89,0.8199770812980544,0.5651209725440018,1,0.4508887128558591,0.10106228707217113,0.46,0.14302521008403368,0.24734712946944964,0.06274509803921569,0.06274509803921569,0.06274509803921569&swatchOrder=0,1,2,3,4
doctype html
extends ../node_modules/jade-bootstrap/_bootstrap


mixin textarea-val(id,placeholder,label,name,value,rows)
	.form-group
		label(for="#{id}") #{label}
		textarea.form-control(id="#{id}",placeholder="#{placeholder}",name="#{name}",rows="#{rows}")= value
		
mixin input-val(type,id,placeholder,label,name,value)
	.form-group
		label(for="#{id}") #{label}
		input.form-control(type="#{type}",id="#{id}",placeholder="#{placeholder}",name="#{name}",value="#{value}")
		

mixin input-val-simple(type,id,placeholder,label,name,value)
	input.form-control(type="#{type}",id="#{id}",placeholder="#{placeholder}",name="#{name}",value="#{value}")


mixin status-message(type, message, reasons)
	div(class="alert alert-#{type}" role="alert")= message
		if reasons
			ul
				each val in reasons
					li= val



mixin navbar-main(style)
	- var style = (typeof style === 'undefined') ? "default" : style
	nav( role="navigation", class=["navbar", "navbar-" + style] )
		block
				
mixin navbar-header(name, id)
	.navbar-header
		button.navbar-toggle.collapsed( type="button", data-toggle="collapse", data-target="#" + id, aria-expanded="false", aria-controls="navbar")
			span.sr-only Toggle navigation
			span.icon-bar
			span.icon-bar
			span.icon-bar
		a.navbar-brand(href="/")= name
		block
				
mixin navbar-collapse(id)
	.collapse.navbar-collapse( id=id )
		block
	
mixin loginBox
	if !loginName
		form.form#formLogin(action="/login",method="post")
			+input("name","id-username","name","Username:","username")
			+input("password","id-password","******","Password:","password")
			button.btn.btn-default(type="submit") Login
	else
		p Du bist eingeloggt.
		form.form#formLogin(action="/login",method="post")
			input(type='hidden',name='targetLogout',value='logout')
			.row
				.col-sm-5.text-center
					button.btn.btn-default(type="submit") Logout
				.col-sm-7.text-center
					a.btn.btn-default(href="/login#admin") Admin-Panel

					
					
block styles
	//link(rel="stylesheet",type="text/css",href="/bin/bootstrap/css/bootstrap.min.css")
	link(rel="stylesheet",type="text/css",href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css")
	link(rel="stylesheet",type="text/css",href="https://fonts.googleapis.com/css?family=Bitter")
	link(rel="stylesheet",type="text/css",href="/bin/css/style.css")
	block page-styles
block scripts
	script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js")
	script(src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js")
	script(type="text/javascript",src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js")
	script(type="text/javascript",src="http://maps.google.com/maps/api/js?sensor=false")
	script(type="text/javascript",src="/bin/js/angular-directives.js")
	script(type="text/javascript",src="/bin/js/angular-init.js")
	
block speisekarte-drop
	+nav_header Speisen
	each val in menuJSON.food
		+nav_item("/speisekarte#"+val.anchor)= val.name
	+nav_divider
	+nav_header Getränke
	each val in menuJSON.drinks
		+nav_item("/speisekarte#"+val.anchor)= val.name
	
block kontakt-drop
	+nav_item("/kontakt#reservieren") Reservierung
	+nav_item("/kontakt#anfahrt") Anfahrt
	+nav_item("/kontakt#impressum") Impressum
	
block body
	block vars
	+navbar-main("default navbar-inverse")
		+navbar-header("Restaurant Reiskorn","dropdown_menu")
			a.navbar-brand(style="padding: 3px;",rel="home",href="/",title="Restaurant Reiskorn")
				img(style="height: 100%;width: auto;",src="/bin/image/logo.png")
		+navbar-collapse("dropdown_menu")
			ul.nav.navbar-nav
				if (pageTitle=='Home')
					+nav_item("/","active") Home
				else
					+nav_item("/", "") Home
					
				if (pageTitle=='Speisekarte')
					+nav_item_dropdown("/speisekarte", "active")(label="Speisekarte")
						block speisekarte-drop
				else
					+nav_item_dropdown("/speisekarte")(label="Speisekarte")
						block speisekarte-drop
				
				if (pageTitle=='Kontakt')
					+nav_item_dropdown("/kontakt", "active")(label="Kontakt")
						block kontakt-drop
				else
					+nav_item_dropdown("/kontakt")(label="Kontakt")
						block kontakt-drop
						
				if (true)
					+nav_item("/kontakt#impressum") Impressum
			ul.nav.navbar-nav.pull-right
				li.dropdown#menuLogin
					if !loginName
						a.dropdown-toggle#navLogin(href="/login",data-toggle="dropdown") Login
						.dropdown-menu#loginDropdown(style="padding:17px")
							+loginBox
					else
						a.dropdown-toggle#navLogin(href="/login",data-toggle="dropdown") Hallo #{loginName}
						.dropdown-menu#loginDropdown(style="padding:17px")
							+loginBox
	main(data-ng-app="myApp")
		block content
// block scripts