<commit_before>{% extends "_layouts/cp" %}
{% import "_includes/forms" as forms %}
{% set fullPageForm = true %}

{% includeCssResource "usercreator/css/UserCreator_Style.css" %}
{% includeJsResource "usercreator/js/UserCreator_Script.js" %}

{% set title = 'User Creator' | t %}

{% block saveButton %}
    <input type="submit" class="btn submit" value="{{ 'Create users'|t }}">
{% endblock %}

{% set content %}
    <div class="user-creator" id="js-userCreatorForm">
        <div class="user-creator__inner">
            <input type="hidden" name="action" value="userCreator/create">
            <input type="hidden" name="redirect" value="usercreator/result">

            <div class="field">
                <div class="heading">
                    <label>{{ 'User groups' | t }}</label>
                </div>
                <div class="input ltr">
                    {% for group in groups %}
                        {{ forms.checkboxField({
                            label: group.name,
                            id: 'userGroups' ~ group.id,
                            name: 'userGroups[]',
                            value: group.id
                        }) }}
                    {% endfor %}
                </div>
            </div>

            {{ forms.lightswitchField({
                    label: 'Activate users',
                    id: 'activateUsers',
                    name: 'activateUsers',
                    on: true,
                })
            }}

            {{ forms.lightswitchField({
                    label: 'Force password reset',
                    instructions: 'Forces password reset when user logs in for the first time.',
                    id: 'forcePasswordReset',
                    name: 'forcePasswordReset',
                    on: true,
                })
            }}

            {{ forms.lightswitchField({
                    label: 'Create reset URLs',
                    id: 'createResetUrls',
                    name: 'createResetUrls',
                    on: true,
                })
            }}

            {{ forms.editableTableField({
                label: 'Users to create',
                id:     'users',
                name:   'users',
                cols: {
                    firstName: { heading : 'First name', type: 'singleline' },
                    lastName: { heading : 'Last name', type: 'singleline' },
                    email: { heading : 'E-mail address', type: 'singleline' },
                    username: { heading : 'Username', type: 'singleline' },
                },
                rows: []
            }) }}

        </div>
    </div>
{% endset %}<commit_msg>Hide username column when useEmailAsUsername is enabled<commit_after>{% extends "_layouts/cp" %}
{% import "_includes/forms" as forms %}
{% set fullPageForm = true %}

{% includeCssResource "usercreator/css/UserCreator_Style.css" %}
{% includeJsResource "usercreator/js/UserCreator_Script.js" %}

{% set title = 'User Creator' | t %}

{% block saveButton %}
    <input type="submit" class="btn submit" value="{{ 'Create users'|t }}">
{% endblock %}

{% set content %}
    <div class="user-creator" id="js-userCreatorForm">
        <div class="user-creator__inner">
            <input type="hidden" name="action" value="userCreator/create">
            <input type="hidden" name="redirect" value="usercreator/result">

            <div class="field">
                <div class="heading">
                    <label>{{ 'User groups' | t }}</label>
                </div>
                <div class="input ltr">
                    {% for group in groups %}
                        {{ forms.checkboxField({
                            label: group.name,
                            id: 'userGroups' ~ group.id,
                            name: 'userGroups[]',
                            value: group.id
                        }) }}
                    {% endfor %}
                </div>
            </div>

            {{ forms.lightswitchField({
                    label: 'Activate users',
                    id: 'activateUsers',
                    name: 'activateUsers',
                    on: true,
                })
            }}

            {{ forms.lightswitchField({
                    label: 'Force password reset',
                    instructions: 'Forces password reset when user logs in for the first time.',
                    id: 'forcePasswordReset',
                    name: 'forcePasswordReset',
                    on: true,
                })
            }}

            {{ forms.lightswitchField({
                    label: 'Create reset URLs',
                    id: 'createResetUrls',
                    name: 'createResetUrls',
                    on: true,
                })
            }}

            {% if craft.config.get('useEmailAsUsername') %}
                {{ forms.editableTableField({
                    label: 'Users to create',
                    id:     'users',
                    name:   'users',
                    cols: {
                        firstName: { heading : 'First name', type: 'singleline' },
                        lastName: { heading : 'Last name', type: 'singleline' },
                        email: { heading : 'E-mail address', type: 'singleline' },
                    },
                    rows: []
                }) }}
            {% else %}
                {{ forms.editableTableField({
                    label: 'Users to create',
                    id:     'users',
                    name:   'users',
                    cols: {
                        firstName: { heading : 'First name', type: 'singleline' },
                        lastName: { heading : 'Last name', type: 'singleline' },
                        email: { heading : 'E-mail address', type: 'singleline' },
                        username: { heading : 'Username', type: 'singleline' },
                    },
                    rows: []
                }) }}
            {% endif %}

        </div>
    </div>
{% endset %}
{'fraction_non_alphanumeric': 0.12702078521939955, 'fraction_numerical': 0.0, 'mean_word_length': 1.184864864864865, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '3216276', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1423, 'n_words': 349}