|
11 | 11 |
|
12 | 12 | from flask import flash, g
|
13 | 13 | from flask_pluginengine import render_plugin_template, uses
|
14 |
| -from wtforms.fields import BooleanField, EmailField, IntegerField, URLField, TextAreaField |
| 14 | +from markupsafe import Markup |
| 15 | +from wtforms.fields import BooleanField, EmailField, IntegerField, TextAreaField, URLField |
15 | 16 | from wtforms.validators import DataRequired, NumberRange, Optional
|
16 | 17 |
|
17 | 18 | from indico.core import signals
|
@@ -59,7 +60,8 @@ class SettingsForm(IndicoForm):
|
59 | 60 | description=_('Email to send the notifications to'))
|
60 | 61 | cloudconvert_conversion_notice = TextAreaField(_('PDF conversion notice'),
|
61 | 62 | description=_('A notice that will be shown to end users when '
|
62 |
| - 'converting PDF files in the upload files dialog.')) |
| 63 | + 'converting PDF files in the upload files dialog. ' |
| 64 | + 'You may use basic HTML elements for formatting.')) |
63 | 65 | valid_extensions = TextListField(_('Extensions'),
|
64 | 66 | filters=[lambda exts: sorted({ext.lower().lstrip('.').strip() for ext in exts})],
|
65 | 67 | description=_('File extensions for which PDF conversion is supported. '
|
@@ -112,11 +114,11 @@ def _add_file_form_fields(self, form_cls, **kwargs):
|
112 | 114 | description = _('If enabled, your files will be converted to PDF if possible. '
|
113 | 115 | 'The following file types can be converted: {exts}').format(exts=exts)
|
114 | 116 | if self.settings.get('cloudconvert_conversion_notice'):
|
115 |
| - description = '{}\n\n{}'.format(self.settings.get('cloudconvert_conversion_notice'), |
| 117 | + description = '{}<br>{}'.format(self.settings.get('cloudconvert_conversion_notice'), |
116 | 118 | _('The following file types can be converted: {exts}').format(exts=exts))
|
117 | 119 | return 'convert_to_pdf', \
|
118 | 120 | BooleanField(_('Convert to PDF'), widget=SwitchWidget(),
|
119 |
| - description=description, |
| 121 | + description=Markup(description), |
120 | 122 | default=True)
|
121 | 123 |
|
122 | 124 | def _add_url_form_fields(self, form_cls, **kwargs):
|
|
0 commit comments