{% extends 'company/base_dashboard_company.html.twig' %}


{% block dashContent %}
    {% if type == "spontaneous" %}
        {% include 'company/job_submenu.html.twig' with {
            'tab' : 3
        } %}
        {% else %}
        {% include 'company/job_submenu.html.twig' with {
            'tab' : 2
        } %}
    {% endif %}
    <div class="row bg-bordered p-20">
        {% include 'company/ad_breadcrumb.html.twig' with {'step': 2,'ad': ad} %}
        <div id="reponses" class="col s12">
            <table id="table-answers" class="bordered highlight responsive-table">
                <thead>
                <tr>
                    <th>{{ 'profile.talent.lastname'|trans }} {{ 'profile.talent.firstname'|trans }}</th>
                    <th>{{ 'global.datereception.label'|trans }}</th>
                    <th>{{ 'ad.company.list.status'|trans }}</th>
                    <th class="center-align">{{ 'ad.company.list.actions'|trans }}</th>
                </tr>
                </thead>
                <tbody>
                {% for answer in answers %}
                    <tr>
                        <td>
                            <a href="{{ path('company_answer_show',{'id':answer.id }) }}">{{ answer.user.lastname }} {{ answer.user.firstname }}</a>
                        </td>
                        <td>{{ answer.sendTime()|date('d/m/Y') }}</td>
                        {% if answer.firstMessage %}
                            <td>{{ answer.firstMessage.status|trans }}</td>
                        {% else %}
                            {% if answer.isViewed %}
                                {% if answer.isViewed.status == "DRAFT" %}
                                    <td>{{ 'VIEWED'|trans }}</td>
                                {% endif %}
                            {% else %}
                                <td>{{ 'NEW'|trans }}</td>
                            {% endif %}
                        {% endif %}
                        <td class="center-align">
                            <a title="{{ad.title}}" href="{{ path('company_answer_show',{'id':answer.id }) }}">
                                <i class="fa fa-eye"></i>
                            </a>
                            <a href="#" class="note-action c-pointer" data-func="add" data-answer="{{ answer.id }}">
                                <i class="fa fa-sticky-note"></i>
                            </a>
                            {% for note in answer.notes %}
                                <a class="tooltipped note-action c-pointer" data-position="top" data-delay="50"
                                   data-tooltip="{{ note.content }}" data-note="{{ note.id }}" data-func="edit">
                                    <i class="fa fa-commenting" aria-hidden="true"></i>
                                </a>
                            {% endfor %}
                        </td>
                    </tr>
                {% endfor %}
            </table>
        </div>
    </div>

    <div id="note-modal"></div>

{% endblock %}