Merge pull request #4825 from GabrielInTheWorld/fixPermissions

Corrects the permission-handling
This commit is contained in:
Emanuel Schütze 2019-07-08 09:52:33 +02:00 committed by GitHub
commit 1a31fc9068
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 7 deletions

View File

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

View File

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

View File

@ -3,7 +3,7 @@
<h1 translate>List of speakers</h1> <h1 translate>List of speakers</h1>
<h2> <h2>
{{ getTitle() }} {{ getTitle() }}
<span *ngIf="getSpeakersCount() > 0"> <span *ngIf="getSpeakersCount() > 0 && !hideAmountOfSpeakers">
&ndash; {{ getSpeakersCount() }} <span translate>Speakers</span> &ndash; {{ getSpeakersCount() }} <span translate>Speakers</span>
</span> </span>
</h2> </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 { BaseSlideComponent } from 'app/slides/base-slide-component';
import { CommonListOfSpeakersSlideData } from './common-list-of-speakers-slide-data'; import { CommonListOfSpeakersSlideData } from './common-list-of-speakers-slide-data';
import { CollectionStringMapperService } from 'app/core/core-services/collection-string-mapper.service'; 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 { isBaseIsAgendaItemContentObjectRepository } from 'app/core/repositories/base-is-agenda-item-content-object-repository';
import { ConfigService } from 'app/core/ui-services/config.service';
@Component({ @Component({
selector: 'os-common-list-of-speakers-slide', selector: 'os-common-list-of-speakers-slide',
templateUrl: './common-list-of-speakers-slide.component.html', templateUrl: './common-list-of-speakers-slide.component.html',
styleUrls: ['./common-list-of-speakers-slide.component.scss'] styleUrls: ['./common-list-of-speakers-slide.component.scss']
}) })
export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<CommonListOfSpeakersSlideData> { export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<CommonListOfSpeakersSlideData>
public constructor(private collectionStringMapperService: CollectionStringMapperService) { implements OnInit {
/**
* Boolean, whether the amount of speakers should be shown.
*/
public hideAmountOfSpeakers: boolean;
public constructor(
private collectionStringMapperService: CollectionStringMapperService,
private configService: ConfigService
) {
super(); 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 { public getTitle(): string {
if (!this.data.data.content_object_collection || !this.data.data.title_information) { if (!this.data.data.content_object_collection || !this.data.data.title_information) {
return ''; return '';

View File

@ -121,6 +121,16 @@ def get_config_variables():
validators=(MinValueValidator(0),), 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( yield ConfigVariable(
name="agenda_couple_countdown_and_speakers", name="agenda_couple_countdown_and_speakers",
default_value=False, default_value=False,