Show the available variable in the help text
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user