<commit_before>{% set pagetitle = 'Metadata parser'|trans %}
{% extends "base.twig" %}

{%  set i=1 %}
{% block content %}
    <h1>{{ pagetitle }}</h1>
    <form method="post" class="pure-form" enctype="multipart/form-data">
        <h3> {% trans 'XML metadata' %}</h3>
        <div class="pure-control-group">
            <textarea name="xmldata" rows="20" class="text-area edge">{{ xmldata }}</textarea>
        </div>
        <br>
        <div class="center">
            <div class="pure-button-group two-elements" role="group">
                <label class="pure-button">
                    <span class="fa fa-folder-open"></span>Select a file...
                    <input type="file" name="xmlfile" class="hidden" multiple>
                </label>
                {#needs translation#}
                <label id="show-file" class="pure-button hollow show-files" disabled>No file selected.</label>
            </div>
            <br>
            <button class="pure-button pure-button-red pure-input-1-3">{{ 'Parse'|trans }}</button>
        </div>
    </form>

    {% if output -%}
    <br>
    <h2>{{ 'Converted metadata'|trans }}</h2>
        {% for type, text in output if text -%}
    <div class="code-box">
        <div class="code-box-title">
            <h3> {{ type }}</h3>
            <button data-clipboard-target="#metadata{{ loop.index }}" id="btn{{ loop.index }}" class="pure-button right clipboard-btn">
                <i class="fa fa-copy"></i>
            </button>
        </div>
        <div class="code-box-content">
            <pre id="metadata{{ loop.index }}">
                {%- spaceless %}{{ text }}{% endspaceless -%}
            </pre>
        </div>
    </div>
            <br><br>
            {%- set i=i+1 %}
        {%- endfor -%}
    {% endif -%}
{% endblock content -%}

<commit_msg>Add missing translation + remove empty lines when copying from metadata code-box<commit_after>{% set pagetitle = 'Metadata parser'|trans %}
{% extends "base.twig" %}

{%  set i=1 %}
{% block content %}
    <h1>{{ pagetitle }}</h1>
    <form method="post" class="pure-form" enctype="multipart/form-data">
        <h3> {% trans 'XML metadata' %}</h3>
        <div class="pure-control-group">
            <textarea name="xmldata" rows="20" class="text-area edge">{{ xmldata }}</textarea>
        </div>
        <br>
        <div class="center">
            <div class="pure-button-group two-elements" role="group">
                <label class="pure-button">
                    <span class="fa fa-folder-open"></span>{{ 'or select a file:'|trans }}
                    <input type="file" name="xmlfile" class="hidden" multiple>
                </label>
                {#needs translation#}
                <label id="show-file" class="pure-button hollow show-files" disabled>No file selected.</label>
            </div>
            <br>
            <button class="pure-button pure-button-red pure-input-1-3">{{ 'Parse'|trans }}</button>
        </div>
    </form>

    {% if output -%}
    <br>
    <h2>{{ 'Converted metadata'|trans }}</h2>
        {% for type, text in output if text -%}
    <div class="code-box">
        <div class="code-box-title">
            <h3> {{ type }}</h3>
            <button data-clipboard-target="#metadata{{ loop.index }}" id="btn{{ loop.index }}" class="pure-button right clipboard-btn">
                <i class="fa fa-copy"></i>
            </button>
        </div>
        <div class="code-box-content">
            <pre id="metadata{{ loop.index }}">
                {%- spaceless %}{{ text|escape }}{% endspaceless -%}
            </pre>
        </div>
    </div>
            <br><br>
            {%- set i=i+1 %}
        {%- endfor -%}
    {% endif -%}
{% endblock content -%}


{'fraction_non_alphanumeric': 0.18744993324432577, 'fraction_numerical': 0.007476635514018692, 'mean_word_length': 1.9106449106449106, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '7129711', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1151, 'n_words': 262}