!!! 5
html(lang='pt-br')
	head
		include ../templates/head-mobile
	body
		- var title  = (m.record) ? 'Editar '+m.label : 'Adicionar '+m.label

		div(data-role='page', data-theme='c')
			form(action='/'+m.name+'/mobForm', method='POST')
				div(data-role='header', data-theme='b')
					
					if m.record
						a(href='/'+m.name+'/remove/'+m.record._id, data-icon='delete', data-theme='a') Deletar
					h1= title
					button.ui-btn-right(type='submit', data-ajax='false', data-icon='check', data-theme='b') Salvar

				div(data-role='content')
					if m.record
						input(type='hidden', name='_id', value=m.record._id)
					each field in m.fields
						label(for=field.name)= field.label+':'
						include ../templates/field-mobile