{% extends "freeform/_layouts/main" %} {% hook "freeform.prepareCpTemplate" %} {% set selectedSubnavItem = "notifications" %} {% block actionButton %} {% if currentUser.can("freeform-notificationsManage") %}
{% if filesByDefault %} {{ "New File Template"|t('freeform') }} {% else %} {{ "New Email Template"|t('freeform') }} {% endif %} {% if filesEnabled and useDbNotifications %} {% endif %}
{% endif %} {% endblock %} {% set title = "Email Notifications"|t('freeform') %} {% set content %} {% if useDbNotifications %}

{{ "Database Entry Templates"|t('freeform') }}

{{ "No notifications found"|t('freeform') }}

{% if dbNotificationCount > 0 %} {# Database based templates #} {% for notification in notifications if not notification.fileBasedTemplate %} {% endfor %}
{{ "Name"|t('freeform') }} {{ "Handle"|t('freeform') }} {{ "Description"|t('freeform') }}
{% if currentUser.can("freeform-notificationsManage") %} {{ notification.name }} {% else %} {{ notification.name }} {% endif %} {{ notification.handle|truncater(40) }} {{ notification.description|truncater(80) }}
{% if currentUser.can("freeform-notificationsManage") %} {% endif %}
{% endif %}
{% endif %} {% if fileNotificationCount > 0 %}

{{ "Template Files"|t('freeform') }} ({{ settings.emailTemplateDirectory }})

{# File based templates #} {% for filename, notification in notifications if notification.fileBasedTemplate %} {% endfor %}
{{ "Name"|t('freeform') }} {{ "Description"|t('freeform') }} {{ "File Name"|t('freeform') }}
{% if currentUser.can("freeform-notificationsManage") %} {{ notification.name }} {% else %} {{ notification.name }} {% endif %} {{ notification.description|truncater(80) }} {{ filename }}
{% if currentUser.can("freeform-notificationsManage") %} {% endif %}
{% endif %} {% endset %} {% js %} var confirmDeleteMessage = '{{ "Are you sure you want to delete this notification?"|t('freeform') }}'; var adminTable = new Craft.AdminTable({ tableSelector: '#emailnotifications', noObjectsSelector: '#nonotifications', newObjectBtnSelector: '#newnotificationcontainer', deleteAction: 'freeform/notifications/delete', confirmDeleteMessage: confirmDeleteMessage, }); {% endjs %}