mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Add basic markdown support site wide
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||
{% load markdown_tags %}
|
||||
{% block title %}{% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %} | {{object.name}}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
@@ -141,7 +142,7 @@
|
||||
<dd> </dd>
|
||||
|
||||
<dt>Event Description</dt>
|
||||
<dd>{{ event.description|linebreaksbr }}</dd>
|
||||
<dd>{{ event.description|markdown }}</dd>
|
||||
|
||||
<dd> </dd>
|
||||
|
||||
@@ -205,7 +206,7 @@
|
||||
<div class="panel-body">
|
||||
<div class="well well-sm">
|
||||
<h4>Notes</h4>
|
||||
{{ event.notes|linebreaksbr }}
|
||||
{{ event.notes|markdown }}
|
||||
</div>
|
||||
{% include 'RIGS/item_table.html' %}
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{% load markdown_tags %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
@@ -51,7 +53,7 @@
|
||||
{% endif %}
|
||||
{% if not event.cancelled and event.description %}
|
||||
<div>
|
||||
{{ event.description|linebreaksbr }}
|
||||
{{ event.description|markdown }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
@@ -99,4 +101,4 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{% load markdown_tags %}
|
||||
|
||||
<tr id="item-{{item.pk}}" data-pk="{{item.pk}}" class="item_row">
|
||||
<td>
|
||||
<span class="name">{{ item.name }}</span>
|
||||
<div class="item-description">
|
||||
<em class="description">{{item.description|linebreaksbr}}</em>
|
||||
<em class="description">{{item.description|markdown}}</em>
|
||||
</div>
|
||||
</td>
|
||||
<td>£ <span class="cost">{{item.cost|floatformat:2}}</span></td>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||
{% load widget_tweaks %}
|
||||
{% load markdown_tags %}
|
||||
|
||||
{% block title %}Organisation | {{ object.name }}{% endblock %}
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
<dd>{{ object.notes|markdown }}</dd>
|
||||
|
||||
<dt>Union Account</dt>
|
||||
<dd>{{ object.union_account|yesno|capfirst }}</dd>
|
||||
@@ -108,4 +109,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||
{% load widget_tweaks %}
|
||||
{% load markdown_tags %}
|
||||
|
||||
{% block title %}Person | {{ object.name }}{% endblock %}
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
<dd>{{ object.notes|markdown }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,4 +106,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||
{% load widget_tweaks %}
|
||||
{% load markdown_tags %}
|
||||
|
||||
{% block title %}Venue | {{ object.name }}{% endblock %}
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
<dd>{{ object.address|linebreaksbr }}</dd>
|
||||
|
||||
<dt>Notes</dt>
|
||||
<dd>{{ object.notes|linebreaksbr }}</dd>
|
||||
<dd>{{ object.notes|markdown }}</dd>
|
||||
|
||||
<dt>Three Phase Available</dt>
|
||||
<dd>{{ object.three_phase_available|yesno|capfirst }}</dd>
|
||||
@@ -95,4 +96,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
11
RIGS/templatetags/markdown_tags.py
Normal file
11
RIGS/templatetags/markdown_tags.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django import template
|
||||
from django.utils.safestring import mark_safe
|
||||
import markdown
|
||||
|
||||
__author__ = 'ghost'
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.filter(name="markdown")
|
||||
def markdown_filter(text):
|
||||
return mark_safe(markdown.markdown(text))
|
||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
@@ -11,6 +11,7 @@ django-widget-tweaks==1.3
|
||||
gunicorn==19.3.0
|
||||
icalendar==3.9.0
|
||||
lxml==3.4.4
|
||||
Markdown==2.6.5
|
||||
Pillow==2.8.1
|
||||
psycopg2==2.6
|
||||
Pygments==2.0.2
|
||||
|
||||
Reference in New Issue
Block a user