<commit_before>{% extends "_layouts/cp" %}
{% set title = "Migration Manager"|t %}

{% import "_includes/forms" as forms %}

{% set tabs = {
    tab1: { label: "Create Migration"|t, url: url('migrationmanager') },
    tab2: { label: "Migrations"|t, url: url('migrationmanager/migrations') },
    tab3: {label: "Log"|t, url: url('migrationmanager/log')}
} %}

{% set selectedTab = 'tab1' %}

{% set content %}
<div class="migration-manager">
    <form class="field toolbar" action="" method="post" accept-charset="UTF-8">
        <input type="hidden" name="action" value="migrationManager/createMigration">
        {{ getCsrfInput() }}

        <h1>Fields</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allFields" class="checkbox checkbox-toggle" name="allFields" value="all" data-selector="field"> <label for="allFields">Name</label>

                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Type</th>
                    <th>Group</th>
                </tr>
            </thead>
            <tbody class="fields">
                {% for field in craft.fields.getAllFields() %}

                <tr class="field" >
                    <th scope="row" class="name">
                        <input type="checkbox" id="field{{ field.id }}" class="checkbox" name="field[]" value="{{ field.id }}"> <label for="field{{ field.id }}">{{ field }}</label>
                    </th>
                    <td>
                        <code>{{ field.handle }}</code>
                    </td>
                    <td>
                        {{ field.type }}
                    </td>
                    <td>
                        {{ field.group }}
                    </td>

                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Sections</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allSections" class="checkbox checkbox-toggle" name="allSections" value="all" data-selector="section"> <label for="allSections">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Type</th>
                    <th>URL Format</th>
                </tr>
            </thead>
            <tbody class="sections">
                {% for section in craft.sections.getAllSections() %}

                <tr class="section" >
                    <th scope="row" class="name">
                        <div class="section checkboxsection">
                            <input type="checkbox" id="section{{ section.id }}" class="checkbox" name="section[]" value="{{ section.id }}"> <label for="section{{ section.id }}">{{ section }}</label>
                        </div>
                    </th>
                    <td>
                        <code>{{ section.handle }}</code>
                    </td>
                    <td>
                        {{ section.type }}
                    </td>
                    <td>
                        {{ section.urlFormat }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Asset Sources</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allAssetSources" class="checkbox checkbox-toggle" name="allAssetSources" value="all" data-selector="assetSource"> <label for="allAssetSources">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Type</th>
                </tr>
            </thead>
            <tbody class="assetSources">
                {% for assetSource in craft.migrationManager.getAssetSources() %}

                <tr class="assetSource">
                    <th scope="row" class="name">
                        <input type="checkbox" id="assetSource{{ assetSource.id }}" class="checkbox" name="assetSource[]" value="{{ assetSource.id }}"> <label for="assetSource{{ assetSource.id }}">{{ assetSource }}</label>
                    </th>
                    <td>
                        <code>{{ assetSource.handle }}</code>
                    </td>
                    <td>
                        {{ assetSource.type }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Image Transforms</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allAssetTransforms" class="checkbox checkbox-toggle" name="allAssetTransforms" value="all" data-selector="assetTransform"> <label for="allAssetTransforms">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Mode</th>
                    <th>Dimensions</th>
                    <th>Format</th>
                </tr>
            </thead>
            <tbody class="assetTransforms">
                {% for assetTransform in craft.migrationManager.getAssetTransforms() %}
                <tr>
                    <th scope="row" class="name">
                        <input type="checkbox" id="assetTransform{{ assetTransform.id }}" class="checkbox" name="assetTransform[]" value="{{ assetTransform.id }}"> <label for="assetTransform{{ assetTransform.id }}">{{ assetTransform }}</label>
                    </th>
                    <td>
                        <code>{{ assetTransform.handle }}</code>
                    </td>
                    <td>
                        {{ assetTransform.mode }}
                    </td>
                    <td>
                        <code>{{ assetTransform.width }} &times; {{ assetTransform.height }}</code>
                    </td>
                    <td>
                        {{ (assetTransform.format) ? assetTransform.format : 'auto' }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Globals</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allGlobals" class="checkbox checkbox-toggle" name="allGlobals" value="all" data-selector="global"> <label for="allGlobals">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                </tr>
            </thead>
            <tbody class="globals">
                {% for global in craft.globals.getAllSets() %}

                <tr class="global">
                    <th scope="row" class="name">
                        <input type="checkbox" id="global{{ global.id }}" class="checkbox" name="global[]" value="{{ global.id }}"> <label for="global{{ global.id }}">{{ global }}</label>
                    </th>
                    <td>
                        <code>{{ global.handle }}</code>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>
        
        <h1>Categories</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allCategories" class="checkbox checkbox-toggle" name="allCategories" value="all" data-selector="category"> <label for="allCategories">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                </tr>
            </thead>
            <tbody class="categories">
                {% for category in craft.categoryGroups.getAllGroups() %}

                <tr class="category">
                    <th scope="row" class="name">
                        <input type="checkbox" id="category{{ category.id }}" class="checkbox" name="category[]" value="{{ category.id }}"> <label for="category{{ category.id }}">{{ category }}</label>
                    </th>
                    <td>
                        <code>{{ category.handle }}</code>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Tags</h1>
        <table class="data fullwidth collapsible">
            <thead>
            <tr>
                <th>
                    <div class="field checkboxfield">
                        <input type="checkbox" id="allTags" class="checkbox checkbox-toggle" name="allTags" value="all" data-selector="tag"> <label for="allTags">Name</label>
                    </div>
                </th>
                <th>Handle</th>
            </tr>
            </thead>
            <tbody class="tags">
            {% for tag in craft.migrationManager.getAllTagGroups() %}

                <tr class="tag">
                    <th scope="row" class="name">
                        <input type="checkbox" id="tag{{ tag.id }}" class="checkbox" name="tag[]" value="{{ tag.id }}"> <label for="tag{{ tag.id }}">{{ tag }}</label>
                    </th>
                    <td>
                        <code>{{ tag.handle }}</code>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Locales</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allLocales" class="checkbox checkbox-toggle" name="allLocales" value="all" data-selector="locale"> <label for="allLocales">Name</label>
                        </div>
                    </th>
                    <th>Code</th>
                </tr>
            </thead>
            <tbody class="routes">
                {% for locale in craft.i18n.getSiteLocales() %}
                <tr class="route" data-id="{{ locale.id }}">
                    <th scope="row" class="name">
                        <input type="checkbox" id="locale{{ locale.id }}" class="checkbox" name="locale[]" value="{{ locale.id }}"> <label for="locale{{ locale.id }}">{{ locale.getName() }}</label>
                    </th>
                    <td>
                        <code>{{ locale }}</code>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>User Groups</h1>
        <table class="data fullwidth collapsible">
            <thead>
            <tr>
                <th>
                    <div class="field checkboxfield">
                        <input type="checkbox" id="allUserGroups" class="checkbox checkbox-toggle" name="allUserGroups" value="all" data-selector="userGroup"> <label for="allUserGroups">Name</label>
                    </div>
                </th>
                <th>Handle</th>
            </tr>
            </thead>
            <tbody class="userGroups">
            {% for group in craft.userGroups.getAllGroups %}
                <tr class="userGroup" data-id="{{ group.id }}">
                    <th scope="row" class="name">
                        <input type="checkbox" id="userGroup{{ group.id }}" class="checkbox" name="userGroup[]" value="{{ group.id }}"> <label for="userGroup{{ group.id }}">{{ group }}</label>
                    </th>
                    <td>
                        <code>{{ group.handle }}</code>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Other Settings</h1>
        <table class="data fullwidth collapsible">
            <thead>
            <tr>
                <th><commit_msg>added check to ensure edition has user groups<commit_after>{% extends "_layouts/cp" %}
{% set title = "Migration Manager"|t %}

{% import "_includes/forms" as forms %}

{% set tabs = {
    tab1: { label: "Create Migration"|t, url: url('migrationmanager') },
    tab2: { label: "Migrations"|t, url: url('migrationmanager/migrations') },
    tab3: {label: "Log"|t, url: url('migrationmanager/log')}
} %}

{% set selectedTab = 'tab1' %}

{% set content %}
<div class="migration-manager">
    <form class="field toolbar" action="" method="post" accept-charset="UTF-8">
        <input type="hidden" name="action" value="migrationManager/createMigration">
        {{ getCsrfInput() }}

        <h1>Fields</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allFields" class="checkbox checkbox-toggle" name="allFields" value="all" data-selector="field"> <label for="allFields">Name</label>

                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Type</th>
                    <th>Group</th>
                </tr>
            </thead>
            <tbody class="fields">
                {% for field in craft.fields.getAllFields() %}

                <tr class="field" >
                    <th scope="row" class="name">
                        <input type="checkbox" id="field{{ field.id }}" class="checkbox" name="field[]" value="{{ field.id }}"> <label for="field{{ field.id }}">{{ field }}</label>
                    </th>
                    <td>
                        <code>{{ field.handle }}</code>
                    </td>
                    <td>
                        {{ field.type }}
                    </td>
                    <td>
                        {{ field.group }}
                    </td>

                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Sections</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allSections" class="checkbox checkbox-toggle" name="allSections" value="all" data-selector="section"> <label for="allSections">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Type</th>
                    <th>URL Format</th>
                </tr>
            </thead>
            <tbody class="sections">
                {% for section in craft.sections.getAllSections() %}

                <tr class="section" >
                    <th scope="row" class="name">
                        <div class="section checkboxsection">
                            <input type="checkbox" id="section{{ section.id }}" class="checkbox" name="section[]" value="{{ section.id }}"> <label for="section{{ section.id }}">{{ section }}</label>
                        </div>
                    </th>
                    <td>
                        <code>{{ section.handle }}</code>
                    </td>
                    <td>
                        {{ section.type }}
                    </td>
                    <td>
                        {{ section.urlFormat }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Asset Sources</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allAssetSources" class="checkbox checkbox-toggle" name="allAssetSources" value="all" data-selector="assetSource"> <label for="allAssetSources">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Type</th>
                </tr>
            </thead>
            <tbody class="assetSources">
                {% for assetSource in craft.migrationManager.getAssetSources() %}

                <tr class="assetSource">
                    <th scope="row" class="name">
                        <input type="checkbox" id="assetSource{{ assetSource.id }}" class="checkbox" name="assetSource[]" value="{{ assetSource.id }}"> <label for="assetSource{{ assetSource.id }}">{{ assetSource }}</label>
                    </th>
                    <td>
                        <code>{{ assetSource.handle }}</code>
                    </td>
                    <td>
                        {{ assetSource.type }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Image Transforms</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allAssetTransforms" class="checkbox checkbox-toggle" name="allAssetTransforms" value="all" data-selector="assetTransform"> <label for="allAssetTransforms">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                    <th>Mode</th>
                    <th>Dimensions</th>
                    <th>Format</th>
                </tr>
            </thead>
            <tbody class="assetTransforms">
                {% for assetTransform in craft.migrationManager.getAssetTransforms() %}
                <tr>
                    <th scope="row" class="name">
                        <input type="checkbox" id="assetTransform{{ assetTransform.id }}" class="checkbox" name="assetTransform[]" value="{{ assetTransform.id }}"> <label for="assetTransform{{ assetTransform.id }}">{{ assetTransform }}</label>
                    </th>
                    <td>
                        <code>{{ assetTransform.handle }}</code>
                    </td>
                    <td>
                        {{ assetTransform.mode }}
                    </td>
                    <td>
                        <code>{{ assetTransform.width }} &times; {{ assetTransform.height }}</code>
                    </td>
                    <td>
                        {{ (assetTransform.format) ? assetTransform.format : 'auto' }}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Globals</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allGlobals" class="checkbox checkbox-toggle" name="allGlobals" value="all" data-selector="global"> <label for="allGlobals">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                </tr>
            </thead>
            <tbody class="globals">
                {% for global in craft.globals.getAllSets() %}

                <tr class="global">
                    <th scope="row" class="name">
                        <input type="checkbox" id="global{{ global.id }}" class="checkbox" name="global[]" value="{{ global.id }}"> <label for="global{{ global.id }}">{{ global }}</label>
                    </th>
                    <td>
                        <code>{{ global.handle }}</code>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>
        
        <h1>Categories</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allCategories" class="checkbox checkbox-toggle" name="allCategories" value="all" data-selector="category"> <label for="allCategories">Name</label>
                        </div>
                    </th>
                    <th>Handle</th>
                </tr>
            </thead>
            <tbody class="categories">
                {% for category in craft.categoryGroups.getAllGroups() %}

                <tr class="category">
                    <th scope="row" class="name">
                        <input type="checkbox" id="category{{ category.id }}" class="checkbox" name="category[]" value="{{ category.id }}"> <label for="category{{ category.id }}">{{ category }}</label>
                    </th>
                    <td>
                        <code>{{ category.handle }}</code>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Tags</h1>
        <table class="data fullwidth collapsible">
            <thead>
            <tr>
                <th>
                    <div class="field checkboxfield">
                        <input type="checkbox" id="allTags" class="checkbox checkbox-toggle" name="allTags" value="all" data-selector="tag"> <label for="allTags">Name</label>
                    </div>
                </th>
                <th>Handle</th>
            </tr>
            </thead>
            <tbody class="tags">
            {% for tag in craft.migrationManager.getAllTagGroups() %}

                <tr class="tag">
                    <th scope="row" class="name">
                        <input type="checkbox" id="tag{{ tag.id }}" class="checkbox" name="tag[]" value="{{ tag.id }}"> <label for="tag{{ tag.id }}">{{ tag }}</label>
                    </th>
                    <td>
                        <code>{{ tag.handle }}</code>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <hr>

        <h1>Locales</h1>
        <table class="data fullwidth collapsible">
            <thead>
                <tr>
                    <th>
                        <div class="field checkboxfield">
                            <input type="checkbox" id="allLocales" class="checkbox checkbox-toggle" name="allLocales" value="all" data-selector="locale"> <label for="allLocales">Name</label>
                        </div>
                    </th>
                    <th>Code</th>
                </tr>
            </thead>
            <tbody class="routes">
                {% for locale in craft.i18n.getSiteLocales() %}
                <tr class="route" data-id="{{ locale.id }}">
                    <th scope="row" class="name">
                        <input type="checkbox" id="locale{{ locale.id }}" class="checkbox" name="locale[]" value="{{ locale.id }}"> <label for="locale{{ locale.id }}">{{ locale.getName() }}</label>
                    </th>
                    <td>
                        <code>{{ locale }}</code>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <hr>

        {% if CraftEdition > CraftClient %}

        <h1>User Groups</h1>
        <table class="data fullwidth collapsible">
            <thead>
            <tr>
                <th>
                    <div class="field checkboxfield">
                        <input type="checkbox" id="allUserGroups" class="checkbox checkbox-toggle" name="allUserGroups" value="all" data-selector="userGroup"> <label for="allUserGroups">Name</label>
                    </div>
                </th>
                <th>Handle</th>
            </tr>
            </thead>
            <tbody class="userGroups">
            {% for group in craft.userGroups.getAllGroups %}
                <tr class="userGroup" data-id="{{ group.id }}">
                    <th scope="row" class="name">
                        <input type="checkbox" id="userGroup{{ group.id }}" class="checkbox" name="userGroup[]" value="{{ group.id }}"> <label for="userGroup{{ group.id }}">{{ group }}</label>
                    </th>
                    <td>
                        <code>{{ group.handle }}</code>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <hr>

        {% endif %}

        <h1>Other Settings</h1>
        <table class="data fullwidth collapsible">
            <thead>
            <tr>
                <th>
{'fraction_non_alphanumeric': 0.14837349876719955, 'fraction_numerical': 0.0021474588403722263, 'mean_word_length': 1.1910778077894921, 'pattern_counts': {'":': 0, '<': 651, '<?xml version=': 0, '>': 652, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5985282', 'n_tokens_mistral': 6718, 'n_tokens_neox': 6100, 'n_words': 1318}