Merge pull request #5795 from rjsparks/markdowncharters

feat: render charters on about page using markdown
This commit is contained in:
Robert Sparks 2023-06-13 12:22:51 -05:00 committed by GitHub
commit a3db61cf69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -166,6 +166,7 @@ def fill_in_charter_info(group, include_drafts=False):
group.charter_text = get_charter_text(group) group.charter_text = get_charter_text(group)
else: else:
group.charter_text = "Not chartered yet." group.charter_text = "Not chartered yet."
group.charter_html = markdown.markdown(group.charter_text)
def extract_last_name(role): def extract_last_name(role):
return role.person.name_parts()[3] return role.person.name_parts()[3]

View file

@ -379,8 +379,7 @@ height: 100vh;
{% if group.state_id == "proposed" %}proposed{% endif %} {% if group.state_id == "proposed" %}proposed{% endif %}
{{ group.type.desc.title }} {{ group.type.desc.title }}
</h2> </h2>
{# the linebreaks filter adds <p>, no surrounding <p> necessary: #} {{ group.charter_html }}
{{ group.charter_text|urlize_ietf_docs|linkify|linebreaks }}
{% else %} {% else %}
<h2 class="mt-3"> <h2 class="mt-3">
{% if requested_close or group.state_id == "conclude" %}Final{% endif %} {% if requested_close or group.state_id == "conclude" %}Final{% endif %}

View file

@ -40,15 +40,15 @@
{% block js %} {% block js %}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('input[name=widthconstraint]').trigger("change", function() { $('input[name=widthconstraint]').on("change", function() {
if ($(this).is(':checked')) { if ($(this).is(':checked')) {
$('.rightcontent').css('max-width','700px') $('.rightcontent').css('max-width','700px')
} else { } else {
$('.rightcontent').css('max-width','') $('.rightcontent').css('max-width','')
} }
}); });
$('input[name=widthconstraint').prop('checked', true); $('input[name=widthconstraint').prop('checked', false);
$('.rightcontent').css('max-width','700px') $('.rightcontent').css('max-width','')
}); });
</script> </script>
{% endblock %} {% endblock %}