add html for notification setting

This commit is contained in:
Matthias 2022-05-04 17:40:04 +02:00
parent 0ff407348d
commit b16305afef
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093
2 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,7 @@
<td>
{% if setting.is_bool %}
<div class='form-check form-switch'>
<input class='form-check-input boolean-setting' fieldname='{{ setting.key.upper }}' pk='{{ setting.pk }}' setting='{{ setting.key.upper }}' id='setting-value-{{ setting.key.upper }}' type='checkbox' {% if setting.as_bool %}checked=''{% endif %} {% if plugin %}plugin='{{ plugin.pk }}'{% endif %}{% if user_setting %}user='{{request.user.id}}'{% endif %}>
<input class='form-check-input boolean-setting' fieldname='{{ setting.key.upper }}' pk='{{ setting.pk }}' setting='{{ setting.key.upper }}' id='setting-value-{{ setting.key.upper }}' type='checkbox' {% if setting.as_bool %}checked=''{% endif %} {% if plugin %}plugin='{{ plugin.pk }}'{% endif %}{% if user_setting %}user='{{request.user.id}}'{% endif %}{% if notification_setting %}notification='{{request.user.id}}'{% endif %}>
</div>
{% else %}
<div id='setting-{{ setting.pk }}'>

View File

@ -70,6 +70,7 @@ $('table').find('.boolean-setting').change(function() {
var pk = $(this).attr('pk');
var plugin = $(this).attr('plugin');
var user = $(this).attr('user');
var notification = $(this).attr('notification');
var checked = this.checked;
@ -80,6 +81,8 @@ $('table').find('.boolean-setting').change(function() {
url = `/api/plugin/settings/${pk}/`;
} else if (user) {
url = `/api/settings/user/${pk}/`;
} else if (notification) {
url = `/api/settings/notification/${pk}/`;
}
inventreePut(