added markitup on Slot content override
This commit is contained in:
parent
19d826ad00
commit
c09f887e72
3 changed files with 6 additions and 4 deletions
|
@ -1,6 +1,8 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
|
from markitup.widgets import MarkItUpWidget
|
||||||
|
|
||||||
from symposion.schedule.models import Presentation
|
from symposion.schedule.models import Presentation
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +34,7 @@ class SlotEditForm(forms.Form):
|
||||||
def build_content_override_field(self):
|
def build_content_override_field(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
"label": "Content",
|
"label": "Content",
|
||||||
"widget": forms.Textarea(attrs={"class": "span6"}),
|
"widget": MarkItUpWidget(),
|
||||||
"required": False,
|
"required": False,
|
||||||
"initial": self.slot.content_override,
|
"initial": self.slot.content_override,
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Slot(models.Model):
|
||||||
kind = models.ForeignKey(SlotKind)
|
kind = models.ForeignKey(SlotKind)
|
||||||
start = models.TimeField()
|
start = models.TimeField()
|
||||||
end = models.TimeField()
|
end = models.TimeField()
|
||||||
content_override = models.TextField(blank=True)
|
content_override = MarkupField()
|
||||||
|
|
||||||
def assign(self, content):
|
def assign(self, content):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
<div class="speaker">{{ slot.content.speaker }}</div>
|
<div class="speaker">{{ slot.content.speaker }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if slot.content_override %}
|
{% if slot.content_override.raw %}
|
||||||
{{ slot.content_override|safe }}
|
{{ slot.content_override.rendered|safe }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ slot.kind.label }}
|
{{ slot.kind.label }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue