2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

[FR] Slack notifications & notification method updates (#4114)

* [FR] Slack notification
Add slack sending method
Fixes #3843

* Add global panel with notification methods

* add plugin information

* fix plugin lookup and link

* Add settings content mixin

* Add instructions for Slack setup

* fix rendering of custom settings content
This commit is contained in:
Matthias Mair
2022-12-31 23:20:55 +01:00
committed by GitHub
parent 758f7886f1
commit 8b2e2a28d5
10 changed files with 189 additions and 5 deletions

View File

@ -0,0 +1,6 @@
{% load plugin_extras %}
{% plugin_settings_content plugin_key as plugin_settings_content %}
{% if plugin_settings_content %}
{{ plugin_settings_content|safe }}
{% endif %}

View File

@ -0,0 +1,54 @@
{% extends "panel.html" %}
{% load i18n %}
{% load inventree_extras %}
{% load plugin_extras %}
{% block label %}global-notifications{% endblock label %}
{% block heading %}{% trans "Global Notification Settings" %}{% endblock heading %}
{% block content %}
<div class='row'>
<table class='table table-striped table-condensed'>
<thead>
<th></th>
<th>{% trans "Name" %}</th>
<th>{% trans "Slug" %}</th>
<th>{% trans "Description" %}</th>
</thead>
<tbody>
{% notification_list as methods %}
{% for method in methods %}
<tr>
<td>{% if method.icon %}<span class="fas {{ method.icon }}"></span>{% endif %}</td>
<td>
{{ method.name }}
{% if method.plugin %}
<a class='sidebar-selector' id='select-plugin-{{method.plugin.slug}}' data-bs-parent="#sidebar">
<span class='badge bg-dark badge-right rounded-pill'>{{ method.plugin.slug }}</span>
</a>
{% endif %}
</td>
<td>{{ method.slug }}</td>
<td>{{ method.description }}</td>
</tr>
{% if method.setting %}
<tr>
<td colspan="1"></td>
<td colspan="3">
<table class='table table-condensed'>
<tbody>
{% include "InvenTree/settings/setting.html" with key=method.setting plugin=method.plugin %}
</tbody>
</table>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% endblock content %}

View File

@ -148,4 +148,6 @@
{% include 'InvenTree/settings/mixins/urls.html' %}
{% endif %}
{% include 'InvenTree/settings/mixins/settings_content.html' %}
{% endblock %}

View File

@ -32,6 +32,7 @@
{% include "InvenTree/settings/global.html" %}
{% include "InvenTree/settings/login.html" %}
{% include "InvenTree/settings/barcode.html" %}
{% include "InvenTree/settings/notifications.html" %}
{% include "InvenTree/settings/label.html" %}
{% include "InvenTree/settings/report.html" %}
{% include "InvenTree/settings/part.html" %}

View File

@ -32,6 +32,8 @@
{% include "sidebar_item.html" with label='login' text=text icon="fa-fingerprint" %}
{% trans "Barcode Support" as text %}
{% include "sidebar_item.html" with label='barcodes' text=text icon="fa-qrcode" %}
{% trans "Notifications" as text %}
{% include "sidebar_item.html" with label='global-notifications' text=text icon="fa-bell" %}
{% trans "Pricing" as text %}
{% include "sidebar_item.html" with label='pricing' text=text icon="fa-dollar-sign" %}
{% trans "Label Printing" as text %}