mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-21 20:51:03 +00:00
lower_thirds: always use event locale when localizing text
This commit is contained in:
parent
f618654ee0
commit
d42a2744d0
2 changed files with 13 additions and 5 deletions
|
@ -18,11 +18,11 @@
|
|||
hide itself.
|
||||
</p>
|
||||
|
||||
{% if request.event.rooms %}
|
||||
{% if localized_rooms %}
|
||||
<h3>{% trans "room list" %}</h3>
|
||||
<ul>
|
||||
{% for room in request.event.rooms.all %}
|
||||
<li><a href="{% url 'plugins:pretalx_broadcast_tools:lowerthirds' request.event.slug %}#{{ room.name }}">{{ room.name }}</a></li>
|
||||
{% for room in localized_rooms %}
|
||||
<li><a href="{% url 'plugins:pretalx_broadcast_tools:lowerthirds' request.event.slug %}#{{ room }}">{{ room }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
|
|
@ -24,6 +24,14 @@ class BroadcastToolsOrgaView(PermissionRequired, FormView):
|
|||
def get_success_url(self):
|
||||
return self.request.path
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['localized_rooms'] = [
|
||||
room.name.localize(self.request.event.locale)
|
||||
for room in self.request.event.rooms.all()
|
||||
]
|
||||
return context
|
||||
|
||||
def form_valid(self, form):
|
||||
form.save()
|
||||
return super().form_valid(form)
|
||||
|
@ -73,7 +81,7 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, Templat
|
|||
{
|
||||
"rooms": sorted(
|
||||
{
|
||||
str(room["name"])
|
||||
room["name"].localize(schedule.event.locale)
|
||||
for day in schedule.data
|
||||
for room in day["rooms"]
|
||||
}
|
||||
|
@ -99,7 +107,7 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, Templat
|
|||
}
|
||||
if talk.submission.track
|
||||
else None,
|
||||
"room": str(room["name"]),
|
||||
"room": room["name"].localize(schedule.event.locale),
|
||||
"infoline": infoline.format(**placeholders(schedule, talk)),
|
||||
}
|
||||
for day in schedule.data
|
||||
|
|
Loading…
Reference in a new issue