<?php
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Blog Pro for Magento 2
 */
?>
<div class="enabled-blocks">

    <div ng-if="isMyDrag(type)"
         ng-drop="true"
         ng-drop-success="onDropSuccess($data, $attrs, $oAttrs)"
         ng-type="{{type}}"
         ng-sub-type="{{subtype}}"
         class="drop-place">
        <?= $block->escapeHtml(__("Drop here")); ?>
    </div>
    <div
        ng-drag="true"
        ng-drag-data="block"
        ng-drag-begin="onDragBegin($data, $attrs)"
        ng-drag-cancel="onDragCancel($data, $attrs)"
        class="block {{block}} {{type}}"
        ng-type="{{type}}"
        ng-sub-type="{{subtype}}"
        ng-repeat-start="block in value[subtype]">

        <div
            class="block-title">
            {{getBlockLabel(type, block)}}
            <a ng-prevent-drag="true"
               class="remove-block"
               ng-click="removeBlock(subtype, $index)"
               title="<?= $block->escapeHtml(__("Remove Block")); ?>">
                <i class="glyphicons bin"></i>
            </a>
        </div>
        <div class="block-content"
             ng-style="{'background-image': 'url('+ getBackendImage(type, block) + ')'}"
             ng-prevent-drag="true"></div>

        <div class="fixed"></div>
    </div>

    <div ng-if="isMyDrag(type, block)"
         ng-drop="true"
         ng-drop-success="onDropSuccess($data, $attrs, $oAttrs)"
         ng-drop-data="{{block}}"
         class="drop-place"
         ng-type="{{type}}"
         ng-sub-type="{{subtype}}"
         ng-repeat-end  >
        <?= $block->escapeHtml(__("Drop here")); ?>
    </div>
</div>

<div class="available-blocks" ng-if="!displayAddButton(type, subtype)">
    <a ng-click="addToColumn(subtype, block.value)"
       class="block-to-add"
       ng-repeat="block in available[type]"
       title="{{block.label}}" >
        {{block.label}}
    </a>
</div>

<a ng-click="showVariantsForColumn(subtype)"
   class="add"
   title="<?= $block->escapeHtml(__("Add Block to Column")); ?>"
   ng-if="displayAddButton(type, subtype)">+</a>
