mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Adds API endpoints for viewing and updating plugin settings
A lot of code updates / refactoring here to get this to work as expected
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
<table class='table table-striped table-condensed'>
|
||||
<tbody>
|
||||
{% for setting in plugin_settings %}
|
||||
{% include "InvenTree/settings/setting.html" with key=setting%}
|
||||
{% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
@ -1,10 +1,12 @@
|
||||
{% load inventree_extras %}
|
||||
{% load i18n %}
|
||||
|
||||
{% if user_setting %}
|
||||
{% setting_object key user=request.user as setting %}
|
||||
{% if plugin %}
|
||||
{% setting_object key plugin=plugin as setting %}
|
||||
{% elif user_setting %}
|
||||
{% setting_object key user=request.user as setting %}
|
||||
{% else %}
|
||||
{% setting_object key as setting %}
|
||||
{% setting_object key as setting %}
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
|
@ -28,9 +28,13 @@ function editSetting(pk, options={}) {
|
||||
// Is this a global setting or a user setting?
|
||||
var global = options.global || false;
|
||||
|
||||
var plugin = options.plugin;
|
||||
|
||||
var url = '';
|
||||
|
||||
if (global) {
|
||||
if (plugin) {
|
||||
url = `/api/plugin/settings/${pk}/`;
|
||||
} else if (global) {
|
||||
url = `/api/settings/global/${pk}/`;
|
||||
} else {
|
||||
url = `/api/settings/user/${pk}/`;
|
||||
|
Reference in New Issue
Block a user