From c09f887e7245177793c8827730c1c07a0be902ea Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Fri, 26 Oct 2012 16:01:01 -0600 Subject: [PATCH] added markitup on Slot content override --- symposion/schedule/forms.py | 4 +++- symposion/schedule/models.py | 2 +- symposion/templates/schedule/_edit_grid.html | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/symposion/schedule/forms.py b/symposion/schedule/forms.py index 4e6dfed8..04e7b196 100644 --- a/symposion/schedule/forms.py +++ b/symposion/schedule/forms.py @@ -1,6 +1,8 @@ from django import forms from django.db.models import Q +from markitup.widgets import MarkItUpWidget + from symposion.schedule.models import Presentation @@ -32,7 +34,7 @@ class SlotEditForm(forms.Form): def build_content_override_field(self): kwargs = { "label": "Content", - "widget": forms.Textarea(attrs={"class": "span6"}), + "widget": MarkItUpWidget(), "required": False, "initial": self.slot.content_override, } diff --git a/symposion/schedule/models.py b/symposion/schedule/models.py index 657c0e8d..c01a4b7e 100644 --- a/symposion/schedule/models.py +++ b/symposion/schedule/models.py @@ -48,7 +48,7 @@ class Slot(models.Model): kind = models.ForeignKey(SlotKind) start = models.TimeField() end = models.TimeField() - content_override = models.TextField(blank=True) + content_override = MarkupField() def assign(self, content): """ diff --git a/symposion/templates/schedule/_edit_grid.html b/symposion/templates/schedule/_edit_grid.html index eb39ec7d..d59285dc 100644 --- a/symposion/templates/schedule/_edit_grid.html +++ b/symposion/templates/schedule/_edit_grid.html @@ -18,8 +18,8 @@
{{ slot.content.speaker }}
{% endif %} {% else %} - {% if slot.content_override %} - {{ slot.content_override|safe }} + {% if slot.content_override.raw %} + {{ slot.content_override.rendered|safe }} {% else %} {{ slot.kind.label }} {% endif %}