Expand UI for notifications.

This commit is contained in:
James Cole
2024-12-07 08:05:51 +01:00
parent 1220564f30
commit 26948a058a
13 changed files with 2834 additions and 2622 deletions

View File

@@ -86,4 +86,7 @@ return [
'mfa_enableMFA' => 'Enable multi-factor authentication',
'mfa_backup_codes' => 'Backup codes',
'mfa_disableMFA' => 'Disable multi-factor authentication',
// notifications
'notification_index' => 'Owner notifications',
];

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,7 @@
</li>
<li><a href="{{ route('admin.links.index') }}">{{ 'journal_link_configuration'|_ }}</a></li>
<li><a href="{{ route('admin.update-check') }}">{{ 'update_check_title'|_ }}</a></li>
<li><a href="{{ route('admin.notifications') }}">{{ 'settings_notifications'|_ }}</a></li>
</ul>
</div>
</div>
@@ -34,20 +35,20 @@
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'admin_notifications'|_ }}</h3>
<h3 class="box-title">{{ 'owner_notifications'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'admin_notifications_expl'|_ }}
{{ 'owner_notifications_expl'|_ }}
</p>
{% for notification, value in notifications %}
<div class="checkbox">
<label>
<input value="1" {% if true == value %}checked{% endif %} type="checkbox" name="notification_{{ notification }}"> {{ trans('firefly.admin_notification_check_'~notification) }}
<input value="1" {% if true == value %}checked{% endif %} type="checkbox" name="notification_{{ notification }}"> {{ trans('firefly.owner_notification_check_'~notification) }}
</label>
</div>
{% endfor %}
{{ ExpandedForm.text('slackUrl', slackUrl, {'label' : 'slack_url_label'|_}) }}
{# {{ ExpandedForm.text('slackUrl', slackUrl, {'label' : 'slack_url_label'|_}) }} #}
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success">

View File

@@ -0,0 +1,68 @@
{% extends './layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render }}
{% endblock %}
{% block content %}
<div class="row" xmlns="http://www.w3.org/1999/html">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<form action="{{ route('admin.notification.post') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'notification_settings'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('slackUrl', slackUrl, {'label' : 'slack_url_label'|_}) }}
{{ ExpandedForm.text('discordUrl', discordUrl, {'label' : 'discord_url_label'|_}) }}
</div>
<div class="box-footer">
<button type="submit" class="btn btn-success">
<span class="fa fa-check-circle"></span> {{ ('save_notification_settings')|_ }}
</button>
</div>
</div>
</form>
</div>
<form action="{{ route('admin.notification.test') }}" method="post">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'available_channels_title'|_ }}</h3>
</div>
<div class="box-body">
<p>
{{ 'available_channels_expl'|_ }}
</p>
<ul>
{% for name,info in channels %}
<li>
{% if info.enabled %}
☑️ {{ trans('firefly.notification_channel_name_'~name) }}
{% if 0 == info.ui_configurable %}({{ 'configure_channel_in_env'|_ }}) {% endif %}
{% endif %}
{% if not info.enabled %}
⚠️ {{ trans('firefly.notification_channel_name_'~name) }} ({{ 'channel_not_available'|_ }})
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<div class="box-footer">
<div class="btn-group">
{% for name,info in channels %}
{% if info.enabled %}
<button type="submit" name="test_submit" value="{{ name }}" class="btn btn-default">
{{ trans('firefly.test_notification_channel_name_'~name) }}
</button>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
</form>
</div>
{% endblock %}

View File

@@ -2,7 +2,7 @@
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
<div class="col-sm-8">
{{ Html.select(name~"[]", list, selected).id(options.id).class('form-control').attribute('multiple').attribute('autocomplete','off').attribute('spellcheck','false').attribute('placeholder', options.placeholder) }}
{{ Html.multiselect(name~"[]", list, selected).id(options.id).class('form-control').attribute('autocomplete','off').attribute('spellcheck','false').attribute('placeholder', options.placeholder) }}
{% include 'form.help' %}
{% include 'form.feedback' %}

View File

@@ -56,7 +56,13 @@
{% endif %}
{# SINGLE INFO MESSAGE #}
{% if session('info') is not iterable %}
{% if session_has('info_url') %}
<a href="{{ session('info_url') }}">
{% endif %}
<strong>{{ 'flash_info'|_ }}:</strong> {{ session('info')|raw }}
{% if session_has('info_url') %}
</a>
{% endif %}
{% endif %}
</div>