Merge pull request #4782 from GabrielInTheWorld/tab-title-more

Sets more tab title
This commit is contained in:
Emanuel Schütze 2019-06-18 19:44:22 +02:00 committed by GitHub
commit 7dd59cc477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 8 deletions

View File

@ -248,6 +248,7 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit
this.closSubscription = this.listOfSpeakersRepo.getViewModelObservable(id).subscribe(listOfSpeakers => {
if (listOfSpeakers) {
super.setTitle(listOfSpeakers.getTitle() + ` - ${this.translate.instant('List of speakers')}`);
this.viewListOfSpeakers = listOfSpeakers;
const allSpeakers = this.viewListOfSpeakers.speakers.sort((a, b) => a.weight - b.weight);
this.speakers = allSpeakers.filter(speaker => speaker.state === SpeakerState.WAITING);

View File

@ -1,13 +1,24 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { OpenSlidesService } from 'app/core/core-services/openslides.service';
import { UpdateService } from 'app/core/ui-services/update.service';
import { Title } from '@angular/platform-browser';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'os-legal-notice',
templateUrl: './legal-notice.component.html'
})
export class LegalNoticeComponent {
public constructor(private openSlidesService: OpenSlidesService, private update: UpdateService) {}
export class LegalNoticeComponent implements OnInit {
public constructor(
private openSlidesService: OpenSlidesService,
private update: UpdateService,
private titleService: Title,
private translate: TranslateService
) {}
public ngOnInit(): void {
this.titleService.setTitle(this.translate.instant('Legal notice'));
}
public resetCache(): void {
this.openSlidesService.reset();

View File

@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'os-privacy-policy',
@ -6,7 +8,9 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./privacy-policy.component.scss']
})
export class PrivacyPolicyComponent implements OnInit {
public constructor() {}
public constructor(private titleService: Title, private translate: TranslateService) {}
public ngOnInit(): void {}
public ngOnInit(): void {
this.titleService.setTitle(this.translate.instant('Privacy policy'));
}
}

View File

@ -93,7 +93,6 @@ export class CategoryDetailComponent extends BaseViewComponent implements OnInit
* Sets the title, observes the block and the motions belonging in this block
*/
public ngOnInit(): void {
super.setTitle('Category');
const selectedCategoryId = parseInt(this.route.snapshot.params.id, 10);
this.subscriptions.push(
@ -108,6 +107,8 @@ export class CategoryDetailComponent extends BaseViewComponent implements OnInit
// Find index of last child. THis can be easily done by searching, becuase this
// is the flat sorted tree
this.selectedCategory = categories[selectedCategoryIndex];
super.setTitle(this.selectedCategory.prefixedName);
let lastChildIndex: number;
for (
lastChildIndex = selectedCategoryIndex + 1;

View File

@ -12,9 +12,9 @@
</div>
</os-head-bar>
<!-- Creating a new motion block -->
<!-- Creating a new category -->
<mat-card class="os-card" *ngIf="isCreatingNewCategory">
<mat-card-title translate>New motion block</mat-card-title>
<mat-card-title>New category</mat-card-title>
<mat-card-content>
<form [formGroup]="createForm" (keydown)="onKeyDown($event)">
<!-- Prefix -->

View File

@ -123,6 +123,7 @@ export class MotionBlockDetailComponent extends BaseViewComponent implements OnI
this.subscriptions.push(
this.repo.getViewModelObservable(blockId).subscribe(newBlock => {
if (newBlock) {
super.setTitle(newBlock.getTitle());
this.block = newBlock;
this.dataSource = createDS<ViewMotion>()

View File

@ -81,6 +81,7 @@ export class PasswordComponent extends BaseViewComponent implements OnInit {
* Initializes the forms and some of the frontend options
*/
public ngOnInit(): void {
super.setTitle(this.translate.instant('Change password'));
this.route.params.subscribe(params => {
if (params.id) {
this.urlUserId = +params.id;