{{ item.title }}
-+ {{ item.title }} + + List of speakers + Closed + +
+ ++ + {{ speaker.user.get_full_name() }} + + +
-
+
- + {{ speaker.user.get_full_name() }} +
diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index b61324e05..39fbf62cc 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -377,7 +377,7 @@ class Speaker(RESTModelMixin, models.Model): end_time = models.DateTimeField(null=True) """ - Saves the time, when the speaker ends his speach. None, if he is not finished yet. + Saves the time, when the speaker ends his speech. None, if he is not finished yet. """ weight = models.IntegerField(null=True) @@ -393,19 +393,19 @@ class Speaker(RESTModelMixin, models.Model): def __str__(self): return str(self.user) - def begin_speach(self): + def begin_speech(self): """ Let the user speak. Set the weight to None and the time to now. If anyone is still - speaking, end his speach. + speaking, end his speech. """ try: actual_speaker = Speaker.objects.filter(item=self.item, end_time=None).exclude(begin_time=None).get() except Speaker.DoesNotExist: pass else: - actual_speaker.end_speach() + actual_speaker.end_speech() self.weight = None self.begin_time = datetime.now() self.save() @@ -416,9 +416,9 @@ class Speaker(RESTModelMixin, models.Model): # start_countdown() pass - def end_speach(self): + def end_speech(self): """ - The speach is finished. Set the time to now. + The speech is finished. Set the time to now. """ self.end_time = datetime.now() self.save() diff --git a/openslides/agenda/projector.py b/openslides/agenda/projector.py index 5227a08b4..13dac488c 100644 --- a/openslides/agenda/projector.py +++ b/openslides/agenda/projector.py @@ -81,7 +81,7 @@ class ItemDetailSlide(ProjectorElement): view_class=ItemViewSet, view_action='retrieve', pk=str(item.pk)) - for speaker in item.speaker_set.all(): + for speaker in item.speakers.all(): yield ProjectorRequirement( view_class=speaker.user.get_view_class(), view_action='retrieve', diff --git a/openslides/agenda/signals.py b/openslides/agenda/signals.py index b22f62da8..cdf07efbd 100644 --- a/openslides/agenda/signals.py +++ b/openslides/agenda/signals.py @@ -48,7 +48,7 @@ def setup_agenda_config(sender, **kwargs): default_value=False, input_type='boolean', label=ugettext_lazy('Couple countdown with the list of speakers'), - help_text=ugettext_lazy('[Begin speach] starts the countdown, [End speach] stops the countdown.'), + help_text=ugettext_lazy('[Begin speech] starts the countdown, [End speech] stops the countdown.'), weight=230, group=ugettext_lazy('Agenda')) diff --git a/openslides/agenda/static/js/agenda/agenda.js b/openslides/agenda/static/js/agenda/agenda.js index a6ab2867f..62d4868f9 100644 --- a/openslides/agenda/static/js/agenda/agenda.js +++ b/openslides/agenda/static/js/agenda/agenda.js @@ -181,7 +181,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda']) // close/open list of speakers of current item $scope.closeList = function (listClosed) { - item.speakerListClosed = listClosed; + item.speaker_list_closed = listClosed; Agenda.save(item); }; // add user to list of speakers @@ -198,7 +198,34 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda']) $scope.removeSpeaker = function (speakerId) { $http.delete('/rest/agenda/item/' + item.id + '/manage_speaker/', {headers: {'Content-Type': 'application/json'}, - data: JSON.stringify({speaker: speakerId})}); + data: JSON.stringify({speaker: speakerId})}) + .error(function(data){ + $scope.alert = { type: 'danger', msg: data.detail, show: true }; + }); + }; + // begin speech of selected/next speaker + $scope.beginSpeech = function (speakerId) { + $http.put('/rest/agenda/item/' + item.id + '/speak/', {'speaker': speakerId}) + .success(function(data){ + $scope.alert.show = false; + }) + .error(function(data){ + $scope.alert = { type: 'danger', msg: data.detail, show: true }; + }); + }; + // end speech of current speaker + $scope.endSpeech = function () { + $http.delete('/rest/agenda/item/' + item.id + '/speak/', + {headers: {'Content-Type': 'application/json'}, + data: JSON.stringify()}) + .error(function(data){ + $scope.alert = { type: 'danger', msg: data.detail, show: true }; + }); + }; + // project list of speakers + $scope.projectListOfSpeakers = function () { + $http.post('/rest/core/projector/1/prune_elements/', + [{name: 'agenda/item', id: item.id, list_of_speakers: true}]); }; }) @@ -301,15 +328,22 @@ angular.module('OpenSlidesApp.agenda.projector', ['OpenSlidesApp.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. - var id = $scope.element.context.id; - Agenda.find(id); - Agenda.bindOne(id, $scope, 'item'); - -}) +.controller('SlideItemDetailCtrl', [ + '$scope', + 'Agenda', + 'User', + function($scope, Agenda, User) { + // 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. + var id = $scope.element.context.id; + 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.context.list_of_speakers; + } +]) .controller('SlideItemListCtrl', function($scope, $http, Agenda) { // Attention! Each object that is used here has to be dealt on server side. diff --git a/openslides/agenda/static/templates/agenda/item-detail.html b/openslides/agenda/static/templates/agenda/item-detail.html index 44e9374dc..8d3ff908e 100644 --- a/openslides/agenda/static/templates/agenda/item-detail.html +++ b/openslides/agenda/static/templates/agenda/item-detail.html @@ -23,62 +23,114 @@
+
+
+ + {{ speaker.user.get_full_name() }} + + +