Commit ca71e995 authored by Julian Rother's avatar Julian Rother

Added stream_settings field

parent cebdf37a
......@@ -107,7 +107,8 @@ CREATE TABLE IF NOT EXISTS `lectures_data` (
`titlefile` varchar(255) NOT NULL DEFAULT '',
`live` INTEGER NOT NULL DEFAULT 0,
`norecording` INTEGER NOT NULL DEFAULT 0,
`profile` varchar(64)
`profile` varchar(64),
`stream_settings` text NOT NULL DEFAULT ''
);
CREATE TABLE IF NOT EXISTS `places` (
`place` varchar(20) NOT NULL PRIMARY KEY,
......
......@@ -45,7 +45,9 @@ editable_tables = {
'jumplist': {'type': ''},
'deleted': {'type': 'boolean'},
'live': {'type': 'boolean', 'description': 'Ist ein Livestream geplant? Muss gesetzt sein damit der RTMP Stream zugeordnet wird.'},
'norecording': {'type': 'boolean', 'description:': 'Führt dazu, dass der Termin ausgegraut wird.'}},
'norecording': {'type': 'boolean', 'description:': 'Führt dazu, dass der Termin ausgegraut wird.'},
'stream_settings': {'type': 'text'}
},
'creationtime_fields': ['course_id', 'time_created', 'time_updated'] },
'videos': {
'table': 'videos_data',
......
......@@ -223,10 +223,9 @@ function editstream_dump() {
$("#editstream select[name!='']").each(function () {
res[$(this).attr('name')] = $(this).val();
});
return JSON.stringify(res);
return res;
};
function editstream_load(data) {
var obj = JSON.parse(data);
function editstream_load(obj) {
$("#editstream input:checkbox[name!='']").each(function () {
if ($(this).attr('name') in obj)
$(this).prop('checked', obj[$(this).attr('name')]);
......@@ -238,13 +237,18 @@ function editstream_load(data) {
};
$('#editstream .source-select').on('change', editstream_update);
$('#editstream-submit').on('click', function () {
var tmp = editstream_dump();
console.log(tmp);
moderator.api.set($('#editstream').data('currentpath'), JSON.stringify(editstream_dump()), true);
$('#editstream').modal('hide');
});
$('#editstream').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
$('#editstream').data('currentpath', button.data('path'));
$("#editstream-form")[0].reset();
console.log(editstream_dump());
editstream_load(tmp);
console.log(editstream_dump());
if (button.data('value'))
editstream_load(button.data('value'));
editstream_update();
});
$('#responsible-select').multiselect({enableCaseInsensitiveFiltering: true,
maxHeight: 200, numberDisplayed: 5, nonSelectedText: 'Niemand',
nSelectedText: 'ausgewählt', allSelectedText: false,
......
......@@ -262,7 +262,7 @@ $('#embedcodebtn').popover(
</li>
{% if ismod() %}
<li class="pull-right">
<button class="btn btn-default" data-toggle="modal" data-target="#editstream">
<button class="btn btn-default" data-toggle="modal" data-target="#editstream" data-path="{{ 'lectures.%i.stream_settings'%lecture.id }}" data-value='{{ lecture.stream_settings|e }}'>
<span class="glyphicon glyphicon-transfer"></span>
</button>
</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment