<html>
<head>
    <style>
        {% include 'styles.css' %}
    </style>
</head>
<body>
    <div class="frontpage">
        <div id="front-page-header">
            <table><tr>
                <td><img id="top-logo" src="{{ root_url }}/assets/logotransparent.png" alt="Cooper, Hillman & Toshi logo"></td>
                <td id="office-info">Cooper, Hillman & Toshi LLP<br />6834 Innocence Boulevard<br />LOS SANTOS - SA<br /><a href="#">consulting@cht.law.com</a></td>
            </tr></table>
            <h1>{{ contract.title|upper }}</h1>
        </div>
        <div class="intro">
            <h2>Introduction</h2>
            <p>Le {{ contract.date.strftime('%d/%m/%Y') }} &agrave; {{ contract.location}}</p>
            <p>Entre les soussign&eacute;s :</p>
            {% for party in contract.parties %}
            <div class="party">
                {% if not loop.first %}
                    <p>ET</p>
                {% endif %}
                <p>
                {% if party.entity.entity_data.type == "corporation" %}
                    {{ party.entity.entity_data.title }} soci&eacute;t&eacute; de {{ party.entity.entity_data.activity }} enregistr&eacute;e aupr&egrave;s du gouvernement de San Andreas et domicili&eacute;e au {{ party.entity.address }}{% if party.representative %}, repr&eacute;sent&eacute;e par {{ party.representative.entity_data.firstname }} {{ party.representative.entity_data.middlenames }} {{ party.representative.entity_data.lastname }}{% endif %}
                {% elif party.entity.entity_data.type == "individual" %}
                    {{ party.entity.entity_data.firstname }} {{ party.entity.entity_data.middlenames }} {{ party.entity.entity_data.lastname }}
                    {% if party.entity.entity_data.day_of_birth %} n&eacute; le {{ party.entity.entity_data.day_of_birth.strftime('%d/%m/%Y') }} {% if party.entity.entity_data.place_of_birth %} &agrave; {{ party.entity.entity_data.place_of_birth }}{% endif %},{% endif %}
                    {% if party.entity.address %} r&eacute;sidant &agrave; {{ party.entity.address }}, {% endif %}
                {% elif party.entity.entity_data.type == "institution" %}

                {% endif %}
                </p>
                <p>Ci-apr&egrave;s d&eacute;nomm&eacute; <strong>{{ party.part|safe }}</strong></p>
                {% if loop.first %}
                    <p class="part">d&apos;une part</p>
                {% endif %}
            </div>
            {% endfor %}
            <p class="part">d&apos;autre part</p>
            <p>Sous la supervision l&eacute;gale de Ma&icirc;tre <strong>{{ contract.lawyer.entity_data.firstname }} {{ contract.lawyer.entity_data.lastname }}</strong></p>
            <p>Il a &eacute;t&eacute; convenu l&apos;ex&eacute;cution des prestations ci-dessous, conform&eacute;ment aux conditions g&eacute;n&eacute;rales et particuli&egrave;res ci-apr&egrave;s:</p>
        </div>
    </div>
    <div class="content">
        <h2>Conditions g&eacute;n&eacute;rales & particuli&egrave;res</h2>

        {% for provision in contract.provisions %}
        <div class="provision">
            <h3>Article {{loop.index}} - {{ provision.title|safe }}</h3>
            <p>{{ provision.body|safe }}</p>
        </div>
        {% endfor %}

        <div class="footer">
            <hr/>
            <p>À {{ contract.location }} le {{ contract.date.strftime('%d/%m/%Y') }}</p>
            <p class="mention">(Signatures précédée de la mention « Lu et approuvé »)</p>
            <table class="signatures">
                <tr>
                {% for party in contract.parties %}
                    <td>
                        {{ party.part|safe }}:<br/>
                        {% if party.signature_png %}
                            <img src="{{ party.signature_png }}" />
                        {% endif %}
                    </td>
                {% endfor %}
                </tr>
            </table>
        </div>
    </div>
</body>
</html>
