Commit 675df57a authored by fred's avatar fred

add "view online" support to combo pages

parent 2c74ecd6
...@@ -3,6 +3,7 @@ from django.conf import settings ...@@ -3,6 +3,7 @@ from django.conf import settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from emissions.models import Emission, Episode, NewsItem, SoundFile, Focus from emissions.models import Emission, Episode, NewsItem, SoundFile, Focus
from combo.data.models import Page
register = Library() register = Library()
...@@ -16,6 +17,8 @@ def online_url(object): ...@@ -16,6 +17,8 @@ def online_url(object):
return settings.WEBSITE_BASE_URL + 'emissions/' + object.emission.slug + '/' + object.slug + '/' return settings.WEBSITE_BASE_URL + 'emissions/' + object.emission.slug + '/' + object.slug + '/'
if isinstance(object, SoundFile): if isinstance(object, SoundFile):
return settings.WEBSITE_BASE_URL + 'emissions/' + object.episode.emission.slug + '/' + object.episode.slug return settings.WEBSITE_BASE_URL + 'emissions/' + object.episode.emission.slug + '/' + object.episode.slug
if isinstance(object, Page):
return settings.WEBSITE_BASE_URL + object.get_online_url().strip('/')
return '' return ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment