Config variable for hiding internal items on projector

This commit is contained in:
FinnStutzenstein 2018-04-11 13:46:40 +02:00
parent 2497969864
commit fe5308505d
4 changed files with 24 additions and 3 deletions

View File

@ -18,6 +18,8 @@ Agenda:
- Hide closed agenda items in the item slide [#3567]. - Hide closed agenda items in the item slide [#3567].
- Agenda is now collapsable for a better overview [#3567]. - Agenda is now collapsable for a better overview [#3567].
- Autoupdates for all children if the item type has changed [#3659]. - Autoupdates for all children if the item type has changed [#3659].
- Added config variable to hide internal items when projecting
subitems [#3701].
Motions: Motions:
- New export dialog [#3185]. - New export dialog [#3185].

View File

@ -41,6 +41,15 @@ def get_config_variables():
group='Agenda', group='Agenda',
subgroup='General') subgroup='General')
yield ConfigVariable(
name='agenda_hide_internal_items_on_projector',
default_value=True,
input_type='boolean',
label='Hide internal items when projecting subitems',
weight=225,
group='Agenda',
subgroup='General')
# List of speakers # List of speakers
yield ConfigVariable( yield ConfigVariable(

View File

@ -71,7 +71,8 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda'])
'$filter', '$filter',
'Agenda', 'Agenda',
'AgendaTree', 'AgendaTree',
function ($scope, $http, $filter, Agenda, AgendaTree) { 'Config',
function ($scope, $http, $filter, Agenda, AgendaTree, Config) {
// Attention! Each object that is used here has to be dealt on server side. // Attention! Each object that is used here has to be dealt on server side.
// Add it to the coresponding get_requirements method of the ProjectorElement // Add it to the coresponding get_requirements method of the ProjectorElement
// class. // class.
@ -79,10 +80,18 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda'])
// Bind agenda tree to the scope // Bind agenda tree to the scope
var items; var items;
$scope.$watch(function () { $scope.$watch(function () {
return Agenda.lastModified(); return Agenda.lastModified() +
Config.lastModified('agenda_hide_internal_items_on_projector');
}, function () { }, function () {
if ($scope.element.id) { if ($scope.element.id) {
var tree = AgendaTree.getTree(Agenda.getAll()); if (Config.get('agenda_hide_internal_items_on_projector').value) {
items = _.filter(Agenda.getAll(), function (item) {
return item.type === 1;
});
} else {
items = Agenda.getAll();
}
var tree = AgendaTree.getTree(items);
var getRootNode = function (node) { var getRootNode = function (node) {
if (node.id == $scope.element.id) { if (node.id == $scope.element.id) {

View File

@ -778,6 +778,7 @@ angular.module('OpenSlidesApp.agenda.site', [
gettext('Roman'); gettext('Roman');
gettext('Begin of event'); gettext('Begin of event');
gettext('Input format: DD.MM.YYYY HH:MM'); gettext('Input format: DD.MM.YYYY HH:MM');
gettext('Hide internal items when projecting subitems');
gettext('Number of last speakers to be shown on the projector'); gettext('Number of last speakers to be shown on the projector');
gettext('List of speakers'); gettext('List of speakers');
gettext('Show orange countdown in the last x seconds of speaking time'); gettext('Show orange countdown in the last x seconds of speaking time');