Make events.summary a markdown field
authorMagnus Hagander <magnus@hagander.net>
Mon, 12 Dec 2011 15:00:17 +0000 (16:00 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 12 Dec 2011 15:00:17 +0000 (16:00 +0100)
In passing, add help messages to make it more obvious which of the
summary and details fields are used on which pages.

pgweb/events/models.py
templates/events/archive.html

index adbc5684cb31afca2f594fa48ceed74cc96a9d12..2f788b4deb0a77167db65fd9ae3b371c93ac0f76 100644 (file)
@@ -18,11 +18,11 @@ class Event(PgModel, models.Model):
        startdate = models.DateField(null=False, blank=False)
        enddate = models.DateField(null=False, blank=False)
        
-       summary = models.TextField(blank=False, null=False)
-       details = models.TextField(blank=False, null=False)
+       summary = models.TextField(blank=False, null=False, help_text="A short introduction (shown on the events listing page)")
+       details = models.TextField(blank=False, null=False, help_text="Complete event description")
        
        send_notification = True
-       markdown_fields = ('details', )
+       markdown_fields = ('details', 'summary', )
        
        def purge_urls(self):
                yield '/about/event/%s/' % self.pk
index 2bb393e44b8b59d0f1005d49b9c36c8aaaa3bdda..96873f60f28112a2a2c412c40267604c1c213ca1 100644 (file)
@@ -1,4 +1,5 @@
 {%extends "base/page.html"%}
+{%load markup%}
 {%block title%}Event archive{%endblock%}
 {%block contents%}
 
@@ -14,7 +15,7 @@ whatsoever.</i>
 <div>Date: <b>{{event.displaydate|safe}}</b></div>
 <div>Location: <b>{{event.locationstring}}</b></div>
 <p>
-{{event.summary}}
+{{event.summary|markdown:"safe"}}
 </p>
 {%endfor%}
 {%endfor%}