1 from django import template
3 register = template.Library()
6 @register.inclusion_tag('archive/tags/multiple_tags_table.html')
7 def multiple_tags_table(tags, table=True):
10 for k, v in tags.items():
11 if isinstance(v, list):
15 return {"tags": new_tags, "table": table}
18 @register.inclusion_tag('archive/tags/tags_table.html')
19 def tags_table(tags, table=True):
25 @register.inclusion_tag("archive/status.html")
26 def status(audiobook, format):
27 if format == "youtube" and audiobook.youtube_id:
28 link = f"https://youtu.be/{audiobook.youtube_id}"
32 "published": getattr(audiobook, f"{format}_published"),
33 "status": getattr(audiobook, f"get_{format}_status_display")(),