Show the available variable in the help text

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-12-10 22:31:08 -04:00
parent 1ee449d894
commit 913e57a010
3 changed files with 9 additions and 3 deletions
+6 -3
View File
@@ -19,10 +19,13 @@ class TemplateField(forms.CharField):
self.help_text = string_concat(
self.initial_help_text, ' ',
_(
'The template string to be evaluated. '
'Use Django\'s default templating language '
'(https://docs.djangoproject.com/en/%(django_version)s/ref/templates/builtins/)'
) % {'django_version': mayan.__django_version__}
'(https://docs.djangoproject.com/en/%(django_version)s/ref/templates/builtins/). '
'The {{ %(variable)s }} variable is available to the template.'
) % {
'django_version': mayan.__django_version__,
'variable': self.model_variable
}
)
self.widget.attrs['model'] = self.model
self.widget.attrs['data-model-variable'] = self.model_variable