Repository: ietf-tools/datatracker

Issue:
BoF deadline in important dates should rather have a link to the datatracker boF request page then the ietf.org page
### Discussed in https://github.com/ietf-tools/datatracker/discussions/3910

<div type='discussions-op-text'>

<sup>Originally posted by **mirjak** April 29, 2022</sup>
The link to further instructions to the ietf.org should rather be at the point of the BoF request page, or at least also there!</div>


Discussion:
The template for important date _adds_ text to what the important date's description field contains for several importanddatename ids. This seems really odd - the information should just be part of the importantdatename description itself. This needs review.

The fix for this particular ticket is to change the description of the field in the admin.
I agree, it seems that `ietf/templates/meeting/important-dates.html` should be cleaned by removing the BoF part as it is useless.
OTOH (discovering DT piecemeal by piecemeal...), the template can use nice hyperlink with a descriptive text while any URL in the DB is simply transformed into a hyperlink (a little less nice).
I think the right thing to do is to change the processing for the description of each important date to be markdown input, rendered through markdown at display.

All of the workarounds we're seeing in the template can then move into the description. @larseggert - do you have an opinion?
Nicer and more elegant solution indeed. BTW, is there a MD rendering library somewhere ?
We are already using https://pypi.org/project/Markdown/.
Look at, for instance, https://github.com/ietf-tools/datatracker/blob/1ba87890ba9451bb696aef4c8d049bcefa85b71b/ietf/doc/views_doc.py#L560

Resolving patch:
diff --git a/ietf/doc/templatetags/ietf_filters.py b/ietf/doc/templatetags/ietf_filters.py
--- a/ietf/doc/templatetags/ietf_filters.py
+++ b/ietf/doc/templatetags/ietf_filters.py
@@ -227,7 +227,6 @@ def link_other_doc_match(match):
     url = urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc + rev))
     return f'<a href="{url}">{match[1]}</a>'
 
-
 @register.filter(name="urlize_ietf_docs", is_safe=True, needs_autoescape=True)
 def urlize_ietf_docs(string, autoescape=None):
     """
diff --git a/ietf/name/migrations/0011_adjust_important_dates.py b/ietf/name/migrations/0011_adjust_important_dates.py
new file mode 100644
--- /dev/null
+++ b/ietf/name/migrations/0011_adjust_important_dates.py
@@ -0,0 +1,29 @@
+# Copyright The IETF Trust 2023, All Rights Reserved
+
+from django.db import migrations
+
+def markdown_names(apps, schema_editor):
+    ImportantDateName = apps.get_model("name", "ImportantDateName")
+    changes = [
+        ('bofproposals', "Preliminary BOF proposals requested. To request a __BoF__ session use the [IETF BoF Request Tool](/doc/bof-requests)."),
+        ('openreg', "IETF Online Registration Opens [Register Here](https://www.ietf.org/how/meetings/register/)."),
+        ('opensched', "Working Group and BOF scheduling begins. To request a Working Group session, use the [IETF Meeting Session Request Tool](/secr/sreq/). If you are working on a BOF request, it is highly recommended to tell the IESG now by sending an [email to iesg@ietf.org](mailtp:iesg@ietf.org) to get advance help with the request."),
+        ('cutoffwgreq', "Cut-off date for requests to schedule Working Group Meetings at UTC 23:59. To request a __Working Group__ session, use the [IETF Meeting Session Request Tool](/secr/sreq/)."),
+        ('idcutoff', "Internet-Draft submission cut-off (for all Internet-Drafts, including -00) by UTC 23:59. Upload using the [I-D Submission Tool](/submit/)."),
+        ('cutoffwgreq', "Cut-off date for requests to schedule Working Group Meetings at UTC 23:59. To request a __Working Group__ session, use the [IETF Meeting Session Request Tool](/secr/sreq/)."),
+        ('bofprelimcutoff', "Cut-off date for BOF proposal requests. To request a __BoF__ session use the [IETF BoF Request Tool](/doc/bof-requests)."),
+        ('cutoffbofreq', "Cut-off date for BOF proposal requests to Area Directors at UTC 23:59. To request a __BoF__ session use the [IETF BoF Request Tool](/doc/bof-requests)."),
+    ]
+    for slug, newDescription in changes:
+        datename = ImportantDateName.objects.get(pk=slug) # If the slug does not exist, then Django will throw an exception :-)
+        datename.desc = newDescription
+        datename.save()
+
+class Migration(migrations.Migration):
+    dependencies = [
+        ("name", "0010_subseries"),
+    ]
+
+    operations = [
+        migrations.RunPython(markdown_names),
+    ]
diff --git a/ietf/utils/templatetags/htmlfilters.py b/ietf/utils/templatetags/htmlfilters.py
--- a/ietf/utils/templatetags/htmlfilters.py
+++ b/ietf/utils/templatetags/htmlfilters.py
@@ -7,6 +7,7 @@
 from django.template.defaultfilters import stringfilter
 
 from ietf.utils.html import remove_tags
+from ietf.utils.markdown import markdown as utils_markdown
 
 register = Library()
 
@@ -16,3 +17,9 @@
 def removetags(value, tags):
     """Removes a comma-separated list of [X]HTML tags from the output."""
     return remove_tags(value, re.split(r"\s*,\s*", tags))
+
+@register.filter(name="markdown", is_safe=True)
+def markdown(string):
+    # One issue is that the string is enclosed in <p></p>... Let's remove the leading/trailing ones...
+    return utils_markdown(string)[3:-4]
+


Test patch: