Motion block slide template

This commit is contained in:
Emanuel Schütze 2019-02-21 15:06:14 +01:00
parent 2abe71313c
commit 80a061db38
9 changed files with 29 additions and 19 deletions

View File

@ -3,7 +3,7 @@
[ngClass]="isProjected() ? 'projector-active' : 'projector-inactive'">
<mat-icon>videocam</mat-icon>
</button>
<button type="button" *ngIf="menuItem" mat-menu-item (click)="onClick($event)"
<button type="button" *ngIf="menuItem" mat-menu-item (click)="onClick()"
[ngClass]="isProjected() ? 'projector-active' : 'projector-inactive'">
<mat-icon>videocam</mat-icon>
<span translate>Project</span>

View File

@ -63,8 +63,10 @@ export class ProjectorButtonComponent implements OnInit {
*
* @param event the click event
*/
public onClick(event: Event): void {
public onClick(event?: Event): void {
if (event) {
event.stopPropagation();
}
if (this.object) {
this.projectionDialogService.openProjectDialogFor(this.object);
}

View File

@ -21,7 +21,7 @@
background-repeat: no-repeat;
background-size: 100% 100%;
margin-bottom: 20px;
z-index: 1;
z-index: 9;
.projector-logo-main {
height: 50px;
@ -59,7 +59,7 @@
width: 100%;
height: 35px;
bottom: 0;
z-index: 1;
z-index: 9;
.footertext {
font-size: 16px;

View File

@ -104,10 +104,8 @@
<span translate>List of speakers</span>
</button>
<button mat-menu-item *osPerms="'core.can_manage_projector'">
<mat-icon>videocam</mat-icon>
<span translate>Project</span>
</button>
<os-projector-button *ngIf="block" [object]="block" [menuItem]="true"></os-projector-button>
<div *osPerms="['motions.can_manage', 'motions.can_manage_metadata']">
<button mat-menu-item (click)="toggleEditMode()">
<mat-icon>edit</mat-icon>

View File

@ -41,7 +41,7 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
/**
* Columns to display in table when desktop view is available
*/
public displayedColumnsDesktop: string[] = ['identifier', 'title', 'state', 'speakers'];
public displayedColumnsDesktop: string[] = ['identifier', 'title', 'state'];
/**
* Columns to display in table when mobile view is available
@ -237,6 +237,9 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
if (this.isMultiSelect) {
columns = ['selector'].concat(columns);
}
if (this.operator.hasPerms('agenda.can_see')) {
columns = columns.concat(['speakers']);
}
return columns;
}

View File

@ -1,10 +1,17 @@
<div *ngIf="data">
<div class="slidetitle">
<h1>{{ data.data.title }}</h1>
<h2><span translate>Motion block</span> {{ data.data.motions.length }} <span translate>motions</span></h2>
</div>
<div *ngFor="let motion of data.data.motions">
{{ getMotionTitle(motion) }}
<div class="ellipsis-overflow">
{{ motion.identifier }}: {{ motion.title }}
</div>
<div class="white ellipsis-overflow">
<mat-basic-chip *ngIf="motion.recommendation" disableRipple [ngClass]="getStateCssColor(motion)">
{{ getStateLabel(motion) }}
{{ getRecommendationLabel(motion) }}
</mat-basic-chip>
</div>
</div>
</div>

View File

@ -25,10 +25,10 @@ export class MotionBlockSlideComponent extends BaseSlideComponent<MotionBlockSli
return StateCssClassMapping[motion.recommendation.css_class] || '';
}
public getStateLabel(motion: MotionBlockSlideMotionRepresentation): string {
public getRecommendationLabel(motion: MotionBlockSlideMotionRepresentation): string {
let recommendation = this.translate.instant(motion.recommendation.name);
if (motion.recommendation_extension) {
recommendation += ' ' + motion.recommendation_extension;
recommendation += ' ' + this.motionRepo.solveExtensionPlaceHolder(motion.recommendation_extension);
}
return recommendation;
}

View File

@ -617,7 +617,7 @@ button.mat-menu-item.selected {
margin-bottom: 40px;
h1 {
font-size: 2em;
font-size: 1.8em;
line-height: 1.1em;
margin-bottom: 0;
padding-bottom: 0;

View File

@ -234,7 +234,7 @@ def motion_block_slide(all_data: AllData, element: Dict[str, Any]) -> Dict[str,
all_data, motion, motion["recommendation_id"]
)
motion_object["recommendation"] = {
"name": recommendation["name"],
"name": recommendation["recommendation_label"],
"css_class": recommendation["css_class"],
}
if recommendation["show_recommendation_extension_field"]: