<commit_before>{% extends 'AppBundle:Layouts:application.html.twig' %}

{% set translationDomain = "registration" %}
{% trans_default_domain translationDomain %}

{% block htmlTitle %}{{ 'addClient.htmlTitle' | trans }} {% endblock %}
{% block pageTitle %}{{ 'addClient.pageTitle' | trans }}{% endblock %}

{% block progressBar %}
     {{ progress_bar_registration(app.user, 'client_details') }}
{% endblock %}

{% block helpline %}{% endblock %}

{% block pageContent %}
    {{ form_start(form, {attr: {novalidate: 'novalidate' }}) }}

    {% if client_validated %}
        {{ form_widget(form.firstname, {'type': 'hidden'}) }}
        {{ form_widget(form.lastname, {'type': 'hidden'}) }}

        <p class="flush--bottom">
            <strong class="bold">Name: </strong>
            {{ client.fullName }}
        </p>

        <p class="push--bottom">
            <strong class="bold">Case number: </strong>
            {{ client.caseNumber }}
        </p>
    {% endif %}

    {% if not client_validated %}
        {{ form_input(form.firstname, 'firstname') }}
        {{ form_input(form.lastname, 'lastname') }}
    {% endif %}

    {{ form_input(form.address, 'address') }}
    {{ form_input(form.address2, 'address2') }}
    {{ form_input(form.county, 'county') }}

    {% if form.postcode is defined %}
        {% if client.postcode is empty or not client_validated %}
            {{ form_input(form.postcode, 'postcode', {'inputClass': 'form-control-1-4' }) }}
        {% else %}
            {{ form_widget(form.postcode, {'type': 'hidden'}) }}
            <p class="push--bottom">
            <strong class="bold">{{ 'postcode.label' | trans({}, translationDomain) }}: </strong>
                {{ client.postcode }}
            </p>
        {% endif %}
    {% endif %}

    {{ form_select(form.country, 'country') }}
    {{ form_input(form.phone, 'phone') }}

    {{ form_input(form.caseNumber, 'caseNumber', {
        'labelRaw': true,
        'formGroupClass': (client_validated) ? 'visually-hidden' : ''
    }) }}
    {{ form_known_date(form.courtDate, 'courtDate') }}

    {{ form_submit(form.save,'saveAndContinue') }}

    {{ form_end(form) }}

{% endblock %}<commit_msg>DDPB-1681 Made case number hidden field and tidied up logic<commit_after>{% extends 'AppBundle:Layouts:application.html.twig' %}

{% set translationDomain = "registration" %}
{% trans_default_domain translationDomain %}

{% block htmlTitle %}{{ 'addClient.htmlTitle' | trans }} {% endblock %}
{% block pageTitle %}{{ 'addClient.pageTitle' | trans }}{% endblock %}

{% block progressBar %}
     {{ progress_bar_registration(app.user, 'client_details') }}
{% endblock %}

{% block helpline %}{% endblock %}

{% block pageContent %}
    {{ form_start(form, {attr: {novalidate: 'novalidate' }}) }}

    {% if client_validated %}
        {{ form_widget(form.firstname, {'type': 'hidden'}) }}
        {{ form_widget(form.lastname, {'type': 'hidden'}) }}
        {{ form_widget(form.caseNumber, {'type': 'hidden'}) }}

        <p class="flush--bottom">
            <strong class="bold">Name: </strong>
            {{ client.fullName }}
        </p>

        <p class="push--bottom">
            <strong class="bold">Case number: </strong>
            {{ client.caseNumber }}
        </p>
    {% else %}
        {{ form_input(form.firstname, 'firstname') }}
        {{ form_input(form.lastname, 'lastname') }}
    {% endif %}

    {{ form_input(form.address, 'address') }}
    {{ form_input(form.address2, 'address2') }}
    {{ form_input(form.county, 'county') }}

    {% if form.postcode is defined %}
        {% if client.postcode is empty or not client_validated %}
            {{ form_input(form.postcode, 'postcode', {'inputClass': 'form-control-1-4' }) }}
        {% else %}
            {{ form_widget(form.postcode, {'type': 'hidden'}) }}
            <p class="push--bottom">
            <strong class="bold">{{ 'postcode.label' | trans({}, translationDomain) }}: </strong>
                {{ client.postcode }}
            </p>
        {% endif %}
    {% endif %}

    {{ form_select(form.country, 'country') }}
    {{ form_input(form.phone, 'phone') }}

    {% if not client_validated %}
        {{ form_input(form.caseNumber, 'caseNumber', {
            'labelRaw': true
        }) }}
    {% endif %}

    {{ form_known_date(form.courtDate, 'courtDate') }}

    {{ form_submit(form.save,'saveAndContinue') }}

    {{ form_end(form) }}

{% endblock %}
{'fraction_non_alphanumeric': 0.190272461157397, 'fraction_numerical': 0.002702094122945283, 'mean_word_length': 2.8063410454155955, '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': '670276', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1359, 'n_words': 244}