Added markdown support to descriptions

This commit is contained in:
Tris Forster 2020-10-05 15:22:13 +11:00
parent f379dc9cc4
commit dc7d3a1134
4 changed files with 20 additions and 5 deletions

View File

@ -1,9 +1,11 @@
{% extends "interface/project_base.html" %}
{% load md2 %}
{% block page %}
<div class="narrow">
<h3 class="text-center">Due in {{ project.deadline|timeuntil }}!</h3>
<p>{{ project.description }}</p>
<p>{{ project.description|markdown }}</p>
{% if project.owner %}
<p>Project email: <a href="mailto:{{ project.owner }}">{{ project.owner }}</a></p>
{% endif %}

View File

@ -1,4 +1,5 @@
{% extends "interface/project_base.html" %}
{% load md2 %}
{% block admin %}
<a href="{% url 'resource_create' project=project.pk %}"><i class="fas fa-plus-circle"></i> Add new</a>
@ -30,7 +31,7 @@
{% endif %}
</h3>
<p>
<small>{{ resource.description }}</small>
<small>{{ resource.description|markdown }}</small>
{% if not resource.visible %}
<br/>(This resource is hidden from participants)
{% endif %}
@ -43,4 +44,4 @@
{% endfor %}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_markdown2',
'interface',
]
@ -121,4 +122,4 @@ USE_TZ = True
STATIC_URL = '/static/'
# Need to set this
AWS_BUCKET = ''
AWS_BUCKET = ''

View File

@ -1,2 +1,13 @@
asgiref==3.2.10
boto3==1.15.11
botocore==1.18.11
Django==3.1.1
markdown2==2.3.9
django-markdown2==0.3.1
jmespath==0.10.0
markdown2==2.3.9
python-dateutil==2.8.1
pytz==2020.1
s3transfer==0.3.3
six==1.15.0
sqlparse==0.3.1
urllib3==1.25.10