Compare commits
2 Commits
bf4b219234
...
18118d021e
Author | SHA1 | Date |
---|---|---|
HardiReady | 18118d021e | |
HardiReady | a24c8d3ac3 |
|
@ -5,7 +5,6 @@ import {AppUserService} from '../services/app-user-service/app-user.service';
|
||||||
import {SquadService} from '../services/army-management/squad.service';
|
import {SquadService} from '../services/army-management/squad.service';
|
||||||
import {Fraction} from '../utils/fraction.enum';
|
import {Fraction} from '../utils/fraction.enum';
|
||||||
import {SnackBarService} from '../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../i18n/de.messages';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -47,7 +46,7 @@ export class AdminComponent implements OnInit {
|
||||||
|
|
||||||
this.appUserService.updateUser(updateObject)
|
this.appUserService.updateUser(updateObject)
|
||||||
.subscribe(resUser => {
|
.subscribe(resUser => {
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess("generic.save.success");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,21 +89,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="nav navbar-nav pull-right">
|
<ul class="nav navbar-nav pull-right">
|
||||||
<li class="dropdown">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
|
||||||
aria-expanded="false">
|
|
||||||
Language
|
|
||||||
<span class="caret"></span>
|
|
||||||
</a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a (click)="setLanguage('en')">English</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a (click)="setLanguage('de')">Deutsch</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li *ngIf="loginService.hasPermission(4)" routerLinkActive="active">
|
<li *ngIf="loginService.hasPermission(4)" routerLinkActive="active">
|
||||||
<a routerLink='{{config.adminPanelPath}}' class="link">{{'navigation.top.admin' | translate}}</a>
|
<a routerLink='{{config.adminPanelPath}}' class="link">{{'navigation.top.admin' | translate}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -113,6 +98,18 @@
|
||||||
<li *ngIf="!loginService.isLoggedIn()" routerLinkActive="active">
|
<li *ngIf="!loginService.isLoggedIn()" routerLinkActive="active">
|
||||||
<a routerLink='{{config.loginPath}}' class="link">{{'navigation.top.login' | translate}}</a>
|
<a routerLink='{{config.loginPath}}' class="link">{{'navigation.top.login' | translate}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
||||||
|
aria-expanded="false" style="padding: 12px 12px 10px 12px;">
|
||||||
|
<mat-icon svgIcon="{{(language === 'de') ? 'flag-de' : 'flag-gb'}}"></mat-icon>
|
||||||
|
<span class="caret"></span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li *ngFor="let lang of languages" style="cursor: pointer">
|
||||||
|
<a (click)="setLanguage(lang)"><mat-icon svgIcon="{{(lang === 'de') ? 'flag-de' : 'flag-gb'}}"></mat-icon></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {AwardingService} from './services/army-management/awarding.service';
|
||||||
import {RouteConfig} from './app.config';
|
import {RouteConfig} from './app.config';
|
||||||
import {DOCUMENT} from '@angular/common';
|
import {DOCUMENT} from '@angular/common';
|
||||||
import {DomSanitizer} from '@angular/platform-browser';
|
import {DomSanitizer} from '@angular/platform-browser';
|
||||||
import {MatIconRegistry} from '@angular/material';
|
import {MatIconRegistry, MatSelectChange} from '@angular/material';
|
||||||
import {SpinnerService} from './services/user-interface/spinner/spinner.service';
|
import {SpinnerService} from './services/user-interface/spinner/spinner.service';
|
||||||
import {TranslateService} from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
import {SettingsService} from './services/settings.service';
|
import {SettingsService} from './services/settings.service';
|
||||||
|
@ -55,8 +55,15 @@ export class AppComponent implements OnInit {
|
||||||
'vehicleAir': 'stats/scoreboard/vehicleAir',
|
'vehicleAir': 'stats/scoreboard/vehicleAir',
|
||||||
'vehicleHeavy': 'stats/scoreboard/vehicleHeavy',
|
'vehicleHeavy': 'stats/scoreboard/vehicleHeavy',
|
||||||
'vehicleLight': 'stats/scoreboard/vehicleLight',
|
'vehicleLight': 'stats/scoreboard/vehicleLight',
|
||||||
|
// --------LOCALE---------
|
||||||
|
'flag-de': 'locale/de',
|
||||||
|
'flag-gb': 'locale/gb',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
language;
|
||||||
|
|
||||||
|
languages = ['de', 'en'];
|
||||||
|
|
||||||
version = 'v'.concat(require('./../../../package.json').version);
|
version = 'v'.concat(require('./../../../package.json').version);
|
||||||
|
|
||||||
constructor(public loginService: LoginService,
|
constructor(public loginService: LoginService,
|
||||||
|
@ -90,7 +97,10 @@ export class AppComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.settingsService.getLanguage().subscribe((language) => this.translate.setDefaultLang(language));
|
this.settingsService.getLanguage().subscribe((language) => {
|
||||||
|
this.language = language;
|
||||||
|
this.translate.setDefaultLang(language)
|
||||||
|
});
|
||||||
if (this.loginService.hasPermission(2)) {
|
if (this.loginService.hasPermission(2)) {
|
||||||
const fraction = this.loginService.getCurrentUser().squad.fraction;
|
const fraction = this.loginService.getCurrentUser().squad.fraction;
|
||||||
this.promotionService.checkUnconfirmedPromotions(fraction);
|
this.promotionService.checkUnconfirmedPromotions(fraction);
|
||||||
|
@ -104,8 +114,7 @@ export class AppComponent implements OnInit {
|
||||||
|
|
||||||
initMaterialSvgIcons() {
|
initMaterialSvgIcons() {
|
||||||
Object.keys(this.svgIcons).forEach(key => {
|
Object.keys(this.svgIcons).forEach(key => {
|
||||||
const fileUri = '../assets/icon/'.concat(this.svgIcons[key])
|
const fileUri = '../assets/icon/'.concat(this.svgIcons[key]).concat('.svg');
|
||||||
.concat('.svg');
|
|
||||||
this.iconRegistry.addSvgIcon(key, this.sanitizer.bypassSecurityTrustResourceUrl(fileUri));
|
this.iconRegistry.addSvgIcon(key, this.sanitizer.bypassSecurityTrustResourceUrl(fileUri));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -130,6 +139,7 @@ export class AppComponent implements OnInit {
|
||||||
|
|
||||||
setLanguage(language: string) {
|
setLanguage(language: string) {
|
||||||
if (language) {
|
if (language) {
|
||||||
|
this.language = language;
|
||||||
this.settingsService.setLanguage(language);
|
this.settingsService.setLanguage(language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {CookieService} from 'ngx-cookie-service';
|
||||||
import {SnackBarService} from './services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from './services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {HttpClientModule} from '@angular/common/http';
|
import {HttpClientModule} from '@angular/common/http';
|
||||||
import {SpinnerService} from './services/user-interface/spinner/spinner.service';
|
import {SpinnerService} from './services/user-interface/spinner/spinner.service';
|
||||||
import {MatSnackBarModule} from '@angular/material';
|
import {MatSelectModule, MatSnackBarModule} from '@angular/material';
|
||||||
import {HttpClient} from './services/http-client';
|
import {HttpClient} from './services/http-client';
|
||||||
import {SettingsService} from './services/settings.service';
|
import {SettingsService} from './services/settings.service';
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ import {SettingsService} from './services/settings.service';
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
ClipboardModule,
|
ClipboardModule,
|
||||||
MatSnackBarModule,
|
MatSnackBarModule,
|
||||||
|
MatSelectModule,
|
||||||
],
|
],
|
||||||
|
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
export enum Message {
|
|
||||||
SIGN_UP_SUCCESS = 'Account erfolgreich erstellt',
|
|
||||||
SUCCESS_SAVE = 'Erfolgreich gespeichert',
|
|
||||||
DUPLICATED_NAME_ERR = 'Benutzername existiert bereits',
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@ import {Component, OnInit} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {LoginService} from '../services/app-user-service/login-service';
|
import {LoginService} from '../services/app-user-service/login-service';
|
||||||
import {RouteConfig} from '../app.config';
|
import {RouteConfig} from '../app.config';
|
||||||
import {Message} from '../i18n/de.messages';
|
|
||||||
import {SnackBarService} from '../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../services/user-interface/snack-bar/snack-bar.service';
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,11 +37,11 @@ export class SignupComponent implements OnInit {
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.snackBarService.showSuccess(Message.SIGN_UP_SUCCESS);
|
this.snackBarService.showSuccess('generic.signup.success');
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.snackBarService.showError(error, 10000);
|
this.snackBarService.showError('generic.signup.error', 6000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {DecorationService} from '../../../services/army-management/decoration.se
|
||||||
import {Subscription} from 'rxjs/Subscription';
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../../i18n/de.messages';
|
|
||||||
import {TranslateService} from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -89,7 +88,7 @@ export class EditDecorationComponent implements OnInit, OnDestroy {
|
||||||
this.imagePreviewSrc = 'resource/decoration/' + this.decoration._id + '.png?' + Date.now();
|
this.imagePreviewSrc = 'resource/decoration/' + this.decoration._id + '.png?' + Date.now();
|
||||||
}, 300);
|
}, 300);
|
||||||
fileInput.value = '';
|
fileInput.value = '';
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {Rank} from '../../../models/model-interfaces';
|
||||||
import {RankService} from '../../../services/army-management/rank.service';
|
import {RankService} from '../../../services/army-management/rank.service';
|
||||||
import {Subscription} from 'rxjs/Subscription';
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
import {Message} from '../../../i18n/de.messages';
|
|
||||||
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {TranslateService} from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
|
@ -93,7 +92,7 @@ export class EditRankComponent implements OnInit, OnDestroy {
|
||||||
this.imagePreviewSrc = 'resource/rank/' + this.rank._id + '.png?' + Date.now();
|
this.imagePreviewSrc = 'resource/rank/' + this.rank._id + '.png?' + Date.now();
|
||||||
}, 300);
|
}, 300);
|
||||||
fileInput.value = '';
|
fileInput.value = '';
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {SquadService} from '../../../services/army-management/squad.service';
|
||||||
import {Subscription} from 'rxjs/Subscription';
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../../i18n/de.messages';
|
|
||||||
import {TranslateService} from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +92,7 @@ export class EditSquadComponent implements OnInit, OnDestroy {
|
||||||
this.imagePreviewSrc = 'resource/squad/' + this.squad._id + '.png?' + Date.now();
|
this.imagePreviewSrc = 'resource/squad/' + this.squad._id + '.png?' + Date.now();
|
||||||
}, 300);
|
}, 300);
|
||||||
fileInput.value = '';
|
fileInput.value = '';
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {AwardingService} from '../../../services/army-management/awarding.servic
|
||||||
import {DecorationService} from '../../../services/army-management/decoration.service';
|
import {DecorationService} from '../../../services/army-management/decoration.service';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../../i18n/de.messages';
|
|
||||||
import {TranslateService} from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +94,7 @@ export class AwardUserComponent implements OnInit {
|
||||||
this.decoPreviewDisplay = 'none';
|
this.decoPreviewDisplay = 'none';
|
||||||
decorationField.value = undefined;
|
decorationField.value = undefined;
|
||||||
reasonField.value = previewImage.src = descriptionField.innerHTML = '';
|
reasonField.value = previewImage.src = descriptionField.innerHTML = '';
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -113,7 +112,7 @@ export class AwardUserComponent implements OnInit {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import {Subscription} from 'rxjs/Subscription';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {Fraction} from '../../../utils/fraction.enum';
|
import {Fraction} from '../../../utils/fraction.enum';
|
||||||
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../../i18n/de.messages';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -100,18 +99,18 @@ export class EditUserComponent implements OnInit {
|
||||||
user.squad = '0';
|
user.squad = '0';
|
||||||
}
|
}
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.userService.submitUser(updateObject)
|
this.userService.submitUser(updateObject)
|
||||||
.subscribe(user => {
|
.subscribe(user => {
|
||||||
this.router.navigate(['..'], {relativeTo: this.route});
|
this.router.navigate(['..'], {relativeTo: this.route});
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
// duplicated user error message
|
// duplicated user error message
|
||||||
const errorMessage = error._body.includes('duplicate') ? Message.DUPLICATED_NAME_ERR : error._body;
|
const errorMessage = error._body.includes('duplicate') ? 'generic.signup.error.duplicate' : error._body;
|
||||||
this.snackBarService.showError(errorMessage, 10000);
|
this.snackBarService.showError(errorMessage, 10000);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import {DecorationService} from '../../services/army-management/decoration.servi
|
||||||
import {UserService} from '../../services/army-management/user.service';
|
import {UserService} from '../../services/army-management/user.service';
|
||||||
import {LoginService} from '../../services/app-user-service/login-service';
|
import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../i18n/de.messages';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -94,7 +93,7 @@ export class RequestAwardComponent implements OnInit {
|
||||||
this.decoration = {_id: '0'};
|
this.decoration = {_id: '0'};
|
||||||
this.reason = previewImage.src = descriptionField.innerHTML = '';
|
this.reason = previewImage.src = descriptionField.innerHTML = '';
|
||||||
this.decoPreviewDisplay = 'none';
|
this.decoPreviewDisplay = 'none';
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ import {Award} from '../../models/model-interfaces';
|
||||||
import {AwardingService} from '../../services/army-management/awarding.service';
|
import {AwardingService} from '../../services/army-management/awarding.service';
|
||||||
import {LoginService} from '../../services/app-user-service/login-service';
|
import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../i18n/de.messages';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -47,7 +46,7 @@ export class ConfirmAwardComponent implements OnInit {
|
||||||
if (awards.length < 1) {
|
if (awards.length < 1) {
|
||||||
this.awardingService.hasUnprocessedAwards = false;
|
this.awardingService.hasUnprocessedAwards = false;
|
||||||
}
|
}
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import {RankService} from '../../services/army-management/rank.service';
|
||||||
import {PromotionService} from '../../services/army-management/promotion.service';
|
import {PromotionService} from '../../services/army-management/promotion.service';
|
||||||
import {LoginService} from '../../services/app-user-service/login-service';
|
import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
import {Message} from '../../i18n/de.messages';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -51,7 +50,7 @@ export class ConfirmPromotionComponent implements OnInit {
|
||||||
if (promotions.length < 1) {
|
if (promotions.length < 1) {
|
||||||
this.promotionService.hasUnprocessedPromotion = false;
|
this.promotionService.hasUnprocessedPromotion = false;
|
||||||
}
|
}
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {UserService} from '../../services/army-management/user.service';
|
||||||
import {RankService} from '../../services/army-management/rank.service';
|
import {RankService} from '../../services/army-management/rank.service';
|
||||||
import {PromotionService} from '../../services/army-management/promotion.service';
|
import {PromotionService} from '../../services/army-management/promotion.service';
|
||||||
import {LoginService} from '../../services/app-user-service/login-service';
|
import {LoginService} from '../../services/app-user-service/login-service';
|
||||||
import {Message} from '../../i18n/de.messages';
|
|
||||||
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +79,7 @@ export class RequestPromotionComponent implements OnInit {
|
||||||
this.uncheckedPromotions = promotions;
|
this.uncheckedPromotions = promotions;
|
||||||
this.showForm = false;
|
this.showForm = false;
|
||||||
this.user = {_id: '0'};
|
this.user = {_id: '0'};
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {MatSnackBar, MatSnackBarRef} from '@angular/material/snack-bar';
|
import {MatSnackBar, MatSnackBarRef} from '@angular/material/snack-bar';
|
||||||
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SnackBarService {
|
export class SnackBarService {
|
||||||
constructor(private snackbar: MatSnackBar) {
|
constructor(private snackbar: MatSnackBar,
|
||||||
|
private translate: TranslateService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private show(message: string, action?: string, duration?: number, panelClasses?: string[]): MatSnackBarRef<any> {
|
private show(message: string, action?: string, duration?: number, panelClasses?: string[]): MatSnackBarRef<any> {
|
||||||
|
@ -27,11 +29,17 @@ export class SnackBarService {
|
||||||
return this.snackbar.open(message, action, config);
|
return this.snackbar.open(message, action, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
showSuccess(message: string) {
|
showSuccess(i18n: string) {
|
||||||
return this.show(message, undefined, 2500, ['custom-snack-bar', 'label-success']);
|
this.translate.get(i18n).subscribe((translated) => {
|
||||||
|
return this.show(translated, undefined, 2500, ['custom-snack-bar', 'label-success']);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
showError(message: string, duration?: number) {
|
showError(i18n: string, duration?: number) {
|
||||||
return this.show(message, 'OK', duration, ['custom-snack-bar', 'label-danger']);
|
this.translate.get(i18n).subscribe((translated) => {
|
||||||
|
this.translate.get('generic.snackbar.error.button.okay').subscribe((translatedOkay) => {
|
||||||
|
return this.show(translated, translatedOkay, duration, ['custom-snack-bar', 'label-danger']);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import {NgForm} from '@angular/forms';
|
||||||
import {Subscription} from 'rxjs/Subscription';
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
import {Campaign} from '../../../models/model-interfaces';
|
import {Campaign} from '../../../models/model-interfaces';
|
||||||
import {CampaignService} from '../../../services/logs/campaign.service';
|
import {CampaignService} from '../../../services/logs/campaign.service';
|
||||||
import {Message} from '../../../i18n/de.messages';
|
|
||||||
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +40,7 @@ export class CampaignSubmitComponent {
|
||||||
if (this.campaign._id) {
|
if (this.campaign._id) {
|
||||||
redirectSuccessUrl = '../' + redirectSuccessUrl;
|
redirectSuccessUrl = '../' + redirectSuccessUrl;
|
||||||
}
|
}
|
||||||
this.snackBarService.showSuccess(Message.SUCCESS_SAVE);
|
this.snackBarService.showSuccess('generic.save.success');
|
||||||
this.router.navigate([redirectSuccessUrl + campaign._id], {relativeTo: this.route});
|
this.router.navigate([redirectSuccessUrl + campaign._id], {relativeTo: this.route});
|
||||||
},
|
},
|
||||||
error => this.snackBarService.showError(error._body.error.message, 15000));
|
error => this.snackBarService.showError(error._body.error.message, 15000));
|
||||||
|
|
|
@ -49,5 +49,11 @@
|
||||||
"public.army.member.headline": "Auszeichnungen von {{name}}",
|
"public.army.member.headline": "Auszeichnungen von {{name}}",
|
||||||
"public.army.member.awards.title": "Bezeichnung",
|
"public.army.member.awards.title": "Bezeichnung",
|
||||||
"public.army.member.awards.reason": "Begründung",
|
"public.army.member.awards.reason": "Begründung",
|
||||||
"public.army.member.awards.date": "Verliehen am"
|
"public.army.member.awards.date": "Verliehen am",
|
||||||
|
|
||||||
|
"generic.save.success": "Erfolgreich gespeichert",
|
||||||
|
"generic.snackbar.error.button.okay": "OK",
|
||||||
|
"generic.signup.success": "Account erfolgreich erstellt",
|
||||||
|
"generic.signup.error.duplicate": "Benutzername existiert bereits",
|
||||||
|
"generic.signup.error": "Es ist ein Fehler aufgetreten"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
"public.error.message.default": "{{fieldName}} is not valid",
|
"public.error.message.default": "{{fieldName}} is not valid",
|
||||||
"public.common.search.button": "Search",
|
"public.common.search.button": "Search",
|
||||||
|
|
||||||
"navigation.top.board": "To message board",
|
"navigation.top.board": "To Message Board",
|
||||||
"navigation.top.overview": "Army Overview",
|
"navigation.top.overview": "Army Overview",
|
||||||
"navigation.top.ranks": "Ranks",
|
"navigation.top.ranks": "Ranks",
|
||||||
"navigation.top.decorations": "Awards",
|
"navigation.top.decorations": "Decorations",
|
||||||
"navigation.top.statistics": "Statistics",
|
"navigation.top.statistics": "Statistics",
|
||||||
"navigation.top.login": "Login",
|
"navigation.top.login": "Login",
|
||||||
"navigation.top.logout": "Logout",
|
"navigation.top.logout": "Logout",
|
||||||
|
@ -48,5 +48,11 @@
|
||||||
"public.army.member.headline": "Awards of {{name}}",
|
"public.army.member.headline": "Awards of {{name}}",
|
||||||
"public.army.member.awards.title": "Title",
|
"public.army.member.awards.title": "Title",
|
||||||
"public.army.member.awards.reason": "Reason",
|
"public.army.member.awards.reason": "Reason",
|
||||||
"public.army.member.awards.date": "Decorated at"
|
"public.army.member.awards.date": "Decorated at",
|
||||||
|
|
||||||
|
"generic.save.success": "Saved successfully",
|
||||||
|
"generic.snackbar.error.button.okay": "OK",
|
||||||
|
"generic.signup.success": "Account creation successful",
|
||||||
|
"generic.signup.error.duplicate": "Username does already exist",
|
||||||
|
"generic.signup.error": "An error occurred"
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"stats.sidebar.overview": "Overview",
|
"stats.sidebar.overview": "Overview",
|
||||||
"stats.sidebar.highscore": "Highscore",
|
"stats.sidebar.highscore": "Highscore",
|
||||||
"stats.sidebar.battles": "Battles",
|
"stats.sidebar.battles": "Battles",
|
||||||
"stats.sidebar.battles.battle.from.date": "at",
|
"stats.sidebar.battles.battle.from.date": "of",
|
||||||
"stats.sidebar.battle.manage.edit": "Edit",
|
"stats.sidebar.battle.manage.edit": "Edit",
|
||||||
"stats.sidebar.battle.manage.delete": "Delete",
|
"stats.sidebar.battle.manage.delete": "Delete",
|
||||||
"stats.sidebar.battle.manage.delete.confirm": "Do you really want to delete the battle \"{{title}}\"?",
|
"stats.sidebar.battle.manage.delete.confirm": "Do you really want to delete the battle \"{{title}}\"?",
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icon-css-de" viewBox="0 0 640 480">
|
||||||
|
<path fill="#ffce00" d="M0 320h640v160H0z"/>
|
||||||
|
<path fill="#000" d="M0 0h640v160H0z"/>
|
||||||
|
<path fill="#d00" d="M0 160h640v160H0z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 225 B |
|
@ -0,0 +1,15 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icon-css-gb" viewBox="0 0 640 480">
|
||||||
|
<defs>
|
||||||
|
<clipPath id="a">
|
||||||
|
<path fill-opacity=".7" d="M-85.3 0h682.6v512H-85.3z"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<g clip-path="url(#a)" transform="translate(80) scale(.94)">
|
||||||
|
<g stroke-width="1pt">
|
||||||
|
<path fill="#006" d="M-256 0H768v512H-256z"/>
|
||||||
|
<path fill="#fff" d="M-256 0v57.2L653.5 512H768v-57.2L-141.5 0H-256zM768 0v57.2L-141.5 512H-256v-57.2L653.5 0H768z"/>
|
||||||
|
<path fill="#fff" d="M170.7 0v512h170.6V0H170.7zM-256 170.7v170.6H768V170.7H-256z"/>
|
||||||
|
<path fill="#c00" d="M-256 204.8v102.4H768V204.8H-256zM204.8 0v512h102.4V0H204.8zM-256 512L85.3 341.3h76.4L-179.7 512H-256zm0-512L85.3 170.7H9L-256 38.2V0zm606.4 170.7L691.7 0H768L426.7 170.7h-76.3zM768 512L426.7 341.3H503l265 132.5V512z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 831 B |
Loading…
Reference in New Issue