mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-15 02:05:48 +00:00
move room detection to room uuid
This commit is contained in:
parent
6a3b1b309e
commit
dfa0945632
4 changed files with 24 additions and 28 deletions
|
@ -61,14 +61,16 @@ function get_next_talk() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_room_name() {
|
function get_room_name() {
|
||||||
room_name = null;
|
|
||||||
try {
|
try {
|
||||||
hash = decodeURIComponent(window.location.hash.substring(1));
|
hash = decodeURIComponent(window.location.hash.substring(1));
|
||||||
room_name = hash;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
return room_name;
|
if (event_info && event_info["rooms"].hasOwnProperty(hash)) {
|
||||||
|
return event_info["rooms"][hash];
|
||||||
|
}
|
||||||
|
// XXX remove fallback when releasing 3.0.0
|
||||||
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
function format_time_from_pretalx(from_pretalx) {
|
function format_time_from_pretalx(from_pretalx) {
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
<h2>{% translate "broadcasting tools" %}</h2>
|
<h2>{% translate "broadcasting tools" %}</h2>
|
||||||
|
|
||||||
{% if localized_rooms %}
|
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -16,16 +15,15 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for room in localized_rooms %}
|
{% for room in request.event.rooms.all %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ room }}</th>
|
<th scope="row">{{ room.name }}</th>
|
||||||
<td><a href="{% url 'plugins:pretalx_broadcast_tools:lowerthirds' request.event.slug %}#{{ room }}">{% translate "Lower Thirds" %}</a></td>
|
<td><a href="{% url 'plugins:pretalx_broadcast_tools:lowerthirds' request.event.slug %}#{{ room.uuid }}">{% translate "Lower Thirds" %}</a></td>
|
||||||
<td><a href="{% url 'plugins:pretalx_broadcast_tools:room_info' request.event.slug %}#{{ room }}">{% translate "Room Info" %}</a></td>
|
<td><a href="{% url 'plugins:pretalx_broadcast_tools:room_info' request.event.slug %}#{{ room.uuid }}">{% translate "Room Info" %}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h2>{% translate "Placeholders" %}</h2>
|
<h2>{% translate "Placeholders" %}</h2>
|
||||||
<p>{% translate "pretalx will automatically replace some placeholders in your custom content:" %}</p>
|
<p>{% translate "pretalx will automatically replace some placeholders in your custom content:" %}</p>
|
||||||
|
|
|
@ -21,6 +21,10 @@ class BroadcastToolsEventInfoView(View):
|
||||||
else False
|
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,
|
"slug": self.request.event.slug,
|
||||||
"start": self.request.event.date_from.isoformat(),
|
"start": self.request.event.date_from.isoformat(),
|
||||||
"end": self.request.event.date_to.isoformat(),
|
"end": self.request.event.date_to.isoformat(),
|
||||||
|
|
|
@ -12,14 +12,6 @@ class BroadcastToolsOrgaView(PermissionRequired, FormView):
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return self.request.path
|
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):
|
def form_valid(self, form):
|
||||||
form.save()
|
form.save()
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
Loading…
Reference in a new issue