Merge pull request #1767 from normanjaeckel/ItemDetailSlide

Removed item detail slide on server and client side.
This commit is contained in:
Oskar Hahn 2015-12-12 09:31:36 +01:00
commit 9402d25f4f
5 changed files with 22 additions and 34 deletions

View File

@ -44,10 +44,7 @@ class ItemDetailSlide(ProjectorElement):
"""
Slide definitions for Item model.
This is only for detail slides. You have to set 'id'.
To activate a detail slide as list of speakers slide, set 'id' and set
'list_of_speakers' true.
This is only for list of speakers slide. You have to set 'id'.
"""
name = 'agenda/item'
@ -61,7 +58,7 @@ class ItemDetailSlide(ProjectorElement):
def get_requirements(self, config_entry):
pk = config_entry.get('id')
if pk is not None:
# Detail slide.
# List of speakers slide.
try:
item = Item.objects.get(pk=pk)
except Item.DoesNotExist:

View File

@ -80,20 +80,20 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
projectListOfSpeakers: function() {
return $http.post(
'/rest/core/projector/1/prune_elements/',
[{name: 'agenda/item', id: this.id, list_of_speakers: true}]
[{name: 'agenda/item', id: this.id}]
);
},
// check if list of speakers is projected
isListOfSpeakersProjected: function () {
// Returns true if there is a projector element with the same
// name and agenda is active.
// Returns true if there is a projector element with the
// name 'agenda/item' and the same id.
var projector = Projector.get(1);
if (typeof projector === 'undefined') return false;
var self = this;
var predicate = function (element) {
return element.name == 'agenda/item' &&
element.id == self.id &&
element.list_of_speakers;
typeof element.id !== 'undefined' &&
element.id == self.id;
};
return typeof _.findKey(projector.elements, predicate) === 'string';
}

View File

@ -28,8 +28,6 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda'])
Agenda.find(id);
User.findAll();
Agenda.bindOne(id, $scope, 'item');
// get flag for list-of-speakers-slide (true/false)
$scope.is_list_of_speakers = $scope.element.list_of_speakers;
}
])

View File

@ -162,8 +162,8 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
};
// check if agenda is projected
$scope.isAgendaProjected = function () {
// Returns true if there is a projector element with the same
// name and agenda is active.
// Returns true if there is a projector element with the name
// 'agenda/item-list'.
var projector = Projector.get(1);
if (typeof projector === 'undefined') return false;
var self = this;

View File

@ -1,27 +1,20 @@
<div ng-controller="SlideItemDetailCtrl" class="content">
<h1>
{{ item.title }}
<small ng-if="is_list_of_speakers">
<span translate>List of speakers</span>
<span ng-if="item.speaker_list_closed" class="label label-danger" translate>Closed</span>
</small>
<span translate>List of speakers</span>
<span ng-if="item.speaker_list_closed" class="label label-danger" translate>Closed</span>
</h1>
<!-- Item text -->
<div ng-if="!is_list_of_speakers" class="white-space-pre-line">{{ item.text }}</div>
<!-- List of speakers -->
<div ng-if="is_list_of_speakers">
<!-- TODO: show last old speakers -->
<!-- TODO: show last old speakers -->
<!-- current speaker -->
<p>
<strong ng-repeat="speaker in item.speakers | filter: {end_time: null, begin_time: '!!'}">
{{ speaker.user.get_full_name() }}
</strong>
<!-- next speakers -->
<ol id="list_of_speakers">
<li ng-repeat="speaker in item.speakers | filter: {begin_time: null}">
{{ speaker.user.get_full_name() }}
</ol>
</div>
<!-- Current speaker -->
<p>
<strong ng-repeat="speaker in item.speakers | filter: {end_time: null, begin_time: '!!'}">
{{ speaker.user.get_full_name() }}
</strong>
<!-- Next speakers -->
<ol id="list_of_speakers">
<li ng-repeat="speaker in item.speakers | filter: {begin_time: null}">
{{ speaker.user.get_full_name() }}
</ol>
</div>