Mercurial > public > sg101
changeset 1000:abd4c02aefdb
News V2.0 WIP template tweaks.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 24 Nov 2015 22:55:18 -0600 |
parents | 8386a8ebcbc7 |
children | c6c3ba5cf6eb |
files | news/models.py sg101/templates/news/story.html sg101/templates/news/story_summary.html |
diffstat | 3 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/news/models.py Sat Nov 21 14:53:29 2015 -0600 +++ b/news/models.py Tue Nov 24 22:55:18 2015 -0600 @@ -60,13 +60,14 @@ else: self.update_date = datetime.datetime.now() - self.short_text = kwargs.pop('short_text', '') - if not self.short_text and self.short_markup: - self.short_text = site_markup(self.short_markup) + if self.version >= 2: + self.short_text = kwargs.pop('short_text', '') + if not self.short_text and self.short_markup: + self.short_text = site_markup(self.short_markup) - self.long_text = kwargs.pop('long_text', '') - if not self.long_text and self.long_markup: - self.long_text = site_markup(self.long_markup) + self.long_text = kwargs.pop('long_text', '') + if not self.long_text and self.long_markup: + self.long_text = site_markup(self.long_markup) super(StoryBase, self).save(*args, **kwargs)
--- a/sg101/templates/news/story.html Sat Nov 21 14:53:29 2015 -0600 +++ b/sg101/templates/news/story.html Tue Nov 24 22:55:18 2015 -0600 @@ -30,6 +30,7 @@ class="news-icon" /></a> {{ story.short_text|safe }} {{ story.long_text|safe }} + {{ story.admin_content|safe }} <br clear="all" /> <hr /> <p>
--- a/sg101/templates/news/story_summary.html Sat Nov 21 14:53:29 2015 -0600 +++ b/sg101/templates/news/story_summary.html Tue Nov 24 22:55:18 2015 -0600 @@ -17,6 +17,9 @@ <div class="news-content"> {{ story.short_text|safe }} </div> +{% if story.admin_content %} + {{ story.admin_content|safe }} +{% endif %} {% if story.long_text %} <p> <img src="{{ STATIC_URL }}icons/bullet_go.png" alt="Read More" />