<commit_before>{% extends 'SonataAdminBundle:CRUD:action.html.twig' %}

{% block content %}
    {{ form_start(form, { 'action': admin.generateUrl('identityValidateSearchPost'), 'attr': { 'method': 'post', 'class': 'form-horizontal' } }) }}
      <div class="control-group">
        {{ form_label(form.email, null, {'label_attr': {'class': 'control-label'}}) }}
        <div class="controls">
          {{ form_widget(form.email) }}
        </div>
      </div>
      <div class="control-group">
        {{ form_label(form.legalId, null, {'label_attr': {'class': 'control-label'}}) }}
        <div class="controls">
          {{ form_widget(form.legalId) }}
        </div>
      </div>
      <div class="control-group">
        {{ form_label(form.firstname, null, {'label_attr': {'class': 'control-label'}}) }}
        <div class="controls">
          {{ form_widget(form.firstname) }}
          {{ form_widget(form.lastname) }}
        </div>
      </div>
      <div class="control-group">
        <div class="controls">
          {{ form_widget(form.search) }}
          <a href="{{ admin.generateUrl('identityValidateSearch') }}" class="btn">{{ "Clear" | trans  }}</a>
        </div>
      </div>
    {{ form_end(form) }}
    
    {% if not exceeded %}
      {% if identities|length > 0 %}
          <table class="table">
            <thead>
              <tr>
                <th>#</th>
                <th>{{ "Legal Id"|trans }}</th>
                <th>{{ "Email"|trans }}</th>
                <th>{{ "Fullname"|trans }}</th>
                <th>{{ "Actions"|trans }}</th>
              </tr>
            </thead>
            <tbody>
              {% for identity in identities %}
                <tr class="{{ identity.rowStatus }}">
                  <td>{{ loop.index }}</td>
                  <td>{{ identity.legalId }}</td>
                  <td>{{ identity.emails|join(',') }}</td>
                  <td>{{ identity.fullname }}</td>
                  <td>
                    {% if not identity.suspicious %}
                      {% set action  = identity.validatable ? 'validateIdentity' : 'invalidateIdentity' %} 
                      {% set icon    = identity.validatable ? 'user' : 'remove-circle' %}
                      {% set text    = identity.validatable ? "Validate"|trans : "Invalidate"|trans %}
                      <a href="{{ admin.generateObjectUrl(action, identity) }}" class="btn btn-link no-space"><i class="icon-{{ icon }}"></i> {{ text }}
                      </a>
                    {% else %}
                      <i class="icon-warning-sign"></i> <i>{{ "Suspicious identity" | trans }}</i>
                    {% endif %}
                  </td>
                </tr>
              {% endfor %}<commit_msg>[validate] - Fix comma separated emails to add a space after the comma<commit_after>{% extends 'SonataAdminBundle:CRUD:action.html.twig' %}

{% block content %}
    {{ form_start(form, { 'action': admin.generateUrl('identityValidateSearchPost'), 'attr': { 'method': 'post', 'class': 'form-horizontal' } }) }}
      <div class="control-group">
        {{ form_label(form.email, null, {'label_attr': {'class': 'control-label'}}) }}
        <div class="controls">
          {{ form_widget(form.email) }}
        </div>
      </div>
      <div class="control-group">
        {{ form_label(form.legalId, null, {'label_attr': {'class': 'control-label'}}) }}
        <div class="controls">
          {{ form_widget(form.legalId) }}
        </div>
      </div>
      <div class="control-group">
        {{ form_label(form.firstname, null, {'label_attr': {'class': 'control-label'}}) }}
        <div class="controls">
          {{ form_widget(form.firstname) }}
          {{ form_widget(form.lastname) }}
        </div>
      </div>
      <div class="control-group">
        <div class="controls">
          {{ form_widget(form.search) }}
          <a href="{{ admin.generateUrl('identityValidateSearch') }}" class="btn">{{ "Clear" | trans  }}</a>
        </div>
      </div>
    {{ form_end(form) }}
    
    {% if not exceeded %}
      {% if identities|length > 0 %}
          <table class="table">
            <thead>
              <tr>
                <th>#</th>
                <th>{{ "Legal Id"|trans }}</th>
                <th>{{ "Email"|trans }}</th>
                <th>{{ "Fullname"|trans }}</th>
                <th>{{ "Action"|trans }}</th>
              </tr>
            </thead>
            <tbody>
              {% for identity in identities %}
                <tr class="{{ identity.rowStatus }}">
                  <td>{{ loop.index }}</td>
                  <td>{{ identity.legalId }}</td>
                  <td>{{ identity.emails|join(', ') }}</td>
                  <td>{{ identity.fullname }}</td>
                  <td>
                    {% if not identity.suspicious %}
                      {% set action  = identity.validatable ? 'validateIdentity' : 'invalidateIdentity' %} 
                      {% set icon    = identity.validatable ? 'user' : 'remove-circle' %}
                      {% set text    = identity.validatable ? "Validate"|trans : "Invalidate"|trans %}
                      <a href="{{ admin.generateObjectUrl(action, identity) }}" class="btn btn-link no-space"><i class="icon-{{ icon }}"></i> {{ text }}
                      </a>
                    {% else %}
                      <i class="icon-warning-sign"></i> <i>{{ "Suspicious identity" | trans }}</i>
                    {% endif %}
                  </td>
                </tr>
              {% endfor %}
{'fraction_non_alphanumeric': 0.18760136961614704, 'fraction_numerical': 0.0003604253018561903, 'mean_word_length': 1.6954832442933463, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 113, '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': '6650096', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1529, 'n_words': 319}