-
-
-
- {{ projector.name | translate }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
\ No newline at end of file
+
diff --git a/client/src/app/site/projector/components/projector-list/projector-list.component.scss b/client/src/app/site/projector/components/projector-list/projector-list.component.scss
index 7501de850..5b3fb4aa9 100644
--- a/client/src/app/site/projector/components/projector-list/projector-list.component.scss
+++ b/client/src/app/site/projector/components/projector-list/projector-list.component.scss
@@ -6,25 +6,5 @@
width: 350px;
margin: 10px;
float: left;
-
- .projector {
- width: 320px;
- color: black;
- border: 1px solid lightgrey;
- }
-
- form {
- margin-top: 10px;
- }
-
- ::ng-deep mat-card {
- margin: 0;
- }
-
- .no-markup {
- /* Do not let the a tag ruin the projector */
- color: inherit;
- text-decoration: inherit;
- }
}
}
diff --git a/client/src/app/site/projector/components/projector-list/projector-list.component.ts b/client/src/app/site/projector/components/projector-list/projector-list.component.ts
index 8709400af..f25481337 100644
--- a/client/src/app/site/projector/components/projector-list/projector-list.component.ts
+++ b/client/src/app/site/projector/components/projector-list/projector-list.component.ts
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Title } from '@angular/platform-browser';
-import { MatSnackBar, MatSelectChange, MatSliderChange } from '@angular/material';
+import { MatSnackBar, MatSelectChange } from '@angular/material';
import { TranslateService } from '@ngx-translate/core';
@@ -9,20 +9,7 @@ import { ProjectorRepositoryService } from 'app/core/repositories/projector/proj
import { ViewProjector } from '../../models/view-projector';
import { Projector } from 'app/shared/models/core/projector';
import { BaseViewComponent } from 'app/site/base/base-view';
-import { PromptService } from 'app/core/ui-services/prompt.service';
-import { ClockSlideService } from '../../services/clock-slide.service';
import { OperatorService } from 'app/core/core-services/operator.service';
-import { ProjectionDefaultRepositoryService } from 'app/core/repositories/projector/projection-default-repository.service';
-import { ViewProjectionDefault } from '../../models/view-projection-default';
-
-/**
- * All supported aspect rations for projectors.
- */
-const aspectRatios: { [ratio: string]: number } = {
- '4:3': 4 / 3,
- '16:9': 16 / 9,
- '16:10': 16 / 10
-};
/**
* List for all projectors.
@@ -43,17 +30,6 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit
*/
public createForm: FormGroup;
- /**
- * The update form. Will be refreahed for each projector. Just one update
- * form can be shown per time.
- */
- public updateForm: FormGroup;
-
- /**
- * The id of the currently edited projector.
- */
- public editId: number | null = null;
-
/**
* All aspect ratio keys/strings for the UI.
*/
@@ -64,8 +40,6 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit
*/
public projectors: ViewProjector[];
- public projectionDefaults: ViewProjectionDefault[];
-
/**
* Helper to check manage permissions
*
@@ -93,32 +67,13 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit
matSnackBar: MatSnackBar,
private repo: ProjectorRepositoryService,
private formBuilder: FormBuilder,
- private promptService: PromptService,
- private clockSlideService: ClockSlideService,
- private operator: OperatorService,
- private projectionDefaultRepo: ProjectionDefaultRepositoryService
+ private operator: OperatorService
) {
super(titleService, translate, matSnackBar);
- this.aspectRatiosKeys = Object.keys(aspectRatios);
-
this.createForm = this.formBuilder.group({
name: ['', Validators.required]
});
- this.updateForm = this.formBuilder.group({
- name: ['', Validators.required],
- aspectRatio: ['', Validators.required],
- width: [0, Validators.required],
- projectiondefaults_id: [[]],
- clock: [true],
- background_color: ['', Validators.required],
- header_background_color: ['', Validators.required],
- header_font_color: ['', Validators.required],
- header_h1_color: ['', Validators.required],
- show_header_footer: [],
- show_title: [],
- show_logo: []
- });
}
/**
@@ -128,8 +83,6 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit
super.setTitle('Projectors');
this.projectors = this.repo.getViewModelList();
this.repo.getViewModelListObservable().subscribe(projectors => (this.projectors = projectors));
- this.projectionDefaults = this.projectionDefaultRepo.getViewModelList();
- this.projectionDefaultRepo.getViewModelListObservable().subscribe(pds => (this.projectionDefaults = pds));
}
/**
@@ -159,110 +112,13 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit
* Event on Key Down in update or create form.
*
* @param event the keyboard event
- * @param the current view in scope
*/
- public keyDownFunction(event: KeyboardEvent, projector?: ViewProjector): void {
- if (event.key === 'Enter' && event.shiftKey) {
- if (projector) {
- this.onSaveButton(projector);
- } else {
- this.create();
- }
+ public keyDownFunction(event: KeyboardEvent): void {
+ if (event.key === 'Enter') {
+ this.create();
}
if (event.key === 'Escape') {
- if (projector) {
- this.onCancelButton(projector);
- } else {
- this.projectorToCreate = null;
- }
- }
- }
-
- /**
- * Calculates the aspect ratio of the given projector.
- * If no matching ratio is found, the first ratio is returned.
- *
- * @param projector The projector to check
- * @returns the found ratio key.
- */
- public getAspectRatioKey(projector: ViewProjector): string {
- const ratio = projector.width / projector.height;
- const RATIO_ENVIRONMENT = 0.05;
- const foundRatioKey = Object.keys(aspectRatios).find(key => {
- const value = aspectRatios[key];
- return value >= ratio - RATIO_ENVIRONMENT && value <= ratio + RATIO_ENVIRONMENT;
- });
- if (!foundRatioKey) {
- return Object.keys(aspectRatios)[0];
- } else {
- return foundRatioKey;
- }
- }
-
- /**
- * Starts editing for the given projector.
- *
- * @param projector The projector to edit
- */
- public onEditButton(projector: ViewProjector): void {
- if (this.editId !== null) {
- return;
- }
- this.editId = projector.id;
- this.updateForm.reset();
-
- this.updateForm.patchValue(projector.projector);
- this.updateForm.patchValue({
- name: this.translate.instant(projector.name),
- aspectRatio: this.getAspectRatioKey(projector),
- clock: this.clockSlideService.isProjectedOn(projector)
- });
- }
-
- /**
- * Cancels the current editing.
- * @param projector the projector
- */
- public onCancelButton(projector: ViewProjector): void {
- if (projector.id !== this.editId) {
- return;
- }
- this.editId = null;
- }
-
- /**
- * Saves the projector
- *
- * @param projector The projector to save.
- */
- public async onSaveButton(projector: ViewProjector): Promise