Add Markdown support to feature matrix descriptions

This will make it possible to allow for links in longer
descriptions for particular features. This also adds some
help text describing how the feature matrix details field
works, as I remember I was originally caught by surprise that
one could provide a direct link to something.
This commit is contained in:
Jonathan S. Katz
2020-08-30 15:46:50 -04:00
parent 112cd743c2
commit 0a101dc3a4
3 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('featurename', models.CharField(max_length=100)),
('featuredescription', models.TextField(blank=True)),
('featuredescription', models.TextField(blank=True, help_text="""Supports Markdown. A single, plain URL will link directly to that URL.""")),
('v74', models.IntegerField(default=0, verbose_name='7.4', choices=[(0, 'No'), (1, 'Yes'), (2, 'Obsolete'), (3, '?')])),
('v80', models.IntegerField(default=0, verbose_name='8.0', choices=[(0, 'No'), (1, 'Yes'), (2, 'Obsolete'), (3, '?')])),
('v81', models.IntegerField(default=0, verbose_name='8.1', choices=[(0, 'No'), (1, 'Yes'), (2, 'Obsolete'), (3, '?')])),

View File

@ -27,7 +27,7 @@ class FeatureGroup(models.Model):
class Feature(models.Model):
group = models.ForeignKey(FeatureGroup, null=False, blank=False, on_delete=models.CASCADE)
featurename = models.CharField(max_length=100, null=False, blank=False)
featuredescription = models.TextField(null=False, blank=True)
featuredescription = models.TextField(null=False, blank=True, help_text="""Supports Markdown. A plain URL will link directly to that URL.""")
# WARNING! All fields that start with "v" will be considered versions!
v74 = models.IntegerField(verbose_name="7.4", null=False, blank=False, default=0, choices=choices)
v74.visible_default = False

View File

@ -1,9 +1,10 @@
{%extends "base/page.html"%}
{% load markup %}
{%block title%}Feature Description{%endblock%}
{%block contents%}
<h1>Feature Description</h1>
<h2>{{feature.featurename}}</h2>
<p>
{{feature.featuredescription}}
{{feature.featuredescription|markdown:"safe"}}
</p>
{%endblock%}