<?php
$this->css($this->assetModule('front/front.css'));
$this->jQuery('ui/jquery-ui.min.js');
$this->Backbone();
$this->headMeta('noindex', 'robots');
?>
<div class="row user-section-wrapper">
    <div class="col-md-3">
        <?php include $this->template('./profile-sidebar.phtml'); ?>
    </div>
    <div class="col-md-9" id="user-js-compound">
        <?php include $this->template('flash-messenger'); ?>

        <div class="page-header">
            <h1><?php echo _escape($title); ?>
                <small>
                    <?php echo sprintf(__('Update %s'), $title); ?>
                    <a href="#user-info-add" class="user-js-add"><?php _e('Add new'); ?></a>
                </small>
            </h1>
        </div>
        <div class="user-info-list">
        </div>
        <div class="user-info-add" id="user-info-add">
            <div class="clearfix user-add-legend">
                <h4>
                    <?php _e('Add new'); ?>
                </h4>
                <div class="user-legend-linea"></div>
            </div>
            <?php echo $this->form($form); ?>
        </div>
    </div>
</div>
<script type="text/template" id="field-template">
    <div class="user-info-header">
        <a class="btn btn-link btn-user-edit js-edit"><?php _e('Edit'); ?></a>
        <button class="close js-delete" type="button">×</button>
    </div>
    <div class="user-info-body">
        <dl class="dl-horizontal user-field-dl" style="margin: 15px;">
            <% _.each(fields, function(field) { %>
            <dt><%- field.title %>
            <dd>
                <% if (field.value) { %>
                <%- field.value %>
                <% } else { %>
                <em class="text-muted"><?php _e('Unfiled'); ?></em>
                <% } %>
                <% }); %>
        </dl>
    </div>
</script>
<script>
    $('#user-js-compound').data('config', {
        urlRoot: '<?php echo $this->url('default', ['module' => 'user', 'controller' => 'profile']); ?>',
        groupId: '<?php echo $group_id; ?>',
        compounds: <?php echo json_encode($compounds) ?>,
        deleteConfirm: '<?php _e('Are you sure to delete this record?'); ?>'
    });
</script>
<script src="<?php echo $this->assetModule('front/compound.js'); ?>"></script>

