extends layout

block content
    h1= title
    div.container
        form.form-horizontal(method='post', action='')
            div.form-group
                label(class=['control-label', 'col-sm-2'],for='name') Name
                div.col-sm-10
                    input.form-control(type='text', name='name', id='name', placeholder='Name')
            div.form-group
                label(class=['control-label', 'col-sm-2'],for='name') Surname
                div.col-sm-10
                    input.form-control(type='text', name='surname', id='surname', placeholder='Surname')

            div.form-group
                div(class=['col-sm-offset-2', 'col-sm-10'])
                    button(type='submit', class=['btn', 'btn-primary'], name='submit') Submit


extends layout

mixin textInput(fieldName, fieldLabel)
    div.form-group
        label(class=['control-label', 'col-sm-2'], for='#{fieldName}') #{fieldLabel}
        div.col-sm-10
            input.form-control(type='text', name='#{fieldName}', id='#{fieldName}', placeholder='#{fieldLabel}')

block content
    h1= title
    div.container
        form.form-horizontal(method='post', action='')
            +textInput('name', 'Name')
            +textInput('surname', 'Surname')

            div.form-group
                div(class=['col-sm-offset-2', 'col-sm-10'])
                    button(type='submit', class=['btn', 'btn-primary'], name='submit') Submit


Use mixin to reduce repetitions
Use mixin to reduce repetitions
