<html
    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    data-namespace-typo3-fluid="true"
>

<f:layout name="Module" />

<f:section name="Before">
    <f:asset.module identifier="@typo3/backend/modal.js"/>
    <f:asset.module identifier="@typo3/scheduler/scheduler.js"/>
    <f:asset.module identifier="@typo3/scheduler/scheduler-add-group.js"/>

    <f:be.pageRenderer
        addJsInlineLabels="{
            'scheduler.createGroup': 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:function.group.add',
            'scheduler.groupName': 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:function.group.label',
            'scheduler.modalCancel': 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:button.cancel',
            'scheduler.modalOk': 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:button.group.modalOk',
            'scheduler.group.error.title': 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:msg.group.notification.error.title',
            'scheduler.group.error.message': 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:msg.group.notification.error.message'
        }"
    />
</f:section>

<f:section name="Content">

    <h1><f:translate key="LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:function.edit" arguments="{0: currentData.taskName}"/></h1>

    <form class="form task-form" name="tx_scheduler_form" id="tx_scheduler_form" method="post">
        <input type="hidden" name="action" value="edit" />
        <input type="hidden" name="tx_scheduler[uid]" value="{uid}" />
        <input type="hidden" name="tx_scheduler[class]" id="task_class" value="{currentData.class}">

        <fieldset class="form-section">
            <h2 class="form-section-headline"><f:translate key="LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:scheduler.form.palettes.general" /></h2>
            <div class="row">
                <f:render partial="AddEditDisableField" arguments="{currentData: currentData}" />
                <div class="form-group">
                    <label class="form-label" for="task_class"><f:translate key="LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.class"/></label>
                    <div class="formengine-field-item">
                        <div class="form-control-wrap">
                            <div class="form-wizards-wrap">
                                <div class="form-wizards-item-element">
                                    <select class="form-select" disabled>
                                        <option selected>{currentData.taskName}</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <f:render partial="AddEditTaskGroupField" arguments="{currentData: currentData, registeredTaskGroups: registeredTaskGroups, returnUrl: returnUrl}" />
            </div>
        </fieldset>

        <fieldset class="form-section">
            <h2 class="form-section-headline"><f:translate key="LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:scheduler.form.palettes.settings" /></h2>
            <div class="row">
                <f:render partial="AddEditAdditionalFields" arguments="{currentData: currentData, additionalFields: additionalFields}"/>
                <div id="extraFieldsSection"></div>
            </div>
        </fieldset>

        <fieldset class="form-section">
            <h2 class="form-section-headline"><f:translate key="LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:scheduler.form.palettes.timing" /></h2>
            <div class="row">
                <f:render partial="AddEditTypeField" arguments="{currentData: currentData}" />
                <f:render partial="AddEditStartEndFields" arguments="{currentData: currentData}" />
                <f:render partial="AddEditFrequencyField" arguments="{currentData: currentData, frequencyOptions:frequencyOptions}" />
                <f:render partial="AddEditMultipleField" arguments="{currentData: currentData}" />
            </div>
        </fieldset>

        <fieldset class="form-section">
            <div class="row">
                <f:render partial="AddEditDescriptionField" arguments="{currentData: currentData}" />
            </div>
        </fieldset>
    </form>

    <form name="tx_scheduler_form_delete_{uid}" id="tx_scheduler_form_delete_{uid}" method="post">
        <input name="action[delete]" type="hidden" value="{uid}">
    </form>

    <f:render partial="ServerTime" arguments="{dateFormat: dateFormat}" />

</f:section>

</html>
