{% extends "int/base.html" %}
{% load extras %}

{% block css %}
    {% include "ext/enquiry_published/body.css" %}
{% endblock %}

{% block content %}
    <tr>
        <td class="letter__title letter__line center">
            <p><a href="{% base_url "internal" %}/{{ enquiry.key }}/proposals?proposal={{ quote.id }}#comment-anchor={{ comment.id }}">
                Новый комментарий</a>{% if author.is_staff %} к предложению{% endif %} от «{{ supplier.title }}»
            </p>
        </td>
    </tr>

    <tr>
        <td class="letter__line">
            <p>
                {% if author.is_staff %}
                    <b><a href="http://staff/{{ author.username }}">{{ author.full_name }}</a></b>, {{ comment.created_at | date:"j E Y H:i T" }}
                {% else %}
                    <b>{{ author.full_name }}</b>, {{ comment.created_at | date:"j E Y H:i T" }}
                {% endif %}
            </p>
            <p class="text-line">
                {{ comment.message | linebreaksbr }}
            </p>
        </td>
    </tr>

    <tr>
        <td class="letter__line letter__attrs">
            <table class="attrs table" border="0" cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                    {% if attachments %}
                        <tr>
                            <td class="attrs__cell attrs__key">Файлы</td>
                            <td class="attrs__cell attrs__value">
                                {% for attachment in attachments %}
                                    <a class="attrs__file text" href="{{ attachment | attachment_url:"internal" }}">{{ attachment.filename }}</a>
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}
                <tbody>
            </table>
        </td>
    </tr>

    <tr>
        <td class="letter__line letter__attrs letter__overlined">
            <table class="attrs table" border="0" cellspacing="0" cellpadding="0" width="100%">
                <tbody>
                    <tr>
                        <td class="attrs__cell attrs__key">Запрос</td>
                        <td class="attrs__cell attrs__value text"><a class="text" href="{% base_url "internal" %}/{{ enquiry.key }}">{{ enquiry.key }}: {{ enquiry.subject }}</a></td>
                    </tr>

                    <tr>
                        <td class="attrs__cell attrs__key">Поставщик</td>
                        <td class="attrs__cell attrs__value text"><a class="text" href="{% base_url "internal" %}/{{ enquiry.key }}/proposals?proposal={{ quote.id }}">{{ supplier.title }}</a></td>
                    </tr>
                <tbody>
            </table>
        </td>
    </tr>
{% endblock %}
