1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-12-05 02:32:42 +00:00
pretalx-plugin-broadcast-tools/pretalx_broadcast_tools/views/event_info.py

34 lines
1.4 KiB
Python

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 "",
"show_next_talk": (
True
if self.request.event.settings.broadcast_tools_room_info_show_next_talk
else False
),
},
"rooms": {
str(room.uuid): room.name.localize(self.request.event.locale)
for room in self.request.event.rooms.all()
},
"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,
},
)