{% extends "freeform/_layouts/main" %}
{% hook "freeform.prepareCpTemplate" %}

{% set selectedSubnavItem = "notifications" %}

{% set title = "Email Notifications"|t('freeform') %}

{% block sidebar %}

    {% set segment = craft.app.request.segment(3) %}
    {% set settings = freeform.settings %}

    <nav>
        <ul>
            <li class="heading">
                <span>{{ "Templates"|t('freeform') }}</span>
            </li>
            <li>
                {% if settings.emailTemplateStorageType in ['files_database', 'files'] %}
                <a href="{{ url('freeform/notifications/files') }}" class="{{ segment == "files" ? 'sel' }}">
                    {{ "File Templates"|t('freeform') }}
                </a>
                {% endif %}

                {% if settings.emailTemplateStorageType in ['files_database', 'database'] %}
                <a href="{{ url('freeform/notifications/database') }}" class="{{ segment == "database" ? 'sel' }}">
                    {{ "Database Templates"|t('freeform') }}
                </a>
                {% endif %}
            </li>

            <li class="heading">
                <span>{{ "Template Wrappers"|t('freeform') }}</span>
            </li>
            <li>
                <a href="{{ url('freeform/notifications/wrappers') }}" class="{{ segment == "wrappers" ? 'sel' }}">
                    {{ "Notification Wrappers"|t('freeform') }}
                </a>
            </li>
        </ul>
    </nav>

{% endblock %}
