
mixin option( value, selected )
    if selected
        option( value=value, selected ) #{value}
    else
        option( value=value ) #{value}

mixin check_box(name,label,required)
    .form-group
        input(type="hidden", name=name, value=0)
        label(for='checkbox1')
            span #{label}
        input#checkbox1.checkbox.style-2(type='checkbox',name=name, checked=false)


mixin input_text( name, label, placeholder, required, value, type )
    .form-group
        label.control-label( for=name ) #{label}
        input.form-control( name=name type=type?type:'text' placeholder=placeholder value=value )


mixin input_textarea( name, label, placeholder, required, value )
    .form-group
        label.control-label( for=name ) #{label}
        textarea.form-control( name=name type="text" placeholder=placeholder ) #{value}


mixin select_options( name, label, options, required, selectedValue, functionCall )
    .form-group
        label.control-label( for=name ) #{label}
        select.form-control( name=name onchange = functionCall)
            each val in options
                if selectedValue == val
                    +option( val,true )
                else
                    +option( val,false )


mixin select_options_onchange( name, label, options, required, selectedValue, functionCall )
    .form-group
        label.control-label( for=name ) #{label}
        select.form-control( name=name onchange=functionCall)
            each val in options
                if selectedValue == val
                    +option( val,true )
                else
                    +option( val,false )
mixin form_labels_row( label,value, css )
    div.form-group(class=css)
        label.col-xs-4.control-label #{label} :
        div.col-xs-4
        p #{value}
