<commit_before>{#=== OPTIONS ========================================================================================================#}

{% set option = {
    class:        field.class|default(''),
    label:        field.label|default(''),
    pattern:      field.pattern|default(''),
    placeholder:  field.placeholder|default(''),
    required:     field.required|default(false),
    title:        field.title|default(''),
    variant:      field.variant|default(''),
}%}
{# variant[inline] #}

{#=== INIT ===========================================================================================================#}

{% set attr_text = {
    class:        option.class,
    name_id:      key,
    pattern:      (option.pattern and option.pattern not in ['url', 'email']) ? option.pattern : '',
    placeholder:  option.placeholder,
    required:     option.required,
    title:        option.title,
    type:         (option.pattern in ['url', 'email']) ?: 'text',
    value:        content.get(key),
}%}

{#=== FIELDSET =======================================================================================================#}

<fieldset class="text">
    {% if option.variant == 'inline' %}

        <label class="col-sm-3 control-label">{{ labelkey }}</label>
        <div class="col-sm-9">
            <input{{ macro.attr(attr_text) }}>
        </div>

    {% else %}

        <div class="col-sm-12">
            <label>{{ labelkey }}</label>
            <input{{ macro.attr(attr_text) }}>
        </div>

    {% endif %}
</fieldset>
<commit_msg>Adding maxlenght to text fields.<commit_after>{#=== OPTIONS ========================================================================================================#}

{% set option = {
    class:        field.class|default(''),
    label:        field.label|default(''),
    pattern:      field.pattern|default(''),
    placeholder:  field.placeholder|default(''),
    required:     field.required|default(false),
    title:        field.title|default(''),
    variant:      field.variant|default(''),
}%}
{# variant[inline] #}

{#=== INIT ===========================================================================================================#}

{% set attr_text = {
    class:        option.class,
    name_id:      key,
    pattern:      (option.pattern and option.pattern not in ['url', 'email']) ? option.pattern : '',
    maxlength:    255,
    placeholder:  option.placeholder,
    required:     option.required,
    title:        option.title,
    type:         (option.pattern in ['url', 'email']) ?: 'text',
    value:        content.get(key),
}%}

{#=== FIELDSET =======================================================================================================#}

<fieldset class="text">
    {% if option.variant == 'inline' %}

        <label class="col-sm-3 control-label">{{ labelkey }}</label>
        <div class="col-sm-9">
            <input{{ macro.attr(attr_text) }}>
        </div>

    {% else %}

        <div class="col-sm-12">
            <label>{{ labelkey }}</label>
            <input{{ macro.attr(attr_text) }}>
        </div>

    {% endif %}
</fieldset>

{'fraction_non_alphanumeric': 0.3516518424396442, 'fraction_numerical': 0.00349428208386277, 'mean_word_length': 3.1488801054018447, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '7532484', 'n_tokens_mistral': 883, 'n_tokens_neox': 809, 'n_words': 158}