Skip to content
Snippets Groups Projects
Commit ca71e995 authored by Julian Rother's avatar Julian Rother
Browse files

Added stream_settings field

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