{% extends 'page-base.twig' %}
{% block content %}
    <div class="page-columns">
        <div class="column">
            <!-- General Settings -->
            <div class="content-box">
                <div class="box-header">
                <span class="box-header-title">
                    <span class="box-header-icon">
                        <i class="fa-solid fa-align-left"></i>
                    </span>
                    {{ _e('Update Descriptions', 'scf-price') }}
                </span>
                </div>
                <div class="box-content">
                    <form class="box-form" id="description-updater-form" method="post">
                        <div class="form-item">
                            <span class="form-item-description">
                                {{ _e('Here you can update every description for a product, every product will get their
                                name and brand implemented at the beginning of the description.', 'scf-price') }}
                            </span>
                        </div>
                        <input type="hidden" name="_wpnonce" value="{{ function('wp_create_nonce', 'scf-price-updater') }}" />
                        <div class="form-item">
                            <label for="form-data-skip-description" class="form-item-label">{{ _e('Skip set descriptions', 'scf-price') }}</label>
                            <label class="switch">
                                <input
                                    type="checkbox"
                                    class="form-switch"
                                    name="skip_description"
                                    {% if skipDescription %}
                                        checked
                                    {% endif %}
                                />
                                <span class="slider round"></span>
                            </label>
                            <span class="form-item-description">{{ _e('Skip descriptions that already contains the brand name, if this option is disabled it wil update EVERY product') }}</span>
                        </div>
                        <div class="form-item">
                            <label for="form-data-description-text" class="form-item-label">{{ _e('Description text', 'scf-price') }}</label>
                            <textarea
                                id="form-data-description-text"
                                class="form-input"
                                name="description_text"
                            >{{ descriptionBody }}</textarea>
                            <span class="form-item-description">{{ _e('Here you can add the text that gets added to the
                            description of the product. You can use %PRODUCT_NAME% to implement the name of the product.
                            You can use %PRODUCT_BRAND% to implement the brand of the product.') }}</span>
                        </div>
                        <div class="form-item">
                            <label for="form-data-limit" class="form-item-label">{{ _e('Limit', 'scf-price') }}</label>
                            <input
                                type="number"
                                id="form-data-limit"
                                class="form-input"
                                name="count_limit"
                                value="{{ countLimit }}"
                            />
                            <span class="form-item-description">{{ _e('Amount of products that gets updated.
                            Don\'t set this to high, because this will result in a 504-timeout.
                            Recommended is around maximum 100-200') }}</span>
                        </div>
                        <div class="form-item">
                            <button
                                type="button"
                                id="submit-update-description"
                                name="update_descriptions"
                                class="form-button button-primary"
                            >
                                {{ _e('Update Descriptions', 'scf-price') }}
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="column"></div>
    </div>
{% endblock %}