Repository: akvo/akvo-rsr

Issue:
Support markdown in text fields
## Test plan

GIVEN the project editor
WHEN looking at the description fields (all fields under section 4, except the summary)
THEN the help text should indicate that Markdown is supported

GIVEN the project page
WHEN looking at the descriptions accordion on the bottom of the summary tab
OR looking at the descriptions in the 'Full report' tab
THEN the texts should be displayed according to the Markdown rules
## Issue description

We got a request to support links in text fields by Juho from Plan Finland, see https://rsrsupport.reamaze.com/admin/conversations/akvorsr-support-request-number-14087-from-juho-dot-molsa-at-plan-international-dot-org.

We could easily support markdown, using this tiny JS library for example: http://simonwaldherr.github.io/micromarkdown.js/.



Discussion:

Resolving patch:
diff --git a/akvo/rsr/models/project.py b/akvo/rsr/models/project.py
--- a/akvo/rsr/models/project.py
+++ b/akvo/rsr/models/project.py
@@ -151,16 +151,22 @@ class Project(TimestampsMixin, models.Model):
 
     goals_overview = ValidXMLTextField(
         _(u'goals overview'), blank=True,
-        help_text=_(u'Provide a brief description of the overall project goals.')
+        help_text=_(u'Provide a brief description of the overall project goals. For links and '
+                    u'styling of the text, <a href="https://github.com/adam-p/markdown-here/wiki/'
+                    u'Markdown-Cheatsheet" target="_blank">Markdown</a> is supported.')
     )
     current_status = ValidXMLTextField(
         _(u'baseline situation'), blank=True,
-        help_text=_(u'Describe the situation at the start of the project.')
+        help_text=_(u'Describe the situation at the start of the project. For links and styling of '
+                    u'the text, <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-'
+                    u'Cheatsheet" target="_blank">Markdown</a> is supported.')
     )
     project_plan = ValidXMLTextField(
         _(u'project plan'), blank=True,
         help_text=_(u'Detailed information about the implementation of the project: the what, how, '
-                    u'who and when.')
+                    u'who and when. For links and styling of the text, <a href="https://github.com/'
+                    u'adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">Markdown</a> '
+                    u'is supported.')
     )
     sustainability = ValidXMLTextField(
         _(u'sustainability'), blank=True,
@@ -168,18 +174,24 @@ class Project(TimestampsMixin, models.Model):
                     u'years after project implementation. Think about the institutional setting, '
                     u'capacity-building, a cost recovery plan, products used, feasible '
                     u'arrangements for operation and maintenance, anticipation of environmental '
-                    u'impact and social integration.')
+                    u'impact and social integration. For links and styling of the text, '
+                    u'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" '
+                    u'target="_blank">Markdown</a> is supported.')
     )
     background = ValidXMLTextField(
         _(u'background'), blank=True,
         help_text=_(u'This should describe the geographical, political, environmental, social '
                     u'and/or cultural context of the project, and any related activities that '
-                    u'have already taken place or are underway.')
+                    u'have already taken place or are underway. For links and styling of the text, '
+                    u'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" '
+                    u'target="_blank">Markdown</a> is supported.')
     )
     target_group = ProjectLimitedTextField(
         _(u'target group'), blank=True,
         help_text=_(u'This should include information about the people, organisations or resources '
-                    u'that are being impacted by this project.')
+                    u'that are being impacted by this project. For links and styling of the text, '
+                    u'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" '
+                    u'target="_blank">Markdown</a> is supported.')
     )
 
     # Results framework (always on)


Test patch: