From 9c196287ad26f52acb38d6c37560848da23151a6 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Wed, 4 Jan 2012 17:48:16 +0100 Subject: [PATCH] Add Markdown for submit page, edit page, profile edit page; thus fixing ticket #690 --- mediagoblin/edit/forms.py | 12 ++++++++++-- mediagoblin/submit/forms.py | 5 ++++- .../templates/mediagoblin/user_pages/media.html | 2 +- mediagoblin/templates/mediagoblin/utils/wtforms.html | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index f9cc92bf..406de3f8 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -23,7 +23,11 @@ class EditForm(wtforms.Form): title = wtforms.TextField( _('Title'), [wtforms.validators.Length(min=0, max=500)]) - description = wtforms.TextAreaField('Description of this work') + description = wtforms.TextAreaField( + _('Description of this work'), + description=_("""You can use + + Markdown for formatting.""")) tags = wtforms.TextField( _('Tags'), [tag_length_validator], @@ -40,7 +44,11 @@ class EditForm(wtforms.Form): class EditProfileForm(wtforms.Form): bio = wtforms.TextAreaField( _('Bio'), - [wtforms.validators.Length(min=0, max=500)]) + [wtforms.validators.Length(min=0, max=500)], + description=_( + """You can use + + Markdown for formatting.""")) url = wtforms.TextField( _('Website'), [wtforms.validators.Optional(), diff --git a/mediagoblin/submit/forms.py b/mediagoblin/submit/forms.py index e21b00ee..7ef3638f 100644 --- a/mediagoblin/submit/forms.py +++ b/mediagoblin/submit/forms.py @@ -27,7 +27,10 @@ class SubmitStartForm(wtforms.Form): _('Title'), [wtforms.validators.Length(min=0, max=500)]) description = wtforms.TextAreaField( - _('Description of this work')) + _('Description of this work'), + description=_("""You can use + + Markdown for formatting.""")) tags = wtforms.TextField( _('Tags'), [tag_length_validator], diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index d52f544f..9b331789 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -96,7 +96,7 @@ user= media.get_uploader.username, media=media._id) }}" method="POST" id="form_comment">

- {% trans %}Type your comment here. You can use Markdown for formatting.{% endtrans %} + {% trans %}Type your comment here. You can use Markdown for formatting.{% endtrans %}

{{ wtforms_util.render_divs(comment_form) }}
diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index cc30388f..3517b5c3 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -29,7 +29,7 @@ {% endfor %} {%- endif %} {% if field.description -%} -

{{ _(field.description) }}

+

{{ _(field.description)|safe }}

{%- endif %}
{%- endmacro %} -- 2.25.1