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

{% set option = {
    label:  field.label|default(''),
    info:   field.info|default('info.geolocation')
} %}

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

{% set geolocation = context.content.get(contentkey) %}

{#=== SLOT ===========================================================================================================#}

{% set attributes = {
    address: {
        class:       'form-control address',
        name:        name ~ '[address]',
        placeholder: __('field.geolocation.placeholder.address') ~ ' …',
        type:        'text',
    },
    latitude: {
        class:       'form-control latitude',
        name:        name ~ '[latitude]',
        readonly:    true,
        step:        'any',
        type:        'number',
    },
    longitude: {
        class:       'form-control longitude',
        name:        name ~ '[longitude]',
        readonly:    true,
        type:        'number',
        step:        'any',
    },
    formatted: {
        class:      'matched',
        name:        name ~ '[_address]',
        readonly:    true,
        type:        'text',
        placeholder: '—',
    }
} %}

{% macro slot(attributes, key, geolocation) %}
    {% from '_macro/_macro.twig' import attr %}

    <div class="col-sm-8">
        <div class="form-group">
            <div class="col-sm-12">
                <label>{{ __('field.geolocation.label.address-lookup') }}</label>
                <input{{ attr(attributes.address) }} value="{{ geolocation.address|default('') }}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-6">
                <label>{{ __('field.geolocation.label.latitude') }}</label>
                <input{{ attr(attributes.latitude) }} value="{{ geolocation.latitude|default('') }}">
            </div>
            <div class="col-xs-6">
                <label>{{ __('field.geolocation.label.longitude') }}</label>
                <input {{ attr(attributes.longitude) }} value="{{ geolocation.longitude|default('') }}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <label>{{ __('field.geolocation.matched-address') }}</label>
                <input{{ attr(attributes.formatted) }} value="{{ geolocation.formatted_address|default('') }}">
            </div>
        </div>
    </div>

    <div class="col-sm-4">
        <label>{{ __('field.geolocation.label.marker-placement') }}</label>
        <div class="mapholder" id="mymap-{{ key }}"></div>
    </div>
{% endmacro %}

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

{% extends '_base/_fieldset.twig' %}
{% from _self import slot %}

{# Default location is Two Kings, for now. #}
{% set fieldset = {
    geolocation: {
        key: key,
        latitude: geolocation.latitude|default(52.08184),
        longitude: geolocation.longitude|default(4.292368),
    }
}%}

{% block fieldset %}
    <label class="control-label col-xs-12">{{ macro.infopop(labelkey, option.info) }}</label>
    <div class="field-container col-xs-12">
        <div class="field-slot row">
            {{ slot(attributes, key, geolocation) }}
        </div>
    </div>
{% endblock fieldset %}<commit_msg>Remove id<commit_after>{#=== OPTIONS ========================================================================================================#}

{% set option = {
    label:  field.label|default(''),
    info:   field.info|default('info.geolocation')
} %}

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

{% set geolocation = context.content.get(contentkey) %}

{#=== SLOT ===========================================================================================================#}

{% set attributes = {
    address: {
        class:       'form-control address',
        name:        name ~ '[address]',
        placeholder: __('field.geolocation.placeholder.address') ~ ' …',
        type:        'text',
    },
    latitude: {
        class:       'form-control latitude',
        name:        name ~ '[latitude]',
        readonly:    true,
        step:        'any',
        type:        'number',
    },
    longitude: {
        class:       'form-control longitude',
        name:        name ~ '[longitude]',
        readonly:    true,
        type:        'number',
        step:        'any',
    },
    formatted: {
        class:      'matched',
        name:        name ~ '[_address]',
        readonly:    true,
        type:        'text',
        placeholder: '—',
    }
} %}

{% macro slot(attributes, key, geolocation) %}
    {% from '_macro/_macro.twig' import attr %}

    <div class="col-sm-8">
        <div class="form-group">
            <div class="col-sm-12">
                <label>{{ __('field.geolocation.label.address-lookup') }}</label>
                <input{{ attr(attributes.address) }} value="{{ geolocation.address|default('') }}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-6">
                <label>{{ __('field.geolocation.label.latitude') }}</label>
                <input{{ attr(attributes.latitude) }} value="{{ geolocation.latitude|default('') }}">
            </div>
            <div class="col-xs-6">
                <label>{{ __('field.geolocation.label.longitude') }}</label>
                <input {{ attr(attributes.longitude) }} value="{{ geolocation.longitude|default('') }}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <label>{{ __('field.geolocation.matched-address') }}</label>
                <input{{ attr(attributes.formatted) }} value="{{ geolocation.formatted_address|default('') }}">
            </div>
        </div>
    </div>

    <div class="col-sm-4">
        <label>{{ __('field.geolocation.label.marker-placement') }}</label>
        <div class="mapholder"></div>
    </div>
{% endmacro %}

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

{% extends '_base/_fieldset.twig' %}
{% from _self import slot %}

{# Default location is Two Kings, for now. #}
{% set fieldset = {
    geolocation: {
        key: key,
        latitude: geolocation.latitude|default(52.08184),
        longitude: geolocation.longitude|default(4.292368),
    }
}%}

{% block fieldset %}
    <label class="control-label col-xs-12">{{ macro.infopop(labelkey, option.info) }}</label>
    <div class="field-container col-xs-12">
        <div class="field-slot row">
            {{ slot(attributes, key, geolocation) }}
        </div>
    </div>
{% endblock fieldset %}
{'fraction_non_alphanumeric': 0.2829784193225668, 'fraction_numerical': 0.007431756467057311, 'mean_word_length': 2.420332355816227, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, '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': '4663414', 'n_tokens_mistral': 2070, 'n_tokens_neox': 1915, 'n_words': 360}