{% set thread = thread is defined ? thread : {'url': ''} %}

<ul class="tabnav el">
    <li class="{{ is_active_url('admin.messaging.index') ? 'selected' }}">
        <a href="{{ route('admin.messaging.index') }}">Threads</a>
    </li>

    {% if is_active_url('admin.messaging.view_thread') %}
        <li class="{{ is_active_url('admin.messaging.view_thread', thread.url) ? 'selected' }}">
            <a href="{{ route('admin.messaging.view_thread', thread.url) }}">View Messages</a>
        </li>
    {% endif %}

    {#  {% if can_edit_templates %} #}
        <li class="{{ is_active_url('admin.messaging.templates', template.id) ? 'selected' }}">
            <a href="{{ route('admin.messaging.templates', template.id) }}">All Templates</a>
        </li>

        <li class="{{ is_active_url('admin.messaging.add_template') ? 'selected' }}">
            <a href="{{ route('admin.messaging.add_template') }}">Add Template</a>
        </li>

        {% if template.id %}
            <li class="{{ is_active_url('admin.messaging.edit_template', template.id) ? 'selected' }}">
                <a href="{{ route('admin.messaging.edit_template', template.id) }}">Edit Template</a>
            </li>
        {% endif %}

        <li class="{{ is_active_url('admin.messaging.satisfactory') ? 'selected' }}">
            <a href="{{ route('admin.messaging.satisfactory') }}">Satisfactory</a>
        </li>

        <li class="{{ is_active_url('admin.messaging.response_times') ? 'selected' }}">
            <a href="{{ route('admin.messaging.response_times') }}">Response time</a>
        </li>
    {# endif #}
</ul>
