doctype html

mixin fa(type, text, title)
	span(class='fa fa-'+type, title=title)
	if text
		| 	
		= text

mixin faSpinner(text)
	i(class='fa fa-circle-o-notch fa-spin')
	if text
		| 	
		= text

mixin faLink(faType, href, text, title)
	a(href=href)
		+fa(faType, text, title)
		
mixin faLinkBlank(faType, href, text, title)
	a(href=href, target='_blank')
		+fa(faType, text, title)
		
mixin faButtonSmall(faType, href, text, title)
	a.btn.btn-default.btn-xs(href=href, title=title)
		+fa(faType, text)
		
mixin faButtonDefault(faType, href, text, title)
	a.btn.btn-default(href=href, title=title)
		+fa(faType, text)
		
mixin faButtonPrimary(faType, href, text, title)
	a.btn.btn-primary(href=href, title=title)
		+fa(faType, text)
		
mixin buttonPrimary(href, text, title)
	a.btn.btn-primary(href=href, title=title)= text
	
mixin faButtonSubmit(faType, text, title)
	button.btn.btn-warning(type='submit', title=title)
		+fa(faType, text)

mixin buttonSubmit(text, title)
	button.btn.btn-warning(type='submit', title=title)= text	

mixin buttonHome()
	a.btn.btn-primary(href='/', title='Home')= 'Home'

mixin inputHidden(id, value)
	input(type='hidden', name=id, id=id, value=value)

mixin inputRequired(type, id, text, value)
	.form-group
		label!= text
		input.form-control(type=type, name=id, id=id, required, value=value)

mixin input(type, id, text, value)
	.form-group
		label!= text
		input.form-control(type=type, name=id, id=id, value=value)

mixin inputWithPlaceholder(type, id, text, value)
	.form-group
		input.form-control(type=type, name=id, id=id, value=value, placeholder=text)

mixin check(id, text, value)
	.checkbox
		label
			if value
				input(type='checkbox', name=id, id=id, checked='checked')
			else
				input(type='checkbox', name=id, id=id)
			!= text


html
	head
		title= title
		meta(name='viewport', content='width=device-width, initial-scale=1')
		link(href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css", rel="stylesheet")
		link(href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css", rel="stylesheet")
		script(src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js')
		script(src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js")
		script(src="//builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v2.0.0.js")
		block headScript
	body
	.container
		block content
