From fe5308505d64c00691cdb4b1148d894ded81ab45 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Wed, 11 Apr 2018 13:46:40 +0200 Subject: [PATCH] Config variable for hiding internal items on projector --- CHANGELOG | 2 ++ openslides/agenda/config_variables.py | 9 +++++++++ openslides/agenda/static/js/agenda/projector.js | 15 ++++++++++++--- openslides/agenda/static/js/agenda/site.js | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c74dfd0ee..02f5dd975 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,8 @@ Agenda: - Hide closed agenda items in the item slide [#3567]. - Agenda is now collapsable for a better overview [#3567]. - Autoupdates for all children if the item type has changed [#3659]. +- Added config variable to hide internal items when projecting + subitems [#3701]. Motions: - New export dialog [#3185]. diff --git a/openslides/agenda/config_variables.py b/openslides/agenda/config_variables.py index 55b6a439d..413b17cf8 100644 --- a/openslides/agenda/config_variables.py +++ b/openslides/agenda/config_variables.py @@ -41,6 +41,15 @@ def get_config_variables(): group='Agenda', 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 yield ConfigVariable( diff --git a/openslides/agenda/static/js/agenda/projector.js b/openslides/agenda/static/js/agenda/projector.js index 39ea38db7..a63ac64c1 100644 --- a/openslides/agenda/static/js/agenda/projector.js +++ b/openslides/agenda/static/js/agenda/projector.js @@ -71,7 +71,8 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda']) '$filter', 'Agenda', '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. // Add it to the coresponding get_requirements method of the ProjectorElement // class. @@ -79,10 +80,18 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda']) // Bind agenda tree to the scope var items; $scope.$watch(function () { - return Agenda.lastModified(); + return Agenda.lastModified() + + Config.lastModified('agenda_hide_internal_items_on_projector'); }, function () { 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) { if (node.id == $scope.element.id) { diff --git a/openslides/agenda/static/js/agenda/site.js b/openslides/agenda/static/js/agenda/site.js index 0c2ccdb35..1f0152f83 100644 --- a/openslides/agenda/static/js/agenda/site.js +++ b/openslides/agenda/static/js/agenda/site.js @@ -778,6 +778,7 @@ angular.module('OpenSlidesApp.agenda.site', [ gettext('Roman'); gettext('Begin of event'); 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('List of speakers'); gettext('Show orange countdown in the last x seconds of speaking time');