{% extends "pdf/base.html" %}
{% load i18n%}
{% block extra_head %}
<style>
    body {
        font-family: "Calibri";
        font-size: 11px;
    }
    table.contacts {
        width: 100%;
        margin-top: 8px;
        margin-bottom: 8px;
    }
    td.contact {
        width: 24%;
        height: 148px;
        text-align: center;
        vertical-align: middle;
    }
    .warning {
        color: red;
        font-size: 1.2em;
    }
</style>
{% endblock %}

{% block content %}
    <table class="contacts">
    {% for c in contacts %}
        {% if forloop.counter0 == 0 or forloop.counter0|divisibleby:4 %}
            <tr>
        {% endif %}
            <td class="contact">
                <div class="name">{{ c.fullname }}</div>
                {% if c.get_full_address %}
                    <div class="address">{{ c.get_address }}</div>
                    {% if c.get_address2 %}<div class="address">{{ c.get_address2 }}</div>{% endif %}
                    {% if c.get_address3 %}<div class="address">{{ c.get_address3 }}</div>{% endif %}
                    <div class="city">{{ c.get_zip_code }} {{ c.get_city }} {{ c.get_cedex }}</div>
                {% else %}
                    <div class="warning">{% trans "WARNING : NO ADDRESS DEFINED" %}</div>
                {% endif %}
            </td>
        {% if forloop.counter|divisibleby:4 %}
            </tr>
        {% endif %}
    {% endfor %}
    </table>
{% endblock %}
