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

<f:layout name="Page/MovePageLayout" />

<f:section name="Content">
    <h2>
        <f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:headline" arguments="{0: element.recordTitle, 1: element.record.uid}" />
    </h2>
    <p><f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:currentPath" /> {element.recordPath}</p>
    <input type="hidden" name="elementRecordTitle" id="elementRecordTitle" value="{element.recordTitle}" />

    <div class="form-row">
        <div class="form-check form-switch">
            <input type="checkbox" name="makeCopy" id="makeCopy" value="1" {f:if(condition: makeCopyChecked, then: 'checked')} class="form-check-input">
            <label for="makeCopy" class="form-check-label"><f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:makeCopy" /></label>
        </div>
    </div>

    <div class="page-position">
        <f:if condition="{hasEditPermissions} && {isDifferentPage}">
            <div class="page-position-control page-position-control-top">
                <button data-action="paste" data-position="{positions.above}" class="btn btn-default" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:action.pasteAbove')}">
                    <typo3-backend-icon identifier="apps-pagetree-drag-move-above" size="small"></typo3-backend-icon>
                    <f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:action.pasteAbove" />
                </button>
            </div>
        </f:if>

        <f:if condition="{isDifferentPage}">
            <f:then>
                <div class="page-position-target">
                    <div class="page-position-target-abstract">
                        <span title="{target.recordTooltip}"><core:iconForRecord table="pages" row="{target.record}" /></span>
                        <strong>{target.recordTitle} [{target.record.uid}]</strong>
                    </div>
                    <div class="page-position-target-meta">
                        <f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.path" />: {target.recordPath}
                    </div>
                </div>
            </f:then>
            <f:else>
                <f:be.infobox state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR')}">
                    <f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:samePageConflict" arguments="{0: target.recordTitle, 1: target.record.uid}" />
                </f:be.infobox>
            </f:else>
        </f:if>


        <f:if condition="{hasEditPermissions} && {isDifferentPage}">
            <f:if condition="!{targetHasSubpages}">
                <div class="page-position-control page-position-control-right">
                    <button data-action="paste" data-position="{positions.inside}" class="btn btn-default" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:action.pasteInto')}">
                        <typo3-backend-icon identifier="apps-pagetree-drag-move-between" size="small"></typo3-backend-icon>
                        <f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:action.pasteInto" />
                    </button>
                </div>
            </f:if>

            <div class="page-position-control page-position-control-bottom">
                <button data-action="paste" data-position="{positions.below}" class="btn btn-default" title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:action.pasteBelow')}">
                    <typo3-backend-icon identifier="apps-pagetree-drag-move-below" size="small"></typo3-backend-icon>
                    <f:translate key="LLL:EXT:backend/Resources/Private/Language/Wizards/move_page.xlf:action.pasteBelow" />
                </button>
            </div>
        </f:if>
    </div>

</f:section>

</html>
