{% extends 'layout/base.twig' %} {% set title = 'Edit Notification Group' %} {% set pageTitle = 'Edit Notification Group' %} {% set pageDescription = group.name %} {% set pageIcon = 'fas fa-edit' %} {% set channelIcons = { email: 'fa-envelope', telegram: 'fa-telegram', discord: 'fa-discord', slack: 'fa-slack', mattermost: 'fa-comments', pushover: 'fa-mobile-alt', webhook: 'fa-link' } %} {% set channelIconPrefixes = { email: 'fas', telegram: 'fab', discord: 'fab', slack: 'fab', mattermost: 'fas', pushover: 'fas', webhook: 'fas' } %} {% set channelColors = { email: 'blue', telegram: 'blue', discord: 'indigo', slack: 'teal', mattermost: 'green', pushover: 'red', webhook: 'purple' } %} {% block content %}
{# Group Details Form #}

Group Details

{{ csrf_field() }}
{# Group Name #}
{# Description #}
{# Notification Channels #}

Notification Channels

{% if group.channels is empty %}

No channels configured yet

Add your first channel below to start receiving notifications

{% else %}
{% for channel in group.channels %} {% set config = channel.channel_config|from_json %} {% set icon = channelIcons[channel.channel_type]|default('fa-bell') %} {% set iconPrefix = channelIconPrefixes[channel.channel_type]|default('fas') %} {% set color = channelColors[channel.channel_type]|default('gray') %} {% set formatLabels = { generic: 'Generic', google_chat: 'Google Chat', simple_text: 'Simple Text' } %}
{% if channel.channel_type == 'mattermost' %} {% else %} {% endif %}
{{ channel.is_active ? 'Active' : 'Disabled' }}

{{ channel.channel_type|capitalize }}

{% if channel.channel_type == 'email' %} {{ config.email|default('No email') }} {% elseif channel.channel_type == 'telegram' %} Chat: {{ config.chat_id|default('N/A') }} {% elseif channel.channel_type == 'pushover' %} User: {{ (config.user_key|default('N/A'))|slice(0, 10) }}... {% elseif channel.channel_type == 'webhook' %} {% set format = config.format|default('generic') %} Format: {{ formatLabels[format]|default(format|capitalize) }} {% else %} Webhook configured {% endif %}

{{ csrf_field() }}
{{ csrf_field() }}
{% endfor %}
{% endif %} {# Add Channel Form #}

Add New Channel

{{ csrf_field() }} {# Channel Type #}
{# Email Fields #} {# Telegram Fields #} {# Discord Fields #} {# Slack Fields #} {# Mattermost Fields #} {# Pushover Fields #} {# Generic Webhook Fields #}
{# Assigned Domains #}

Assigned Domains ({{ group.domains|length }})

{% if group.domains is empty %}

No domains assigned to this group yet

Add a Domain
{% else %}
{% for domain in group.domains %} {% set statusClass = domain.status == 'active' ? 'bg-green-100 dark:bg-green-500/20 text-green-800 dark:text-green-400' : 'bg-gray-200 dark:bg-slate-600 text-gray-600 dark:text-slate-400' %}
{{ domain.status|capitalize }}

{{ domain.domain_name }}

Expires: {{ domain.expiration_date ? domain.expiration_date|date('M j, Y') : 'Unknown' }}

{% endfor %}
{% endif %}
{% endblock %}