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

View File

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

View File

@ -28,8 +28,6 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.agenda'])
Agenda.find(id); Agenda.find(id);
User.findAll(); User.findAll();
Agenda.bindOne(id, $scope, 'item'); 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 // check if agenda is projected
$scope.isAgendaProjected = function () { $scope.isAgendaProjected = function () {
// Returns true if there is a projector element with the same // Returns true if there is a projector element with the name
// name and agenda is active. // 'agenda/item-list'.
var projector = Projector.get(1); var projector = Projector.get(1);
if (typeof projector === 'undefined') return false; if (typeof projector === 'undefined') return false;
var self = this; var self = this;

View File

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