{% import "@base/macros/options.twig" as options %}

{% set inputAttr %}
    {% if pluginsInfo.gallery.isPuliginActive != 'true' %} disabled="disabled" {% endif %}
    {% if pluginsInfo.gallery.isPuliginActive == 'true' and settings.plugins.photoGallery.enabled == 1 %} checked="checked" {% endif %}
{% endset %}
{% if inputAttr|trim|length %}
    {% set galleryRowAttributes = {
    'input': inputAttr|trim,
    } %}
{% endif %}

<div class="sc-tab-content" data-tab="plugins">
    <div class="mp-options">
        {{ options.enablePluginRow(
            'Photo Gallery',
            'plugins[photoGallery]',
            'photo-gallery-enable',
            galleryRowAttributes,
            'Settings'
        ) }}
        {% if pluginsInfo.gallery.isPuliginActive == 'true' %}
            <div id="toogle-photo-gallery-enable" style="display: none;">
                <div class="row">
                    <div class="col-md-12">
                        {% if(pluginsInfo.gallery.presets| length) %}
                            <table class="sc-table mbs-plugins-preset-list">
                                <tr>
                                    <th class="mbs-gg-header">
                                        <label class="sc-checkbox">
                                            <input type="checkbox" class="mbs-setting-select-all" data-type="gallery">
                                            <div class="sc-checkbox-state"></div>
                                        </label>
                                    </th>
                                    <th>{{ translate('Gallery Name') }}</th>
                                </tr>
                                {% for val1 in pluginsInfo.gallery.presets %}
                                    <tr>
                                        <td>
                                            <label class="sc-checkbox">
                                                <input type="checkbox" class="mbs-can-setting-checked mbs-type-gallery" id="mbs-gallery-{{ val1.id }}" name="plugins[photoGallery][ids][]" value="{{ val1.id }}" {% if val1.id in settings.plugins.photoGallery.ids %} checked="checked" {% endif %}>
                                                <div class="sc-checkbox-state"></div>
                                            </label>
                                        </td>
                                        <td>{{ val1.title }}</td>
                                    </tr>
                                {% endfor %}
                            </table>
                        {% else %}
                            <div class="mbs-plug-msg-info">{{ translate('You have no Galleries for now. Create your Gallery or Enable Membership feature for galleries which you want to use as presets!.') }}</div>
                        {% endif %}
                    </div>
                </div>
            </div>
        {% else %}
            <div class="mbs-plug-not-install">
                {{ translate('You need to install Photo Gallery by Supsystic to use this feature. ') }}
                <a target="_blank" href="{{ pluginsInfo.gallery.installUrl }}">{{ translate('Install') }}</a>
                {{ translate(' plugin from your admin area, or visit it\'s official page on Wordpress.org ') }}
                <a target="_blank" href="{{ pluginsInfo.gallery.installWpUrl }}">{{ translate('here') }}</a>

            </div>
        {% endif %}

        {{ environment.dispatcher.dispatch('backendMainContentSettingsSliderOpt') }}
        {{ environment.dispatcher.dispatch('backendMainContentSettingsGoogleMapsEasyOpt') }}
		{{ environment.dispatcher.dispatch('backendMainContentSettingsSocialShareOpt') }}
    </div>
</div>