- player bug in admin fix

- player rendering issue fix
- station.streams property
- glitch in template rendering when page parent is not published
This commit is contained in:
bkfox
2022-12-16 14:53:11 +01:00
parent 8bd11f363b
commit 246eba6654
9 changed files with 40 additions and 19 deletions

View File

@ -53,6 +53,16 @@ def do_json(obj, fields=""):
return json.dumps(obj)
@register.simple_tag(name='player_live_attr', takes_context=True)
def do_player_live_attr(context):
""" Player 'live-args' attribute value """
station = getattr(context['request'], 'station', None)
return json.dumps({
'url': reverse('api:live'),
'src': station and station.audio_streams.split('\n')
})
@register.simple_tag(name='nav_items', takes_context=True)
def do_nav_items(context, menu, **kwargs):
""" Render navigation items for the provided menu name. """