diff --git a/client/src/app/shared/models/core/projector.ts b/client/src/app/shared/models/core/projector.ts index 7e5ac4dec..8987d88fb 100644 --- a/client/src/app/shared/models/core/projector.ts +++ b/client/src/app/shared/models/core/projector.ts @@ -72,6 +72,8 @@ export class Projector extends BaseModel { public header_background_color: string; public header_font_color: string; public header_h1_color: string; + public chyron_background_color: string; + public chyron_font_color: string; public show_header_footer: boolean; public show_title: boolean; public show_logo: boolean; diff --git a/client/src/app/site/projector/components/projector-detail/projector-detail.component.html b/client/src/app/site/projector/components/projector-detail/projector-detail.component.html index a4b56bb7e..0395f7afd 100644 --- a/client/src/app/site/projector/components/projector-detail/projector-detail.component.html +++ b/client/src/app/site/projector/components/projector-detail/projector-detail.component.html @@ -234,31 +234,31 @@ - - - Slide + Slide - - - Overlay + Overlay - - - Chyron + Chyron diff --git a/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.html b/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.html index 465214323..edddf9294 100644 --- a/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.html +++ b/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.html @@ -39,14 +39,17 @@ {{ ratio }} - - {{ updateForm.value.width }} +
+ + {{ updateForm.value.width }} +

Projection defaults

@@ -57,34 +60,107 @@ - - Background color - - - Required - - - - Header background color - - - Required - - - - Header font color - - - Required - - - - Headline color - - - Required - - +
+
+ + Background color + + + Required + + +
+
+ +
+
+ +
+
+ + Header background color + + + Required + + +
+
+ +
+
+ +
+
+ + Header font color + + + Required + + +
+
+ +
+
+ +
+
+ + Headline color + + + Required + + +
+
+ +
+
+ +
+
+ + Chyron background color + + + Required + + +
+
+ +
+
+ +
+
+ + Chyron font color + + + Required + + +
+
+ +
+
diff --git a/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.scss b/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.scss index a7f624446..044266278 100644 --- a/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.scss +++ b/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.scss @@ -17,3 +17,19 @@ form { color: inherit; text-decoration: inherit; } + +.color-field-wrapper { + width: 100%; + display: grid; + grid-template-columns: auto 30px; + + .form { + grid-column-start: 1; + grid-column-end: 1; + } + .reset-button { + grid-column-start: 2; + grid-column-end: 2; + margin-top: 30px; + } +} diff --git a/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.ts b/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.ts index 21ed72490..be38d6df3 100644 --- a/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.ts +++ b/client/src/app/site/projector/components/projector-list-entry/projector-list-entry.component.ts @@ -106,6 +106,8 @@ export class ProjectorListEntryComponent extends BaseViewComponent implements On header_background_color: ['', Validators.required], header_font_color: ['', Validators.required], header_h1_color: ['', Validators.required], + chyron_background_color: ['', Validators.required], + chyron_font_color: ['', Validators.required], show_header_footer: [], show_title: [], show_logo: [] @@ -226,4 +228,13 @@ export class ProjectorListEntryComponent extends BaseViewComponent implements On updateProjector.height = Math.round(event.value / aspectRatios[aspectRatio]); this.repo.update(updateProjector, this.projector).then(null, this.raiseError); } + + /** + * Resets the given form field to the given default. + */ + public resetField(field: string, value: string): void { + const patchValue = {}; + patchValue[field] = value; + this.updateForm.patchValue(patchValue); + } } diff --git a/client/src/app/site/projector/models/view-projector.ts b/client/src/app/site/projector/models/view-projector.ts index 06471cc7c..0708e3f27 100644 --- a/client/src/app/site/projector/models/view-projector.ts +++ b/client/src/app/site/projector/models/view-projector.ts @@ -83,6 +83,14 @@ export class ViewProjector extends BaseViewModel { return this.projector.header_h1_color; } + public get chyron_background_color(): string { + return this.projector.chyron_background_color; + } + + public get chyron_font_color(): string { + return this.projector.chyron_font_color; + } + public get show_header_footer(): boolean { return this.projector.show_header_footer; } diff --git a/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide-data.ts b/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide-data.ts index 93c7218ef..40aa57933 100644 --- a/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide-data.ts +++ b/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide-data.ts @@ -1,3 +1,5 @@ export interface CurrentSpeakerChyronSlideData { current_speaker?: string; + background_color: string; + font_color: string; } diff --git a/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide.component.html b/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide.component.html index 6b08f061e..eba96bae0 100644 --- a/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide.component.html +++ b/client/src/app/slides/agenda/current-speaker-chyron/current-speaker-chyron-slide.component.html @@ -1,4 +1,7 @@ -
+
+ {{ data.data.current_speaker }} diff --git a/client/src/assets/styles/global-components-style.scss b/client/src/assets/styles/global-components-style.scss index 5736b907d..a779da3d9 100644 --- a/client/src/assets/styles/global-components-style.scss +++ b/client/src/assets/styles/global-components-style.scss @@ -71,10 +71,6 @@ } /* projector components */ - #chyron { - background-color: mat-color($primary); - color: white; // TODO - } .backgroundColorAccent { background-color: mat-color($accent); color: mat-color($accent, default-contrast) !important; diff --git a/client/src/styles.scss b/client/src/styles.scss index e0aba1354..17217e09f 100644 --- a/client/src/styles.scss +++ b/client/src/styles.scss @@ -280,7 +280,7 @@ mat-card { } } .projector-card .mat-form-field-infix { - width: 320px; + width: 290px; } // Shared table definitions diff --git a/openslides/agenda/projector.py b/openslides/agenda/projector.py index 16eefeec3..70e18a857 100644 --- a/openslides/agenda/projector.py +++ b/openslides/agenda/projector.py @@ -232,10 +232,18 @@ async def current_speaker_chyron_slide( """ Returns the username for the current speaker. """ + # get projector for color information + projector = all_data["core/projector"][projector_id] + + slide_data = { + "background_color": projector["chyron_background_color"], + "font_color": projector["chyron_font_color"], + } + reference_projector = await get_reference_projector(all_data, projector_id) item_id = await get_current_item_id_for_projector(all_data, reference_projector) if item_id is None: # no element found - return {} + return slide_data # get item try: @@ -249,7 +257,10 @@ async def current_speaker_chyron_slide( if speaker["begin_time"] is not None and speaker["end_time"] is None: current_speaker = await get_user_name(all_data, speaker["user_id"]) - return {"current_speaker": current_speaker} + if current_speaker is not None: + slide_data["current_speaker"] = current_speaker + + return slide_data def register_projector_slides() -> None: diff --git a/openslides/core/migrations/0023_chyron_colors.py b/openslides/core/migrations/0023_chyron_colors.py new file mode 100644 index 000000000..0a191ea3e --- /dev/null +++ b/openslides/core/migrations/0023_chyron_colors.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2 on 2019-05-17 11:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [("core", "0022_remove_chatmessage")] + + operations = [ + migrations.AddField( + model_name="projector", + name="chyron_background_color", + field=models.CharField(default="#317796", max_length=7), + ), + migrations.AddField( + model_name="projector", + name="chyron_font_color", + field=models.CharField(default="#ffffff", max_length=7), + ), + ] diff --git a/openslides/core/models.py b/openslides/core/models.py index 16f56882f..577309885 100644 --- a/openslides/core/models.py +++ b/openslides/core/models.py @@ -82,6 +82,8 @@ class Projector(RESTModelMixin, models.Model): header_background_color = models.CharField(max_length=7, default="#317796") header_font_color = models.CharField(max_length=7, default="#f5f5f5") header_h1_color = models.CharField(max_length=7, default="#317796") + chyron_background_color = models.CharField(max_length=7, default="#317796") + chyron_font_color = models.CharField(max_length=7, default="#ffffff") show_header_footer = models.BooleanField(default=True) show_title = models.BooleanField(default=True) show_logo = models.BooleanField(default=True) diff --git a/openslides/core/serializers.py b/openslides/core/serializers.py index 185b42dce..f7f5eae0a 100644 --- a/openslides/core/serializers.py +++ b/openslides/core/serializers.py @@ -111,6 +111,8 @@ class ProjectorSerializer(ModelSerializer): "header_background_color", "header_font_color", "header_h1_color", + "chyron_background_color", + "chyron_font_color", "show_header_footer", "show_title", "show_logo",