diff --git a/openslides/agenda/projector.py b/openslides/agenda/projector.py index dd5d20aa6..5227a08b4 100644 --- a/openslides/agenda/projector.py +++ b/openslides/agenda/projector.py @@ -35,7 +35,7 @@ class ItemListSlide(ProjectorElement): def get_requirements(self, config_entry): pk = config_entry.get('id', 'tree') - if pk is None or self.config_entry.get('tree', False): + if pk is None or config_entry.get('tree', False): # Root list slide or slide with tree. yield ProjectorRequirement( view_class=ItemViewSet, @@ -57,7 +57,7 @@ class ItemDetailSlide(ProjectorElement): To activate a detail slide as list of speakers slide, set 'id' and set 'list_of_speakers' true. """ - name = 'agenda/item-detail' + name = 'agenda/item' def get_context(self): pk = self.config_entry.get('id') diff --git a/openslides/agenda/static/js/agenda/agenda.js b/openslides/agenda/static/js/agenda/agenda.js index 05e9f7c12..9308e3444 100644 --- a/openslides/agenda/static/js/agenda/agenda.js +++ b/openslides/agenda/static/js/agenda/agenda.js @@ -124,7 +124,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda']) // project agenda $scope.projectAgenda = function () { $http.post('/rest/core/projector/1/prune_elements/', - [{name: 'agenda/agenda'}]); + [{name: 'agenda/item-list'}]); }; // check if agenda is projected $scope.isAgendaProjected = function () { @@ -134,7 +134,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda']) if (typeof projector === 'undefined') return false; var self = this; return _.findIndex(projector.elements, function(element) { - return element.name == 'agenda/agenda' + return element.name == 'agenda/item-list' }) > -1; }; @@ -265,14 +265,14 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda']) .config(function(slidesProvider) { slidesProvider.registerSlide('agenda/item', { - template: 'static/templates/agenda/slide_item.html', + template: 'static/templates/agenda/slide-item-detail.html', }); - slidesProvider.registerSlide('agenda/agenda', { - template: 'static/templates/agenda/slide_agenda.html', + slidesProvider.registerSlide('agenda/item-list', { + template: 'static/templates/agenda/slide-item-list.html', }); }) -.controller('SlideItemCtrl', function($scope, Agenda) { +.controller('SlideItemDetailCtrl', function($scope, Agenda) { // 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. @@ -281,7 +281,7 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda']) Agenda.bindOne(id, $scope, 'item'); }) -.controller('SlideAgendaCtrl', function($scope, $http, Agenda) { +.controller('SlideItemListCtrl', function($scope, $http, Agenda) { // 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. diff --git a/openslides/agenda/static/templates/agenda/slide_item.html b/openslides/agenda/static/templates/agenda/slide-item-detail.html similarity index 61% rename from openslides/agenda/static/templates/agenda/slide_item.html rename to openslides/agenda/static/templates/agenda/slide-item-detail.html index e88453002..e589e7086 100644 --- a/openslides/agenda/static/templates/agenda/slide_item.html +++ b/openslides/agenda/static/templates/agenda/slide-item-detail.html @@ -1,4 +1,4 @@ -
+

{{ item.title }}

{{ item.text }}
diff --git a/openslides/agenda/static/templates/agenda/slide_agenda.html b/openslides/agenda/static/templates/agenda/slide-item-list.html similarity index 87% rename from openslides/agenda/static/templates/agenda/slide_agenda.html rename to openslides/agenda/static/templates/agenda/slide-item-list.html index 8f6561703..040d206f6 100644 --- a/openslides/agenda/static/templates/agenda/slide_agenda.html +++ b/openslides/agenda/static/templates/agenda/slide-item-list.html @@ -1,4 +1,4 @@ -
+

Agenda

diff --git a/openslides/core/static/js/core.js b/openslides/core/static/js/core.js index 39e8c0362..6b74a5291 100644 --- a/openslides/core/static/js/core.js +++ b/openslides/core/static/js/core.js @@ -98,6 +98,7 @@ angular.module('OpenSlidesApp.core', []) var self = this; return _.findIndex(projector.elements, function(element) { return element.name == self.getResourceName() && + typeof(element.context) !== 'undefined' && typeof(element.context.id) !== 'undefined' && element.context.id == self.id; }) > -1; @@ -615,7 +616,11 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core']) }, function () { $scope.elements = []; _.forEach(slides.getElements(Projector.get(1)), function(element) { - $scope.elements.push(element); + if (!element.error) { + $scope.elements.push(element); + } else { + console.error("Error for slide " + element.name + ": " + element.error) + } }); }); });