<commit_before>{% set labelkey = field.label ?: key|ucfirst %}
{% set data_bolt_widget = {
    fieldBlock: {
        name:    name,
    }
} %}

<fieldset class="bolt-field-block" data-bolt-widget="{{ data_bolt_widget|json_encode }}">
    <legend class="sr-only">{{ labelkey }}</legend>
    <label class="main col-xs-12">{{ labelkey }}</label>
    {% if 'html' not in context.fieldtypes %}
        {{ include('@bolt/editcontent/fielddata/_html.twig') }}
    {% endif %}

    {# Prefix #}
    {% if field.prefix is defined and field.prefix is not empty %}
        <div class="prefix">
            {{ field.prefix|markdown }}
        </div>
    {% endif %}

    <div class="block-slot">
        {% for blockname,block in field.fields %}
            {% set blockfieldvals = context.content.get(contentkey) %}
            <script type="text/template" data-block-type="{{ blockname }}">
                {% set index = '#' %}
                {{ include('@bolt/editcontent/fields/_block-group.twig', {'content': blockfieldvals.getEmptySet, 'index': index, 'block': blockname}) }}
            </script>

            {% for index, repeatfieldset in blockfieldvals %}
                {{ dump(repeatfieldset) }}
                {# include('@bolt/editcontent/fields/_block-group.twig', {'content': repeatfieldset, 'index': index}) #}
            {% endfor %}

        {% endfor %}
    </div>

    <div class="col-xs-12">
        <div class="block-add">
            <div class="btn-group">
                <button type="button" class="btn btn-default">Add New...</button><commit_msg>derive the block from the value in the first item<commit_after>{% set labelkey = field.label ?: key|ucfirst %}
{% set data_bolt_widget = {
    fieldBlock: {
        name:    name,
    }
} %}

<fieldset class="bolt-field-block" data-bolt-widget="{{ data_bolt_widget|json_encode }}">
    <legend class="sr-only">{{ labelkey }}</legend>
    <label class="main col-xs-12">{{ labelkey }}</label>
    {% if 'html' not in context.fieldtypes %}
        {{ include('@bolt/editcontent/fielddata/_html.twig') }}
    {% endif %}

    {# Prefix #}
    {% if field.prefix is defined and field.prefix is not empty %}
        <div class="prefix">
            {{ field.prefix|markdown }}
        </div>
    {% endif %}

    <div class="block-slot">
        {% for blockname,block in field.fields %}
            {% set blockfieldvals = context.content.get(contentkey) %}
            <script type="text/template" data-block-type="{{ blockname }}">
                {% set index = '#' %}
                {{ include('@bolt/editcontent/fields/_block-group.twig', {'content': blockfieldvals.getEmptySet, 'index': index, 'block': blockname}) }}
            </script>

            {% for index, repeatfieldset in blockfieldvals %}
                {% include('@bolt/editcontent/fields/_block-group.twig', {'content': repeatfieldset, 'index': index, 'block': repeatfieldset.first.block }) %}
            {% endfor %}

        {% endfor %}
    </div>

    <div class="col-xs-12">
        <div class="block-add">
            <div class="btn-group">
                <button type="button" class="btn btn-default">Add New...</button>
{'fraction_non_alphanumeric': 0.17418744083307036, 'fraction_numerical': 0.0025244556642473968, 'mean_word_length': 2.430735930735931, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '2484042', 'n_tokens_mistral': 1015, 'n_tokens_neox': 922, 'n_words': 195}