mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Make "confirm" buttons a user-configurable option. (#3313)
* Make "confirm" buttons a user-configurable option. Add a new setting to enable the confirm button Fixes #3069 * Add seperator
This commit is contained in:
parent
849e54f2e9
commit
4b0b76ecc5
@ -850,6 +850,13 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
|||||||
'default': False,
|
'default': False,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'INVENTREE_REQUIRE_CONFIRM': {
|
||||||
|
'name': _('Require confirm'),
|
||||||
|
'description': _('Require explicit user confirmation for certain action.'),
|
||||||
|
'validator': bool,
|
||||||
|
'default': True,
|
||||||
|
},
|
||||||
|
|
||||||
'BARCODE_ENABLE': {
|
'BARCODE_ENABLE': {
|
||||||
'name': _('Barcode Support'),
|
'name': _('Barcode Support'),
|
||||||
'description': _('Enable barcode scanner support'),
|
'description': _('Enable barcode scanner support'),
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_RESTRICT_ABOUT" icon="fa-info-circle" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_RESTRICT_ABOUT" icon="fa-info-circle" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_BASE_URL" icon="fa-globe" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_BASE_URL" icon="fa-globe" %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_COMPANY_NAME" icon="fa-building" %}
|
||||||
|
<tr><td colspan='5'></td></tr>
|
||||||
{% include "InvenTree/settings/setting.html" with key="INVENTREE_DOWNLOAD_FROM_URL" icon="fa-cloud-download-alt" %}
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_DOWNLOAD_FROM_URL" icon="fa-cloud-download-alt" %}
|
||||||
|
{% include "InvenTree/settings/setting.html" with key="INVENTREE_REQUIRE_CONFIRM" icon="fa-check" %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
inventreeFormDataUpload,
|
inventreeFormDataUpload,
|
||||||
inventreeGet,
|
inventreeGet,
|
||||||
inventreePut,
|
inventreePut,
|
||||||
|
global_settings,
|
||||||
modalEnable,
|
modalEnable,
|
||||||
modalShowSubmitButton,
|
modalShowSubmitButton,
|
||||||
renderBuild,
|
renderBuild,
|
||||||
@ -575,7 +576,7 @@ function constructFormBody(fields, options) {
|
|||||||
$(modal).find('#modal-footer-buttons').html('');
|
$(modal).find('#modal-footer-buttons').html('');
|
||||||
|
|
||||||
// Insert "confirm" button (if required)
|
// Insert "confirm" button (if required)
|
||||||
if (options.confirm) {
|
if (options.confirm && global_settings.INVENTREE_REQUIRE_CONFIRM) {
|
||||||
insertConfirmButton(options);
|
insertConfirmButton(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user