Add Markdown for submit page, edit page, profile edit page; thus fixing ticket #690
authorJef van Schendel <mail@jefvanschendel.nl>
Wed, 4 Jan 2012 16:48:16 +0000 (17:48 +0100)
committerJef van Schendel <mail@jefvanschendel.nl>
Wed, 4 Jan 2012 16:48:16 +0000 (17:48 +0100)
mediagoblin/edit/forms.py
mediagoblin/submit/forms.py
mediagoblin/templates/mediagoblin/user_pages/media.html
mediagoblin/templates/mediagoblin/utils/wtforms.html

index f9cc92bfe228ea177e780d097fb012d6369aeeff..406de3f8428bc920b1479877528ccf3b4468124b 100644 (file)
@@ -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
+                      <a href="http://daringfireball.net/projects/markdown/basics">
+                      Markdown</a> 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
+            <a href="http://daringfireball.net/projects/markdown/basics">
+            Markdown</a> for formatting."""))
     url = wtforms.TextField(
         _('Website'),
         [wtforms.validators.Optional(),
index e21b00eebf1ef57e786074bcb4cfd4a66c303f89..7ef3638f980f1819e0285e2a02f312cbcc8f9710 100644 (file)
@@ -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
+                      <a href="http://daringfireball.net/projects/markdown/basics">
+                      Markdown</a> for formatting."""))
     tags = wtforms.TextField(
         _('Tags'),
         [tag_length_validator],
index d52f544ff5d133275133b9dadd6497b67087fb74..9b3317895ecaf511d91858c441df8a093909521e 100644 (file)
@@ -96,7 +96,7 @@
                                          user= media.get_uploader.username,
                                          media=media._id) }}" method="POST" id="form_comment">
           <p>
-            {% trans %}Type your comment here. You can use <a href="http://daringfireball.net/projects/markdown/basics" target="_blank">Markdown</a> for formatting.{% endtrans %}
+            {% trans %}Type your comment here. You can use <a href="http://daringfireball.net/projects/markdown/basics">Markdown</a> for formatting.{% endtrans %}
           </p>
           {{ wtforms_util.render_divs(comment_form) }}
           <div class="form_submit_buttons">
index cc30388fc8d7e5ae54882ce34d12971e65f6f8fa..3517b5c310d659376ecad098e6f0cbcde80207cd 100644 (file)
@@ -29,7 +29,7 @@
       {% endfor %}
     {%- endif %}
     {% if field.description -%}
-      <p class="form_field_description">{{ _(field.description) }}</p>
+      <p class="form_field_description">{{ _(field.description)|safe }}</p>
     {%- endif %}
   </div>
 {%- endmacro %}