diff --git a/RIGS/templates/RIGS/event_detail.html b/RIGS/templates/RIGS/event_detail.html index 358eaf10..e819a117 100644 --- a/RIGS/templates/RIGS/event_detail.html +++ b/RIGS/templates/RIGS/event_detail.html @@ -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 @@
 
Event Description
-
{{ event.description|linebreaksbr }}
+
{{ event.description|markdown }}
 
@@ -205,7 +206,7 @@

Notes

- {{ event.notes|linebreaksbr }} + {{ event.notes|markdown }}
{% include 'RIGS/item_table.html' %}
diff --git a/RIGS/templates/RIGS/event_table.html b/RIGS/templates/RIGS/event_table.html index 1868f2dd..a22ea449 100644 --- a/RIGS/templates/RIGS/event_table.html +++ b/RIGS/templates/RIGS/event_table.html @@ -1,3 +1,5 @@ +{% load markdown_tags %} +
@@ -51,7 +53,7 @@ {% endif %} {% if not event.cancelled and event.description %}
- {{ event.description|linebreaksbr }} + {{ event.description|markdown }}
{% endif %} @@ -99,4 +101,4 @@ {% endfor %}
-
\ No newline at end of file + diff --git a/RIGS/templates/RIGS/item_row.html b/RIGS/templates/RIGS/item_row.html index 656d9812..c30ca026 100644 --- a/RIGS/templates/RIGS/item_row.html +++ b/RIGS/templates/RIGS/item_row.html @@ -1,9 +1,10 @@ +{% load markdown_tags %} {{ item.name }}
- {{item.description|linebreaksbr}} + {{item.description|markdown}}
£ {{item.cost|floatformat:2}} diff --git a/RIGS/templates/RIGS/organisation_detail.html b/RIGS/templates/RIGS/organisation_detail.html index 7743086c..451e9331 100644 --- a/RIGS/templates/RIGS/organisation_detail.html +++ b/RIGS/templates/RIGS/organisation_detail.html @@ -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 @@
{{ object.address|linebreaksbr }}
Notes
-
{{ object.notes|linebreaksbr }}
+
{{ object.notes|markdown }}
Union Account
{{ object.union_account|yesno|capfirst }}
@@ -108,4 +109,4 @@ {% endblock %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/RIGS/templates/RIGS/person_detail.html b/RIGS/templates/RIGS/person_detail.html index 10c995ae..bb11e742 100644 --- a/RIGS/templates/RIGS/person_detail.html +++ b/RIGS/templates/RIGS/person_detail.html @@ -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 @@
{{ object.address|linebreaksbr }}
Notes
-
{{ object.notes|linebreaksbr }}
+
{{ object.notes|markdown }}
@@ -105,4 +106,4 @@ {% endblock %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/RIGS/templates/RIGS/venue_detail.html b/RIGS/templates/RIGS/venue_detail.html index ede9d4ec..382e4c8d 100644 --- a/RIGS/templates/RIGS/venue_detail.html +++ b/RIGS/templates/RIGS/venue_detail.html @@ -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 @@
{{ object.address|linebreaksbr }}
Notes
-
{{ object.notes|linebreaksbr }}
+
{{ object.notes|markdown }}
Three Phase Available
{{ object.three_phase_available|yesno|capfirst }}
@@ -95,4 +96,4 @@ {% endblock %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/RIGS/templatetags/markdown_tags.py b/RIGS/templatetags/markdown_tags.py new file mode 100644 index 00000000..d40eb895 --- /dev/null +++ b/RIGS/templatetags/markdown_tags.py @@ -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)) diff --git a/db.sqlite3 b/db.sqlite3 index d0e8fed8..5142bf96 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/requirements.txt b/requirements.txt index 1f32e3dc..00d423e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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