From 706543e8e39ddf7d4f3f143d7efb6df06d5242a3 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 12 Dec 2011 16:00:17 +0100 Subject: [PATCH] Make events.summary a markdown field 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 | 6 +++--- templates/events/archive.html | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pgweb/events/models.py b/pgweb/events/models.py index adbc5684..2f788b4d 100644 --- a/pgweb/events/models.py +++ b/pgweb/events/models.py @@ -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 diff --git a/templates/events/archive.html b/templates/events/archive.html index 2bb393e4..96873f60 100644 --- a/templates/events/archive.html +++ b/templates/events/archive.html @@ -1,4 +1,5 @@ {%extends "base/page.html"%} +{%load markup%} {%block title%}Event archive{%endblock%} {%block contents%} @@ -14,7 +15,7 @@ whatsoever.
Date: {{event.displaydate|safe}}
Location: {{event.locationstring}}

-{{event.summary}} +{{event.summary|markdown:"safe"}}

{%endfor%} {%endfor%} -- 2.39.5