<h4><?php echo $this->title; ?></h4>
<div class="row kb-amz-product-attributes">
    <div class="col-sm-6 col-md-6">
        <h5 class="label label-info"><?php echo $this->titleLeft; ?></h5>
        <form role="form" method="post">
            <ul id="sortable1" class="list-group connectedSortable" style="min-height: 50px;">
            <?php foreach($this->activeAttributes as $att => $val): ?>
                <li class="list-group-item<?php echo isset($this->defaultAttributes[$att]) ? ' list-group-item-success' : ''; ?>">
                    <?php echo substr($att, 5); ?>
                    <input 
                          type="hidden"
                          name="attr[]"
                          value="<?php echo $att;?>"
                    />
                    <input 
                          type="text"
                          name="label[]"
                          placeholder="<?php echo __('Label');?>"
                          value="<?php echo $val;?>"
                    />
                </li>
            <?php endforeach; ?>
            </ul>
            <div class="form-group">
                <button type="submit" class="btn btn-primary" name="submit" value="load"><?php echo __('Update'); ?></button>
            </div>
        </form>
    </div>
    <div class="col-sm-6 col-md-6">
        <h5 class="label label-info"><?php echo __('Available Attributes'); ?></h5>
        <ul id="sortable2" class="list-group connectedSortable" style="min-height: 300px;overflow-y: scroll;">
        <?php foreach($this->attributes as $att => $val): ?>
            <li class="list-group-item">
                <?php echo $val; ?>
                <input 
                      type="hidden"
                      name="attr[]"
                      value="<?php echo $att;?>"
                />
                <input type="text" name="label[]" placeholder="<?php echo __('Label');?>"/>
            </li>
        <?php endforeach; ?>
        </ul>
    </div>
</div>

<script>
    (function($){
        $(function() {
            $("#sortable1, #sortable2").sortable({
                connectWith: ".connectedSortable",
            });
            $("#sortable2").disableSelection();
            $("#sortable2").height($("#sortable1").height());
        });
    })(jQuery);
</script>
