Corrects the permission-handling

- Projector-controls aren't seen, if no permission 'can_manage'
- The 'more options'-menu is removed
- New config option: Hide amount of speakers in list of speakers slide subtitle.
This commit is contained in:
GabrielMeyer 2019-07-05 16:35:32 +02:00 committed by Emanuel Schütze
parent 3cd9c5497c
commit 7e9190ea84
5 changed files with 37 additions and 7 deletions

View File

@ -13,7 +13,7 @@
</div>
</a>
<!-- Controls under the projector preview -->
<div class="control-group projector-controls">
<div *osPerms="'core.can_manage_projector'" class="control-group projector-controls">
<!-- scale up -->
<button type="button" mat-icon-button (click)="scale(scrollScaleDirection.Up)">
<mat-icon>zoom_in</mat-icon>

View File

@ -17,7 +17,7 @@
</div>
<!-- Menu -->
<div class="menu-slot">
<div class="menu-slot" *osPerms="'agenda.can_manage'">
<button type="button" mat-icon-button [matMenuTriggerFor]="topicExtraMenu">
<mat-icon>more_vert</mat-icon>
</button>
@ -107,7 +107,7 @@
<mat-menu #topicExtraMenu="matMenu">
<os-speaker-button [object]="topic" [menuItem]="true"></os-speaker-button>
<div *osPerms="'agenda.can_manage'">
<div>
<mat-divider></mat-divider>
<button mat-menu-item class="red-warning-text" (click)="onDeleteButton()">
<mat-icon>delete</mat-icon>

View File

@ -3,7 +3,7 @@
<h1 translate>List of speakers</h1>
<h2>
{{ getTitle() }}
<span *ngIf="getSpeakersCount() > 0">
<span *ngIf="getSpeakersCount() > 0 && !hideAmountOfSpeakers">
&ndash; {{ getSpeakersCount() }} <span translate>Speakers</span>
</span>
</h2>

View File

@ -1,20 +1,40 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { BaseSlideComponent } from 'app/slides/base-slide-component';
import { CommonListOfSpeakersSlideData } from './common-list-of-speakers-slide-data';
import { CollectionStringMapperService } from 'app/core/core-services/collection-string-mapper.service';
import { isBaseIsAgendaItemContentObjectRepository } from 'app/core/repositories/base-is-agenda-item-content-object-repository';
import { ConfigService } from 'app/core/ui-services/config.service';
@Component({
selector: 'os-common-list-of-speakers-slide',
templateUrl: './common-list-of-speakers-slide.component.html',
styleUrls: ['./common-list-of-speakers-slide.component.scss']
})
export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<CommonListOfSpeakersSlideData> {
public constructor(private collectionStringMapperService: CollectionStringMapperService) {
export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<CommonListOfSpeakersSlideData>
implements OnInit {
/**
* Boolean, whether the amount of speakers should be shown.
*/
public hideAmountOfSpeakers: boolean;
public constructor(
private collectionStringMapperService: CollectionStringMapperService,
private configService: ConfigService
) {
super();
}
/**
* OnInit-function.
* Load the config for `agenda_hide_amount_of_speakers`.
*/
public ngOnInit(): void {
this.configService
.get<boolean>('agenda_hide_amount_of_speakers')
.subscribe(enabled => (this.hideAmountOfSpeakers = enabled));
}
public getTitle(): string {
if (!this.data.data.content_object_collection || !this.data.data.title_information) {
return '';

View File

@ -121,6 +121,16 @@ def get_config_variables():
validators=(MinValueValidator(0),),
)
yield ConfigVariable(
name="agenda_hide_amount_of_speakers",
default_value=False,
input_type="boolean",
label="Hide the amount of speakers in subtitle of list of speakers slide",
weight=236,
group="Agenda",
subgroup="List of speakers",
)
yield ConfigVariable(
name="agenda_couple_countdown_and_speakers",
default_value=False,