<commit_before>{% extends '::base.html.twig' %}

{% block title %}Edit Client - {{ parent() }}{% endblock %}
{% block main_title %}Edit Client: <em>{{ client.name }}</em>{% endblock %}

{% block body -%}
    {{
        include('AgileInvoiceBundle:Client:form.html.twig', {
            'form': form,
            'form_action': path('client_update', { 'id': client.id }),
            'edit': true
        })
    }}
{% endblock %}

{% block right_column %}
    {% if client.contacts|length == 0 %}
        <div class="well well-small">
            <a href="{{ path('client_delete', {'id': client.id}) }}" data-href-method="delete" data-mconfirm-header="Are you sure you want to remove {{ client.name }} from your account?" class="text-error"><small>Remove {{ client.name }} from your account</small></a>
        </div>
    {% endif %}
    
    <div class="well well-small">
        <a href="{{ path('client_toggle', {'id': client.id}) }}" data-mconfirm-header="Are you sure you want to archive {{ client.name }}?" class="text-error"><small>Archive {{ client.name }}</small></a>
    </div>

    {% if client.contacts|length > 0 %}<commit_msg>Added comments for the delete link message and warning<commit_after>{% extends '::base.html.twig' %}

{% block title %}Edit Client - {{ parent() }}{% endblock %}
{% block main_title %}Edit Client: <em>{{ client.name }}</em>{% endblock %}

{% block body -%}
    {{
        include('AgileInvoiceBundle:Client:form.html.twig', {
            'form': form,
            'form_action': path('client_update', { 'id': client.id }),
            'edit': true
        })
    }}
{% endblock %}

{% block right_column %}
    {# Show the remove link only if the client has no contacts #}
    {% if client.contacts|length == 0 %}
        <div class="well well-small">
            <a href="{{ path('client_delete', {'id': client.id}) }}" data-href-method="delete" data-mconfirm-header="Are you sure you want to remove {{ client.name }} from your account?" class="text-error"><small>Remove {{ client.name }} from your account</small></a>
        </div>
    {% endif %}
    
    <div class="well well-small">
        <a href="{{ path('client_toggle', {'id': client.id}) }}" data-mconfirm-header="Are you sure you want to archive {{ client.name }}?" class="text-error"><small>Archive {{ client.name }}</small></a>
    </div>

    {# Show a warning message if the client has contacts #}
    {% if client.contacts|length > 0 %}
{'fraction_non_alphanumeric': 0.1956610724519034, 'fraction_numerical': 0.001637331150225133, 'mean_word_length': 3.0938023450586263, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, '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': '5010767', 'n_tokens_mistral': 779, 'n_tokens_neox': 732, 'n_words': 196}