{% requireEdition CraftPro %}

<div class="cp-image-{{ imageType }}" data-type="{{ imageType }}">
    <div class="cp-current-image"
        {% if craft.rebrand.isImageUploaded(imageType) -%}
            {% set image = craft.rebrand.getImageVariable(imageType) %}
            {% if image.width > 0 and image.height > 0 %}
                 style="background-image: url('{{ image.url|e('css') }}'); width: {{ image.width }}px; height: {{ image.height }}px;"
                 data-url="{{ image.url }}"
             {% endif %}
        {%- endif %}>
    </div>

    <div class="cp-image-controls">
        <input type="file" name="image" class="hidden" />
        {% if craft.rebrand.isImageUploaded(imageType) %}
            <div class="btn upload">{% if imageType == 'logo' %}{{ block('changeLogoLabel') }}{% else %}{{ block('changeIconLabel') }}{% endif %}</div>
            <div class="btn delete">{% if imageType == 'logo' %}{{ block('deleteLogoLabel') }}{% else %}{{ block('deleteIconLabel') }}{% endif %}</div>
        {% else %}
            <div class="btn upload">{% if imageType == 'logo' %}{{ block('uploadLogoLabel') }}{% else %}{{ block('uploadIconLabel') }}{% endif %}</div>
        {% endif %}
    </div>
</div>
