1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-11-15 04:45:50 +00:00
pretalx-plugin-broadcast-tools/pretalx_broadcast_tools/views/event_info.py

35 lines
1.4 KiB
Python
Raw Normal View History

2023-09-30 10:39:30 +00:00
from django.http import JsonResponse
from django.views import View
class BroadcastToolsEventInfoView(View):
def get(self, request, *args, **kwargs):
color = self.request.event.primary_color or "#3aa57c"
return JsonResponse(
{
"color": color,
"name": self.request.event.name.localize(self.request.event.locale),
"no_talk": str(
self.request.event.settings.broadcast_tools_lower_thirds_no_talk_info
),
"room-info": {
"lower_info": self.request.event.settings.broadcast_tools_room_info_lower_content
or "",
2024-03-16 10:37:26 +00:00
"show_next_talk": (
True
if self.request.event.settings.broadcast_tools_room_info_show_next_talk
else False
),
2023-09-30 10:39:30 +00:00
},
2024-10-31 20:46:55 +00:00
"rooms": {
str(room.uuid): room.name.localize(self.request.event.locale)
for room in self.request.event.rooms.all()
},
2023-09-30 10:39:30 +00:00
"slug": self.request.event.slug,
"start": self.request.event.date_from.isoformat(),
"end": self.request.event.date_to.isoformat(),
"timezone": str(self.request.event.tz),
"locale": self.request.event.locale,
},
)