2023-02-28 09:17:50 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
2023-02-28 09:32:38 +00:00
|
|
|
|
2023-10-10 14:00:24 +00:00
|
|
|
def placeholders(schedule, talk, supports_html_colour=False):
|
|
|
|
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,
|
2022-11-15 12:43:17 +00:00
|
|
|
"EVENT_SLUG": str(schedule.event.slug),
|
2023-02-28 09:17:50 +00:00
|
|
|
"FEEDBACK_URL": "{}{}".format(
|
|
|
|
schedule.event.custom_domain or settings.SITE_URL,
|
|
|
|
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(
|
|
|
|
schedule.event.custom_domain or settings.SITE_URL,
|
|
|
|
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
|