2023-02-28 09:17:50 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
2023-02-28 09:32:38 +00:00
|
|
|
|
2024-11-03 11:56:24 +00:00
|
|
|
def placeholders(event, talk, supports_html_colour=False):
|
2023-10-10 14:00:24 +00:00
|
|
|
track_name = str(talk.submission.track.name) if talk.submission.track else ""
|
|
|
|
|
|
|
|
result = {
|
2023-02-28 09:17:50 +00:00
|
|
|
"CODE": talk.submission.code,
|
2024-11-03 11:56:24 +00:00
|
|
|
"EVENT_SLUG": str(event.slug),
|
2023-02-28 09:17:50 +00:00
|
|
|
"FEEDBACK_URL": "{}{}".format(
|
2024-11-03 11:56:24 +00:00
|
|
|
event.custom_domain or settings.SITE_URL,
|
2023-02-28 09:17:50 +00:00
|
|
|
talk.submission.urls.feedback,
|
|
|
|
),
|
2022-11-15 12:43:17 +00:00
|
|
|
"TALK_SLUG": talk.frab_slug,
|
2023-02-28 09:17:50 +00:00
|
|
|
"TALK_URL": "{}{}".format(
|
2024-11-03 11:56:24 +00:00
|
|
|
event.custom_domain or settings.SITE_URL,
|
2023-02-28 09:17:50 +00:00
|
|
|
talk.submission.urls.public,
|
|
|
|
),
|
2023-10-10 14:00:24 +00:00
|
|
|
"TRACK_NAME": track_name,
|
2022-11-15 12:43:17 +00:00
|
|
|
}
|
2023-10-10 14:00:24 +00:00
|
|
|
|
|
|
|
if talk.submission.track and supports_html_colour:
|
|
|
|
result["TRACK_NAME_COLOURED"] = '<span style="color: {}">{}</span>'.format(
|
|
|
|
talk.submission.track.color, track_name
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
result["TRACK_NAME_COLOURED"] = track_name
|
|
|
|
|
|
|
|
# for the americans
|
|
|
|
result["TRACK_NAME_COLORED"] = result["TRACK_NAME_COLOURED"]
|
|
|
|
|
|
|
|
return result
|