From 1f75530910d3ae336aaf1f18c364250553ad71fc Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 30 Jun 2021 01:07:36 +1000 Subject: [PATCH] Specify custom help text for fields on the client side --- InvenTree/part/templates/part/category.html | 4 +++- InvenTree/templates/js/forms.js | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/templates/part/category.html b/InvenTree/part/templates/part/category.html index 125e089721..cf7348be76 100644 --- a/InvenTree/part/templates/part/category.html +++ b/InvenTree/part/templates/part/category.html @@ -275,7 +275,9 @@ fields: { name: {}, description: {}, - parent: {}, + parent: { + help_text: '{% trans "Select parent category" %}', + }, default_location: {}, default_keywords: { icon: 'fa-key', diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index c472a83ffd..fec168e923 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -286,6 +286,11 @@ function constructFormBody(fields, options) { // Edit callback fields[field].onEdit = field_options.onEdit; + // Custom help_text + if (field_options.help_text) { + fields[field].help_text = field_options.help_text; + } + // Field prefix if (field_options.prefix) { fields[field].prefix = field_options.prefix;