

<!-- Template of the text field -->
<script type="text/x-just" data-just="field_type_text">
    <div class="form-group col-lg-4 col-xs-12 col-sm-6 col-md-6">
        <label class="control-label" ><%- field.title %></label>
        <input 
            type="text" 
            class="form-control" 
            placeholder="<%- field.placeholder %>" 
            id="field_<%- field.name %>"
            <% if(field.value !== undefined){ %>
                value="<%- field.value %>"
            <% } else if(item_id && pmObj.model.items[item_id][field.name] !== undefined){ %>
                value="<%- pmObj.model.items[item_id][field.name] %>"
            <% } %>
        >
        <div class="help-block"><%- field.help || '' %></div>
    </div>
</script>

<!-- Template of the disabled field -->
<script type="text/x-just" data-just="field_type_disabled">
    <div class="form-group col-lg-4 col-xs-12 col-sm-6 col-md-6">
        <label class="control-label" ><%- field.title %></label>
        <input 
            type="text" 
            class="form-control" 
            placeholder="<%- field.placeholder %>" 
            disabled
            id="field_<%- field.name %>"
            <% if(item_id){ %>
                <%= pmObj.model.items[item_id].justAttr(field.name, 'value') %>
            <% } %>
        >
        <div class="help-block"><%- field.help || '' %></div>
    </div>
</script>

<!-- Template of the password field -->
<script type="text/x-just" data-just="field_type_password">
    <div class="form-group col-lg-4 col-xs-12 col-sm-6 col-md-6">
        <label class="control-label" ><%- field.title %></label>
        <input 
            type="password" 
            class="form-control" 
            placeholder="<%- field.placeholder %>" 
            id="field_<%- field.name %>"
            <% if(item_id && false){ %>
                value="<%- pmObj.model.items[item_id][field.name] %>"
            <% } %>
        >
        <div class="help-block"><%- field.help || '' %></div>
    </div>
</script>

<!-- Template of the boolean field -->
<script type="text/x-just" data-just="field_type_boolean">
    <div class="form-group col-lg-4 col-xs-12 col-sm-6 col-md-6 boolean-select">
        <label class="control-label" ><%- field.title %></label>
        <div class="form-control <% if(item_id && pmObj.model.items[item_id][field.name]){ %>
                                    selected
                                 <% } else if(field.default) { %>
                                    selected
                                 <% } %>"
                onclick="$(this).toggleClass('selected');"
                onselectstart="return false"
                onmousedown="return false"
                style="cursor: pointer;"
                id="field_<%- field.name %>">
            <div class="ico-on fa fa-toggle-on"></div>
            <div class="ico-off fa  fa-toggle-off"></div>
            <div class="boolean-title" >Boolean value</div>
        </div>
        <div class="help-block"><%- field.help || '' %></div>
    </div> 
</script>

<!-- Template of the textarea field -->
<script type="text/x-just" data-just="field_type_textarea">
    <div class="form-group col-lg-12 col-xs-12 col-sm-12 col-md-12">
        <label class="control-label" ><%- field.title %></label>
        <textarea
            class="form-control"
            style="resize:vertical; min-height:75px;"
            placeholder="<%- field.placeholder %>"
            id="field_<%- field.name %>"
            <% var t_a_value = ""
               if(field.value !== undefined){  %>
                <% t_a_value = field.value %>
            <% } else if(item_id && pmObj.model.items[item_id][field.name] !== undefined){ %>
                <%  t_a_value = pmObj.model.items[item_id][field.name] %>
            <% } %>
        ><%- t_a_value %></textarea>
        <div class="help-block"><%- field.help || '' %></div>
    </div>
</script>