2019-01-17 14:07:54 +01:00
|
|
|
<os-head-bar>
|
2018-12-06 12:28:05 +01:00
|
|
|
<!-- Title -->
|
|
|
|
<div class="title-slot">
|
2019-01-17 14:07:54 +01:00
|
|
|
<h2 *ngIf="block && !editBlock">{{ block.title }}</h2>
|
2018-12-06 12:28:05 +01:00
|
|
|
|
|
|
|
<form [formGroup]="blockEditForm" (ngSubmit)="saveBlock()" (keydown)="onKeyDown($event)" *ngIf="editBlock">
|
|
|
|
<mat-form-field>
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
matInput
|
|
|
|
osAutofocus
|
|
|
|
required
|
|
|
|
formControlName="title"
|
|
|
|
placeholder="{{ 'Title' | translate }}"
|
|
|
|
/>
|
|
|
|
</mat-form-field>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Menu -->
|
|
|
|
<div class="menu-slot">
|
|
|
|
<button type="button" mat-icon-button [matMenuTriggerFor]="motionBlockMenu">
|
|
|
|
<mat-icon>more_vert</mat-icon>
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-01-17 14:07:54 +01:00
|
|
|
<!-- Save button -->
|
|
|
|
<div *ngIf="editBlock" class="extra-controls-slot on-transition-fade">
|
|
|
|
<button mat-button (click)="saveBlock()"><strong translate class="upper">Save</strong></button>
|
|
|
|
</div>
|
|
|
|
</os-head-bar>
|
2018-12-06 12:28:05 +01:00
|
|
|
|
2019-01-17 14:07:54 +01:00
|
|
|
<mat-card>
|
2019-02-12 16:17:00 +01:00
|
|
|
<button
|
|
|
|
*osPerms="['motions.can_manage', 'motions.can_manage_metadata']"
|
|
|
|
mat-raised-button
|
|
|
|
color="primary"
|
|
|
|
(click)="onFollowRecButton()"
|
|
|
|
[disabled]="isFollowingProhibited()"
|
|
|
|
>
|
|
|
|
<mat-icon>done_all</mat-icon>
|
2018-12-06 12:28:05 +01:00
|
|
|
<span translate>Follow recommendations for all motions</span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<table class="os-headed-listview-table on-transition-fade" mat-table [dataSource]="dataSource" matSort>
|
|
|
|
<!-- title column -->
|
|
|
|
<ng-container matColumnDef="title">
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header> <span translate>Motion</span> </mat-header-cell>
|
|
|
|
<mat-cell *matCellDef="let motion" (click)="onClickMotionTitle(motion)"> {{ motion.title }} </mat-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- state column -->
|
|
|
|
<ng-container matColumnDef="state">
|
|
|
|
<mat-header-cell *matHeaderCellDef> <span translate>State</span> </mat-header-cell>
|
|
|
|
<mat-cell class="chip-container" *matCellDef="let motion">
|
|
|
|
<mat-basic-chip
|
|
|
|
disableRipple
|
|
|
|
[ngClass]="{
|
|
|
|
green: motion.state.css_class === 'success',
|
|
|
|
red: motion.state.css_class === 'danger',
|
|
|
|
grey: motion.state.css_class === 'default',
|
|
|
|
lightblue: motion.state.css_class === 'primary'
|
|
|
|
}"
|
|
|
|
>
|
2019-01-21 16:34:19 +01:00
|
|
|
{{ getStateLabel(motion) }}
|
2018-12-06 12:28:05 +01:00
|
|
|
</mat-basic-chip>
|
|
|
|
</mat-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Recommendation column -->
|
|
|
|
<ng-container matColumnDef="recommendation">
|
|
|
|
<mat-header-cell *matHeaderCellDef> <span translate>Recommendation</span> </mat-header-cell>
|
|
|
|
<mat-cell class="chip-container" *matCellDef="let motion">
|
|
|
|
<mat-basic-chip disableRipple class="bluegrey">
|
2019-01-21 16:34:19 +01:00
|
|
|
{{ getRecommendationLabel(motion) }}
|
2018-12-06 12:28:05 +01:00
|
|
|
</mat-basic-chip>
|
|
|
|
</mat-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<!-- Remove motion column -->
|
|
|
|
<ng-container matColumnDef="remove">
|
|
|
|
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
|
|
|
<mat-cell *matCellDef="let motion">
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
mat-icon-button
|
|
|
|
color="warn"
|
|
|
|
matTooltip="{{ 'Remove from motion block' | translate }}"
|
|
|
|
(click)="onRemoveMotionButton(motion)"
|
|
|
|
>
|
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
</button>
|
|
|
|
</mat-cell>
|
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
<mat-header-row *matHeaderRowDef="getColumnDefinition()"></mat-header-row>
|
|
|
|
<mat-row *matRowDef="let row; columns: getColumnDefinition()"> </mat-row>
|
|
|
|
</table>
|
|
|
|
</mat-card>
|
|
|
|
|
|
|
|
<!-- The menu content -->
|
|
|
|
<mat-menu #motionBlockMenu="matMenu">
|
|
|
|
<button mat-menu-item [routerLink]="getSpeakerLink()">
|
|
|
|
<mat-icon>mic</mat-icon>
|
|
|
|
<span translate>List of speakers</span>
|
|
|
|
</button>
|
|
|
|
|
2019-02-12 16:17:00 +01:00
|
|
|
<button mat-menu-item *osPerms="'core.can_manage_projector'">
|
2018-12-06 12:28:05 +01:00
|
|
|
<mat-icon>videocam</mat-icon>
|
|
|
|
<span translate>Project</span>
|
|
|
|
</button>
|
2019-02-12 16:17:00 +01:00
|
|
|
<div *osPerms="['motions.can_manage', 'motions.can_manage_metadata']">
|
|
|
|
<button mat-menu-item (click)="toggleEditMode()">
|
|
|
|
<mat-icon>edit</mat-icon>
|
|
|
|
<span translate>Edit title</span>
|
|
|
|
</button>
|
|
|
|
<mat-divider></mat-divider>
|
2019-01-17 14:07:54 +01:00
|
|
|
|
2019-02-12 16:17:00 +01:00
|
|
|
<button mat-menu-item class="red-warning-text" (click)="onDeleteBlockButton()">
|
|
|
|
<mat-icon>delete</mat-icon>
|
|
|
|
<span translate>Delete</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2018-12-06 12:28:05 +01:00
|
|
|
</mat-menu>
|