Skip to content

Commit 9e382bb

Browse files
committed
Added support for reStructuredText markup in bios.
- Legacy-Id: 11284
1 parent aa4ddc0 commit 9e382bb

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

ietf/person/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PersonInfo(models.Model):
2727
ascii_short = models.CharField("Abbreviated Name (ASCII)", max_length=32, null=True, blank=True, help_text="Example: A. Nonymous. Fill in this with initials and surname only if taking the initials and surname of the ASCII name above produces an incorrect initials-only form. (Blank is OK).")
2828
affiliation = models.CharField(max_length=255, blank=True, help_text="Employer, university, sponsor, etc.")
2929
address = models.TextField(max_length=255, blank=True, help_text="Postal mailing address.")
30-
biography = models.TextField(blank=True, help_text="Short biography for use on leadership pages.")
30+
biography = models.TextField(blank=True, help_text="Short biography for use on leadership pages. Use plain text or reStructuredText markup.")
3131
photo = models.ImageField(storage=NoLocationMigrationFileSystemStorage(location=settings.PHOTOS_DIR),upload_to=settings.PHOTOS_DIRNAME,blank=True)
3232
photo_thumb = models.ImageField(storage=NoLocationMigrationFileSystemStorage(location=settings.PHOTOS_DIR),upload_to=settings.PHOTOS_DIRNAME,blank=True)
3333

ietf/settings.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def skip_unreadable_post(record):
271271
'form_utils',
272272
'tastypie',
273273
'widget_tweaks',
274+
'django_markup',
274275
# IETF apps
275276
'ietf.api',
276277
'ietf.community',
@@ -626,6 +627,20 @@ def skip_unreadable_post(record):
626627
TRAC_WIKI_DIR = "/a/www/www6s/trac"
627628
TRAC_SVN_DIR = "/a/svn/group"
628629

630+
MARKUP_SETTINGS = {
631+
'restructuredtext': {
632+
'settings_overrides': {
633+
'initial_header_level': 3,
634+
'doctitle_xform': False,
635+
'footnote_references': 'superscript',
636+
'trim_footnote_reference_space': True,
637+
'default_reference_context': 'view',
638+
'link_base': ''
639+
}
640+
}
641+
}
642+
643+
629644
# Put the production SECRET_KEY in settings_local.py, and also any other
630645
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
631646
from settings_local import * # pyflakes:ignore
@@ -651,3 +666,4 @@ def skip_unreadable_post(record):
651666
if 'SECRET_KEY' not in locals():
652667
SECRET_KEY = 'PDwXboUq!=hPjnrtG2=ge#N$Dwy+wn@uivrugwpic8mxyPfHka'
653668
ALLOWED_HOSTS = ['*',]
669+

ietf/templates/person/profile.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
33
{% load origin %}
4+
{% load markup_tags %}
45

56
{% block title %}Profile for {{ person }}{% endblock %}
67

@@ -11,7 +12,7 @@ <h1>{{ person }}</h1>
1112

1213
<div class="bio-text">
1314
<img class="bio-photo" src="{{ person.photo.url }}" alt="Photo of {{ person }}" />
14-
{{ person.biography }}
15+
{{ person.biography | apply_markup:"restructuredtext" }}
1516
</div>
1617

1718
{% endblock %}

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ decorator>=3.4.0
77
defusedxml>=0.4.1 # for TastyPie when ussing xml; not a declared dependency
88
Django>=1.7.10,<1.8
99
django-bootstrap3>=5.1.1,<7.0.0 # django-bootstrap 7.0 requires django 1.8
10+
django-markup>=1.1
1011
django-tastypie>=0.13.1
1112
django-widget-tweaks>=1.3
1213
docutils>=0.12

0 commit comments

Comments
 (0)