From 79e879cb6ef9b9fc3d305063b0b82d73f8d8fdeb Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Wed, 28 Aug 2019 14:59:30 +0200 Subject: [PATCH 1/2] Adds config to see a max number of next speakers - Also updates the 'list of speakers' on the `overlay-slide`. --- ...mmon-list-of-speakers-slide.component.scss | 6 ++- ...t-of-speakers-overlay-slide.component.html | 32 +++++----------- ...t-of-speakers-overlay-slide.component.scss | 14 ++++++- ...ist-of-speakers-overlay-slide.component.ts | 37 ++++++++++++++++++- openslides/agenda/config_variables.py | 22 ++++++++--- openslides/agenda/projector.py | 5 +++ 6 files changed, 84 insertions(+), 32 deletions(-) diff --git a/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss b/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss index 3fe46b824..31109a835 100644 --- a/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss +++ b/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss @@ -6,6 +6,7 @@ .currentSpeaker { font-weight: bold; + margin: 20px 0 16px; .mat-icon, span { @@ -17,10 +18,11 @@ } .nextSpeakers { - margin-left: 13px !important; - margin-top: 10px !important; + margin: 0; + padding-left: 6px; li { + list-style-position: inside; line-height: 150%; } } diff --git a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.html b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.html index b006e8894..bf53ca23a 100644 --- a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.html +++ b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.html @@ -1,27 +1,15 @@ -
+

List of speakers

- -
-
+
+ mic + {{ currentSpeaker.user }} +
+ +
    +
  1. {{ speaker.user }} star -
-
- - -
- mic - {{ data.data.current.user }} -
- - -
-
    -
  1. - {{ speaker.user }} - star -
  2. -
-
+ +
diff --git a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.scss b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.scss index ef666f6e7..4e7f62c45 100644 --- a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.scss +++ b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.scss @@ -6,12 +6,22 @@ bottom: 0; background-color: #d3d3d3; width: 40%; - height: 200px; + height: 210px; margin: 10px; z-index: 20; border-radius: 7px; border: 1px solid #999; - padding: 0px 7px 10px 19px; + padding: 10px 10px 10px 25px; box-shadow: 3px 3px 10px 1px rgba(0, 0, 0, 0.5); overflow: hidden; + + h3 { + margin-top: 0; + } + + .one-line { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } } diff --git a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts index 3c3b59a03..63bd16b89 100644 --- a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts +++ b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts @@ -1,14 +1,49 @@ -import { Component } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { BaseSlideComponent } from 'app/slides/base-slide-component'; import { CommonListOfSpeakersSlideData } from '../common/common-list-of-speakers-slide-data'; +/** + * Interface, that describes how the speaker-objects look like. + */ +interface SpeakerObject { + user: string; + marked: boolean; + end_time: number | null; + weight: number | null; +} + @Component({ selector: 'os-current-list-of-speakers-overlay-slide', templateUrl: './current-list-of-speakers-overlay-slide.component.html', styleUrls: ['./current-list-of-speakers-overlay-slide.component.scss'] }) export class CurrentListOfSpeakersOverlaySlideComponent extends BaseSlideComponent { + /** + * Gets the data. Sets necessary information for the list of speakers in the overlay. + * + * @param data The passed data to this overlay. + */ + @Input() + public set data(data: any) { + if (data.data.current) { + this.currentSpeaker = data.data.current; + } + if (data.data.waiting) { + this.nextSpeakers = data.data.waiting; + } + } + + /** + * The current speaker. + */ + public currentSpeaker: SpeakerObject; + + /** + * List with the next speakers for this list. + */ + public nextSpeakers: SpeakerObject[] = []; + public constructor() { super(); } diff --git a/openslides/agenda/config_variables.py b/openslides/agenda/config_variables.py index 1a1f962fc..2d2580db2 100644 --- a/openslides/agenda/config_variables.py +++ b/openslides/agenda/config_variables.py @@ -116,13 +116,25 @@ def get_config_variables(): validators=(MinValueValidator(0),), ) + yield ConfigVariable( + name="agenda_show_next_speakers", + default_value=0, + input_type="integer", + label="Number of the next speakers to be shown on the projector", + help_text="Enter number of the next shown speakers. Choose 0 to disable this.", + weight=222, + group="Agenda", + subgroup="List of speakers", + validators=(MinValueValidator(0),), + ) + yield ConfigVariable( name="agenda_countdown_warning_time", default_value=0, input_type="integer", label="Show orange countdown in the last x seconds of speaking time", help_text="Enter duration in seconds. Choose 0 to disable warning color.", - weight=221, + weight=224, group="Agenda", subgroup="List of speakers", validators=(MinValueValidator(0),), @@ -133,7 +145,7 @@ def get_config_variables(): default_value=60, input_type="integer", label="Predefined seconds of new countdowns", - weight=222, + weight=226, group="Agenda", subgroup="List of speakers", ) @@ -144,7 +156,7 @@ def get_config_variables(): input_type="boolean", label="Couple countdown with the list of speakers", help_text="[Begin speech] starts the countdown, [End speech] stops the countdown.", - weight=223, + weight=228, group="Agenda", subgroup="List of speakers", ) @@ -154,7 +166,7 @@ def get_config_variables(): default_value=False, input_type="boolean", label="Hide the amount of speakers in subtitle of list of speakers slide", - weight=224, + weight=230, group="Agenda", subgroup="List of speakers", ) @@ -164,7 +176,7 @@ def get_config_variables(): default_value=False, input_type="boolean", label="Only present participants can be added to the list of speakers", - weight=225, + weight=232, group="Agenda", subgroup="List of speakers", ) diff --git a/openslides/agenda/projector.py b/openslides/agenda/projector.py index e5cd9d10b..3a08b6e56 100644 --- a/openslides/agenda/projector.py +++ b/openslides/agenda/projector.py @@ -152,6 +152,8 @@ async def get_list_of_speakers_slide_data( speakers_finished = sorted(speakers_finished, key=lambda s: s["end_time"]) number_of_last_speakers = await get_config(all_data, "agenda_show_last_speakers") + number_of_next_speakers = await get_config(all_data, "agenda_show_next_speakers") + if number_of_last_speakers == 0: speakers_finished = [] else: @@ -159,6 +161,9 @@ async def get_list_of_speakers_slide_data( -number_of_last_speakers: ] # Take the last speakers + if number_of_next_speakers != 0: + speakers_waiting = speakers_waiting[:number_of_next_speakers] + return { "waiting": speakers_waiting, "current": current_speaker, From 9518d1dab606a8a95579aa051868fd366eb70bf8 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Mon, 2 Sep 2019 08:05:45 +0200 Subject: [PATCH 2/2] Small changes --- .../common/common-list-of-speakers-slide-data.ts | 2 +- .../common-list-of-speakers-slide.component.scss | 4 ++-- ...t-list-of-speakers-overlay-slide.component.ts | 16 +++------------- client/src/assets/styles/projector.scss | 4 ++-- openslides/agenda/config_variables.py | 6 +++--- openslides/agenda/projector.py | 7 +++---- 6 files changed, 14 insertions(+), 25 deletions(-) diff --git a/client/src/app/slides/agenda/common/common-list-of-speakers-slide-data.ts b/client/src/app/slides/agenda/common/common-list-of-speakers-slide-data.ts index c328de2ee..45707de0c 100644 --- a/client/src/app/slides/agenda/common/common-list-of-speakers-slide-data.ts +++ b/client/src/app/slides/agenda/common/common-list-of-speakers-slide-data.ts @@ -1,4 +1,4 @@ -interface SlideSpeaker { +export interface SlideSpeaker { user: string; marked: boolean; } diff --git a/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss b/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss index 31109a835..9a4d35aa0 100644 --- a/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss +++ b/client/src/app/slides/agenda/common/common-list-of-speakers-slide.component.scss @@ -1,7 +1,6 @@ .lastSpeakers { color: #9a9898; - margin-left: 33px; - margin-bottom: 10px; + margin: 20px 0 10px 33px; } .currentSpeaker { @@ -20,6 +19,7 @@ .nextSpeakers { margin: 0; padding-left: 6px; + margin-top: 20px !important; li { list-style-position: inside; diff --git a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts index 63bd16b89..13520a33f 100644 --- a/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts +++ b/client/src/app/slides/agenda/current-list-of-speakers-overlay/current-list-of-speakers-overlay-slide.component.ts @@ -1,17 +1,7 @@ import { Component, Input } from '@angular/core'; import { BaseSlideComponent } from 'app/slides/base-slide-component'; -import { CommonListOfSpeakersSlideData } from '../common/common-list-of-speakers-slide-data'; - -/** - * Interface, that describes how the speaker-objects look like. - */ -interface SpeakerObject { - user: string; - marked: boolean; - end_time: number | null; - weight: number | null; -} +import { CommonListOfSpeakersSlideData, SlideSpeaker } from '../common/common-list-of-speakers-slide-data'; @Component({ selector: 'os-current-list-of-speakers-overlay-slide', @@ -37,12 +27,12 @@ export class CurrentListOfSpeakersOverlaySlideComponent extends BaseSlideCompone /** * The current speaker. */ - public currentSpeaker: SpeakerObject; + public currentSpeaker: SlideSpeaker; /** * List with the next speakers for this list. */ - public nextSpeakers: SpeakerObject[] = []; + public nextSpeakers: SlideSpeaker[] = []; public constructor() { super(); diff --git a/client/src/assets/styles/projector.scss b/client/src/assets/styles/projector.scss index dfc1b56de..a9ff06d87 100644 --- a/client/src/assets/styles/projector.scss +++ b/client/src/assets/styles/projector.scss @@ -23,7 +23,7 @@ .slidetitle { border-bottom: 2px solid #d3d3d3; - padding-bottom: 20px; + padding-bottom: 10px; h1 { margin-bottom: 0; @@ -34,7 +34,7 @@ h2 { color: #9a9898; margin-top: 10px; - margin-bottom: 2px; + margin-bottom: -10px; font-size: 28px; font-weight: normal; display: block; diff --git a/openslides/agenda/config_variables.py b/openslides/agenda/config_variables.py index 2d2580db2..3b7991b7e 100644 --- a/openslides/agenda/config_variables.py +++ b/openslides/agenda/config_variables.py @@ -118,14 +118,14 @@ def get_config_variables(): yield ConfigVariable( name="agenda_show_next_speakers", - default_value=0, + default_value=-1, input_type="integer", label="Number of the next speakers to be shown on the projector", - help_text="Enter number of the next shown speakers. Choose 0 to disable this.", + help_text="Enter number of the next shown speakers. Choose -1 to show all next speakers.", weight=222, group="Agenda", subgroup="List of speakers", - validators=(MinValueValidator(0),), + validators=(MinValueValidator(-1),), ) yield ConfigVariable( diff --git a/openslides/agenda/projector.py b/openslides/agenda/projector.py index 3a08b6e56..9443acffc 100644 --- a/openslides/agenda/projector.py +++ b/openslides/agenda/projector.py @@ -157,11 +157,10 @@ async def get_list_of_speakers_slide_data( if number_of_last_speakers == 0: speakers_finished = [] else: - speakers_finished = speakers_finished[ - -number_of_last_speakers: - ] # Take the last speakers + # Take the last speakers + speakers_finished = speakers_finished[-number_of_last_speakers:] - if number_of_next_speakers != 0: + if number_of_next_speakers != -1: speakers_waiting = speakers_waiting[:number_of_next_speakers] return {