Compare commits

..

6 Commits

73 changed files with 849 additions and 290 deletions

View File

@ -3,13 +3,13 @@
<div class="return-button"> <div class="return-button">
<button mat-raised-button (click)="backToOverview()"> <button mat-raised-button (click)="backToOverview()">
<mat-icon svgIcon="chevron-left"></mat-icon> <mat-icon svgIcon="chevron-left"></mat-icon>
Zurück {{'public.army.member.button.back' | translate}}
</button> </button>
</div> </div>
<h3 class="text-center" style="font-weight: 600" <h3 class="text-center" style="font-weight: 600"
[style.color]="user.squadId?.fraction === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="user.squadId?.fraction === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
Auszeichnungen von {{user.username}} {{'public.army.member.headline' | translate:{name: user.username} }}
</h3> </h3>
<div class="text-center"> <div class="text-center">
@ -19,7 +19,9 @@
<input type="text" style="background: white;" class="form-control" [(ngModel)]="signatureUrl" readonly> <input type="text" style="background: white;" class="form-control" [(ngModel)]="signatureUrl" readonly>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" [class.btn-success]="isCopied" type="button" <button class="btn btn-default" [class.btn-success]="isCopied" type="button"
ngxClipboard [cbContent]="signatureUrl" (cbOnSuccess)="isCopied = true">kopieren</button> ngxClipboard [cbContent]="signatureUrl" (cbOnSuccess)="isCopied = true">
{{'public.army.member.button.copy' | translate}}
</button>
</span> </span>
</div> </div>
@ -29,9 +31,11 @@
<thead> <thead>
<tr class="table-head"> <tr class="table-head">
<th class="col-sm-1" style="border-radius: 10px 0 0 0;"></th> <th class="col-sm-1" style="border-radius: 10px 0 0 0;"></th>
<th class="col-sm-2">Bezeichnung</th> <th class="col-sm-2">{{'public.army.member.awards.title' | translate}}</th>
<th class="col-sm-2">Begründung</th> <th class="col-sm-2">{{'public.army.member.awards.reason' | translate}}</th>
<th class="col-sm-1 text-right" style="border-radius: 0 10px 0 0;">Verliehen am</th> <th class="col-sm-1 text-right" style="border-radius: 0 10px 0 0;">
{{'public.army.member.awards.date' | translate}}
</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let award of awards"> <tbody *ngFor="let award of awards">
@ -55,7 +59,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,6 @@
import {Component, Input} from '@angular/core'; import {Component, Input, OnInit} from '@angular/core';
import {FormGroup, NgForm} from '@angular/forms'; import {FormGroup, NgForm} from '@angular/forms';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'show-error', selector: 'show-error',
@ -10,7 +11,7 @@ import {FormGroup, NgForm} from '@angular/forms';
</div> </div>
</div>` </div>`
}) })
export class ShowErrorComponent { export class ShowErrorComponent implements OnInit {
// tslint:disable-next-line:no-input-rename // tslint:disable-next-line:no-input-rename
@Input('controlPath') controlPath; @Input('controlPath') controlPath;
@ -20,10 +21,15 @@ export class ShowErrorComponent {
private form: FormGroup; private form: FormGroup;
constructor(ngForm: NgForm) { constructor(ngForm: NgForm,
private translate: TranslateService) {
this.form = ngForm.form; this.form = ngForm.form;
} }
ngOnInit() {
this.translate.setDefaultLang('de');
}
get errorMessages(): string[] { get errorMessages(): string[] {
const control = this.form.get(this.controlPath); const control = this.form.get(this.controlPath);
const messages = []; const messages = [];
@ -37,22 +43,43 @@ export class ShowErrorComponent {
let message = ''; let message = '';
switch (code) { switch (code) {
case 'required': case 'required':
message = `${this.displayName} ist ein Pflichtfeld`; this.translate.get('public.error.message.required', {fieldName: this.displayName})
.subscribe((res: string) => {
message = res;
});
break; break;
case 'minlength': case 'minlength':
message = `${this.displayName} muss mindestens ${error.requiredLength} Zeichen enthalten`; this.translate.get('public.error.message.min.length', {
fieldName: this.displayName,
boundary: error.requiredLength
})
.subscribe((res: string) => {
message = res;
});
break; break;
case 'maxlength': case 'maxlength':
message = `${this.displayName} darf maximal ${error.requiredLength} Zeichen enthalten`; this.translate.get('public.error.message.max.length', {
fieldName: this.displayName,
boundary: error.requiredLength
})
.subscribe((res: string) => {
message = res;
});
break; break;
case 'invalidEMail': case 'invalidEMail':
message = `Bitte geben Sie eine gültige E-Mail Adresse an`; this.translate.get('public.error.message.email').subscribe((res: string) => {
message = res;
});
break; break;
case 'userNotFound': case 'userNotFound':
message = `Der eingetragene Benutzer existiert nicht.`; this.translate.get('public.error.message.no.user').subscribe((res: string) => {
message = res;
});
break; break;
default: default:
message = `${name} ist nicht valide`; this.translate.get('public.error.message.default', {fieldName: name}).subscribe((res: string) => {
message = res;
});
} }
messages.push(message); messages.push(message);
} }

View File

@ -1,12 +1,13 @@
<div class="input-group list-header pull-left"> <div class="input-group list-header pull-left">
<mat-button-toggle-group #group="matButtonToggleGroup"> <mat-button-toggle-group #group="matButtonToggleGroup">
<mat-button-toggle *ngFor="let button of filterButtons" value="{{button.value}}" (change)="execute(group)"> <mat-button-toggle *ngFor="let button of filterButtons" value="{{button.value}}" (change)="execute(group)">
{{button.label}} <span *ngIf="button.label !== fraction.BLUFOR && button.label !== fraction.OPFOR">{{button.label | translate}}</span>
<span *ngIf="button.label === fraction.BLUFOR || button.label === fraction.OPFOR">{{button.label}}</span>
</mat-button-toggle> </mat-button-toggle>
</mat-button-toggle-group> </mat-button-toggle-group>
<button mat-icon-button <button mat-icon-button
class="add-btn" class="add-btn"
matTooltip="{{addButton.tooltip}}" matTooltip="{{addButton.tooltip | translate}}"
(click)="add()"> (click)="add()">
<mat-icon svgIcon="{{addButton.svgIcon}}"> <mat-icon svgIcon="{{addButton.svgIcon}}">
</mat-icon> </mat-icon>

View File

@ -1,4 +1,5 @@
import {Component, EventEmitter, Input, Output} from '@angular/core'; import {Component, EventEmitter, Input, Output} from '@angular/core';
import {Fraction} from '../../../utils/fraction.enum';
@Component({ @Component({
selector: 'cc-list-filter', selector: 'cc-list-filter',
@ -15,6 +16,8 @@ export class ListFilterComponent {
@Output() openAddFrom = new EventEmitter(); @Output() openAddFrom = new EventEmitter();
readonly fraction = Fraction;
constructor() { constructor() {
} }

View File

@ -6,7 +6,7 @@
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type="button" <button class="btn btn-default" type="button"
(click)="emitSearch()"> (click)="emitSearch()">
Suchen {{'public.common.search.button' | translate}}
</button> </button>
</span> </span>
</div> </div>

View File

@ -8,8 +8,8 @@
<br> <br>
<small *ngIf="decoration.fraction == 'OPFOR'">{{fraction.OPFOR}}</small> <small *ngIf="decoration.fraction == 'OPFOR'">{{fraction.OPFOR}}</small>
<small *ngIf="decoration.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="decoration.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small>
<small *ngIf="decoration.fraction == 'GLOBAL'">Global</small> <small *ngIf="decoration.fraction == 'GLOBAL'">{{'decorations.list.filter.global' | translate}}</small>
<small> - Sortierung: {{decoration.sortingNumber}}</small> <small>{{'decorations.item.label.sort' | translate:{value: decoration.sortingNumber} }}</small>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
@ -18,7 +18,8 @@
[style.max-width]="imgStyle.width" [style.max-width]="imgStyle.width"
[style.margin-top]="imgStyle.marginTop" [style.margin-top]="imgStyle.marginTop"
class="decoration-list-preview"> class="decoration-list-preview">
<span (click)="delete(); $event.stopPropagation()" matTooltip="Löschen" class="glyphicon glyphicon-trash trash"></span> <span (click)="delete(); $event.stopPropagation()" matTooltip="{{'decorations.list.button.delete' | translate}}"
class="glyphicon glyphicon-trash trash"></span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,8 +2,8 @@
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}, {label: fraction.OPFOR, value: 'OPFOR'},
{label: 'Global', value: 'GLOBAL'}]" {label: 'decorations.list.filter.global', value: 'GLOBAL'}]"
[addButton]="{svgIcon: 'add', tooltip: 'Neue Auszeichnung hinzufügen'}" [addButton]="{svgIcon: 'add', tooltip: 'decorations.list.button.add'}"
(executeSearch)="filterDecorations($event)" (executeSearch)="filterDecorations($event)"
(openAddFrom)="openNewDecorationForm()"> (openAddFrom)="openNewDecorationForm()">
</cc-list-filter> </cc-list-filter>

View File

@ -8,6 +8,7 @@ import {DecorationService} from '../../services/army-management/decoration.servi
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {MatButtonToggleGroup} from '@angular/material'; import {MatButtonToggleGroup} from '@angular/material';
import {UIHelpers} from '../../utils/global.helpers'; import {UIHelpers} from '../../utils/global.helpers';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'cc-decoration-list', selector: 'cc-decoration-list',
@ -28,7 +29,8 @@ export class DecorationListComponent implements OnInit {
constructor(private decorationService: DecorationService, constructor(private decorationService: DecorationService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -60,11 +62,16 @@ export class DecorationListComponent implements OnInit {
fraction = Fraction.OPFOR; fraction = Fraction.OPFOR;
} }
if (confirm('Soll die Auszeichnung "' + decoration.name + '" (' + fraction + ') wirklich gelöscht werden?')) { this.translate.get('decorations.list.delete.confirm', {
name: decoration.name,
fraction: fraction
}).subscribe((confirmQuestion) => {
if (confirm(confirmQuestion)) {
this.decorationService.deleteDecoration(decoration) this.decorationService.deleteDecoration(decoration)
.subscribe((res) => { .subscribe((res) => {
}); });
} }
})
} }
filterDecorations(group?: MatButtonToggleGroup) { filterDecorations(group?: MatButtonToggleGroup) {

View File

@ -4,11 +4,35 @@ import {CommonModule} from '@angular/common';
import {DecorationStore} from '../services/stores/decoration.store'; import {DecorationStore} from '../services/stores/decoration.store';
import {DecorationService} from '../services/army-management/decoration.service'; import {DecorationService} from '../services/army-management/decoration.service';
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {HttpClient} from '@angular/common/http';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/decorations/', '.json');
}
@NgModule({ @NgModule({
declarations: decorationsRoutingComponents, declarations: decorationsRoutingComponents,
imports: [CommonModule, SharedModule, decorationRoutesModule],
providers: [DecorationStore, DecorationService] imports: [
CommonModule,
SharedModule,
decorationRoutesModule,
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
isolate: true
})],
providers: [
DecorationStore,
DecorationService
]
}) })
export class DecorationsModule { export class DecorationsModule {
static routes = decorationRoutesModule; static routes = decorationRoutesModule;

View File

@ -3,8 +3,13 @@ import {DecorationListComponent} from './decoration-list/decoration-list.compone
import {EditDecorationComponent} from './edit-decoration/edit-decoration.component'; import {EditDecorationComponent} from './edit-decoration/edit-decoration.component';
import {ModuleWithProviders} from '@angular/core'; import {ModuleWithProviders} from '@angular/core';
import {DecorationItemComponent} from './decoration-list/decoration-item.component'; import {DecorationItemComponent} from './decoration-list/decoration-item.component';
import {DecorationsComponent} from './decorations.component';
export const decorationsRoutes: Routes = [ export const decorationsRoutes: Routes = [
{
path: '',
component: DecorationsComponent,
},
{ {
path: '', path: '',
component: DecorationListComponent, component: DecorationListComponent,
@ -23,5 +28,6 @@ export const decorationsRoutes: Routes = [
export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes); export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes);
export const decorationsRoutingComponents = [DecorationItemComponent, DecorationListComponent, EditDecorationComponent]; export const decorationsRoutingComponents = [DecorationsComponent, DecorationItemComponent, DecorationListComponent,
EditDecorationComponent];

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-decorations-root',
templateUrl: './decorations.component.html',
styleUrls: ['./decorations.component.scss']
})
export class DecorationsComponent {
constructor(private translate: TranslateService) {
translate.setDefaultLang('de');
}
}

View File

@ -1,63 +1,63 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3 *ngIf="decoration._id">Auszeichnung editieren</h3> <h3 *ngIf="decoration._id">{{'decorations.submit.headline.edit' | translate}}</h3>
<h3 *ngIf="!decoration._id">Neue Auszeichnung hinzufügen</h3> <h3 *ngIf="!decoration._id">{{'decorations.submit.headline.new' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="title">Name</label> <label for="title">{{'decorations.submit.field.name' | translate}}</label>
<input type="text" class="form-control" <input type="text" class="form-control"
[(ngModel)]="decoration.name" [(ngModel)]="decoration.name"
name="title" name="title"
id="title" id="title"
required maxlength="50"/> required maxlength="50"/>
<show-error displayName="Name" controlPath="title"></show-error> <show-error displayName="{{'decorations.submit.field.name' | translate}}" controlPath="title"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="fraction">Fraktion</label> <label for="fraction">{{'decorations.submit.field.fraction' | translate}}</label>
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle" <select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="decoration.fraction"> [(ngModel)]="decoration.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">{{fraction.OPFOR}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">{{fraction.BLUFOR}}</option>
<option value="GLOBAL">Global</option> <option value="GLOBAL">{{'decorations.submit.field.fraction.global' | translate}}</option>
</select> </select>
<show-error displayName="Fraktion" controlPath="fraction"></show-error> <show-error displayName="{{'decorations.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="type">Art</label> <label for="type">{{'decorations.submit.field.type' | translate}}</label>
<select id="type" name="type" class="form-control btn dropdown-toggle" <select id="type" name="type" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="decoration.isMedal"> [(ngModel)]="decoration.isMedal">
<option value="true">Orden</option> <option value="true">{{'decorations.submit.field.type.medal' | translate}}</option>
<option value="false">Ribbon</option> <option value="false">{{'decorations.submit.field.type.ribbon' | translate}}</option>
</select> </select>
<show-error displayName="Art" controlPath="type"></show-error> <show-error displayName="{{'decorations.submit.field.type' | translate}}" controlPath="type"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="sort">Sortierung</label> <label for="sort">{{'decorations.submit.field.sort' | translate}}</label>
<input id="sort" name="sort" type="number" class="form-control btn dropdown-toggle" <input id="sort" name="sort" type="number" class="form-control btn dropdown-toggle"
[(ngModel)]="decoration.sortingNumber"> [(ngModel)]="decoration.sortingNumber">
<show-error displayName="Sortierung" controlPath="sort"></show-error> <show-error displayName="{{'decorations.submit.field.sort' | translate}}" controlPath="sort"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="description">Beschreibung</label> <label for="description">{{'decorations.submit.field.description' | translate}}</label>
<textarea id="description" name="description" class="form-control" rows="5" <textarea id="description" name="description" class="form-control" rows="5"
required required
[(ngModel)]="decoration.description"></textarea> [(ngModel)]="decoration.description"></textarea>
<show-error displayName="Beschreibung" controlPath="description"></show-error> <show-error displayName="{{'decorations.submit.field.description' | translate}}" controlPath="description"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="graphic">Bild</label> <label for="graphic">{{'decorations.submit.field.image' | translate}}</label>
<input id="graphic" name="graphic" class="ui-button form-control" type="file" <input id="graphic" name="graphic" class="ui-button form-control" type="file"
#fileInput #fileInput
accept="image/png" accept="image/png"
(change)="fileChange($event)"> (change)="fileChange($event)">
<span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError"> <span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError">
Bild muss im PNG Format vorliegen {{'decorations.submit.field.image.error.type' | translate}}
</span> </span>
<img class="preview-image" src="{{imagePreviewSrc}}"> <img class="preview-image" src="{{imagePreviewSrc}}">
@ -66,7 +66,7 @@
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'decorations.submit,button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
@ -74,6 +74,6 @@
(click)="saveDecoration(fileInput)" (click)="saveDecoration(fileInput)"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
Bestätigen {{'decorations.submit,button.submit' | translate}}
</button> </button>
</form> </form>

View File

@ -7,6 +7,7 @@ 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 {Message} from '../../i18n/de.messages';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
templateUrl: './edit-decoration.component.html', templateUrl: './edit-decoration.component.html',
@ -31,7 +32,8 @@ export class EditDecorationComponent implements OnInit, OnDestroy {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private decorationService: DecorationService, private decorationService: DecorationService,
private snackBarService: SnackBarService) { private snackBarService: SnackBarService,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -69,7 +71,12 @@ export class EditDecorationComponent implements OnInit, OnDestroy {
this.router.navigate(['..'], {relativeTo: this.route}); this.router.navigate(['..'], {relativeTo: this.route});
}); });
} else { } else {
return window.alert(`Bild ist ein Pflichtfeld`); this.translate.get('decorations.submit.field.image').subscribe((fieldNameLogo) => {
this.translate.get('public.error.message.required',
{fieldName: fieldNameLogo}).subscribe((message) => {
this.snackBarService.showError(message, 4000);
})
});
} }
} else { } else {
if (this.fileList) { if (this.fileList) {

View File

@ -6,7 +6,6 @@ import {DecorationPanelComponent} from './decoration-overview/decoration-panel/d
import {RankPanelComponent} from './rank-overview/rank-panel/rank-panel.component'; import {RankPanelComponent} from './rank-overview/rank-panel/rank-panel.component';
import {UserListSheetComponent} from './user-list-sheet/user-list-sheet.component'; import {UserListSheetComponent} from './user-list-sheet/user-list-sheet.component';
import {PublicComponent} from './public.component'; import {PublicComponent} from './public.component';
import {StatisticComponent} from '../statistic/stats.component';
export const publicRoutes: Routes = [ export const publicRoutes: Routes = [
{ {

View File

@ -1,44 +1,43 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3 *ngIf="rank._id">Rang editieren</h3> <h3 *ngIf="rank._id">{{'ranks.submit.headline.edit' | translate}}</h3>
<h3 *ngIf="!rank._id">Neuen Rang hinzufügen</h3> <h3 *ngIf="!rank._id">{{'ranks.submit.headline.new' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="title">Name</label> <label for="title">{{'ranks.submit.field.name' | translate}}</label>
<input type="text" class="form-control" <input type="text" class="form-control"
[(ngModel)]="rank.name" [(ngModel)]="rank.name"
name="title" name="title"
id="title" id="title"
required maxlength="50"/> required maxlength="50"/>
<show-error displayName="{{'ranks.submit.field.name' | translate}}" controlPath="title"></show-error>
<show-error displayName="Name" controlPath="title"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="fraction">Fraktion</label> <label for="fraction">{{'ranks.submit.field.fraction' | translate}}</label>
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle" <select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="rank.fraction"> [(ngModel)]="rank.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">{{fraction.OPFOR}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">{{fraction.BLUFOR}}</option>
</select> </select>
<show-error displayName="Fraktion" controlPath="fraction"></show-error> <show-error displayName="{{'ranks.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="level">Stufe</label> <label for="level">{{'ranks.submit.field.level' | translate}}</label>
<input id="level" name="level" type="number" class="form-control btn dropdown-toggle" <input id="level" name="level" type="number" class="form-control btn dropdown-toggle"
[(ngModel)]="rank.level"> [(ngModel)]="rank.level">
<show-error displayName="Stufe" controlPath="level"></show-error> <show-error displayName="{{'ranks.submit.field.level' | translate}}" controlPath="level"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="logo">Bild</label> <label for="logo">{{'ranks.submit.field.image' | translate}}</label>
<input id="logo" name="logo" class="ui-button form-control" type="file" <input id="logo" name="logo" class="ui-button form-control" type="file"
accept="image/png" accept="image/png"
#fileInput #fileInput
(change)="fileChange($event)"> (change)="fileChange($event)">
<span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError"> <span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError">
Bild muss im PNG Format vorliegen {{'ranks.submit.field.image.error.format' | translate}}
</span> </span>
<img class="preview-image" src="{{imagePreviewSrc}}"> <img class="preview-image" src="{{imagePreviewSrc}}">
@ -47,7 +46,7 @@
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'ranks.submit.button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
@ -55,6 +54,6 @@
(click)="saveRank(fileInput)" (click)="saveRank(fileInput)"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
Bestätigen {{'ranks.submit.button.submit' | translate}}
</button> </button>
</form> </form>

View File

@ -7,6 +7,7 @@ import {Subscription} from 'rxjs/Subscription';
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {Message} from '../../i18n/de.messages'; 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';
@Component({ @Component({
@ -34,7 +35,8 @@ export class EditRankComponent implements OnInit, OnDestroy {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private rankService: RankService, private rankService: RankService,
private snackBarService: SnackBarService) { private snackBarService: SnackBarService,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -73,7 +75,12 @@ export class EditRankComponent implements OnInit, OnDestroy {
this.router.navigate(['..'], {relativeTo: this.route}); this.router.navigate(['..'], {relativeTo: this.route});
}); });
} else { } else {
return window.alert(`Bild ist ein Pflichtfeld`); this.translate.get('ranks.submit.field.image').subscribe((fieldNameIMage) => {
this.translate.get('public.error.message.required',
{fieldName: fieldNameIMage}).subscribe((message) => {
this.snackBarService.showError(message, 4000);
})
});
} }
} else { } else {
if (this.fileList) { if (this.fileList) {
@ -95,12 +102,4 @@ export class EditRankComponent implements OnInit, OnDestroy {
this.router.navigate([this.rank._id ? '../..' : '..'], {relativeTo: this.route}); this.router.navigate([this.rank._id ? '../..' : '..'], {relativeTo: this.route});
return false; return false;
} }
canDeactivate(): boolean {
if (this.saved || !this.form.dirty) {
return true;
}
return window.confirm(`Ihr Formular besitzt ungespeicherte Änderungen, möchten Sie die Seite wirklich verlassen?`);
}
} }

View File

@ -8,12 +8,13 @@
<br> <br>
<small *ngIf="rank.fraction == 'OPFOR'">{{fraction.OPFOR}}</small> <small *ngIf="rank.fraction == 'OPFOR'">{{fraction.OPFOR}}</small>
<small *ngIf="rank.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small> <small *ngIf="rank.fraction == 'BLUFOR'">{{fraction.BLUFOR}}</small>
<small> - Stufe {{rank.level}}</small> <small>{{'ranks.list.item.label.level' | translate:{level: rank.level} }}</small>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<img src="{{imageSrc}}" class="rank-list-preview"> <img src="{{imageSrc}}" class="rank-list-preview">
<span (click)="delete(); $event.stopPropagation()" matTooltip="Löschen" class="glyphicon glyphicon-trash trash"></span> <span (click)="delete(); $event.stopPropagation()" matTooltip="{{'ranks.list.button.delete' | translate}}"
class="glyphicon glyphicon-trash trash"></span>
</div> </div>
</div> </div>

View File

@ -2,7 +2,7 @@
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}]" {label: fraction.OPFOR, value: 'OPFOR'}]"
[addButton]="{svgIcon: 'add', tooltip: 'Neuen Rang hinzufügen'}" [addButton]="{svgIcon: 'add', tooltip: 'ranks.list.button.add'}"
(executeSearch)="filterRanks($event)" (executeSearch)="filterRanks($event)"
(openAddFrom)="openNewRankForm()"> (openAddFrom)="openNewRankForm()">
</cc-list-filter> </cc-list-filter>

View File

@ -8,6 +8,7 @@ import {RankService} from '../../services/army-management/rank.service';
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {UIHelpers} from '../../utils/global.helpers'; import {UIHelpers} from '../../utils/global.helpers';
import {MatButtonToggleGroup} from '@angular/material'; import {MatButtonToggleGroup} from '@angular/material';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'cc-rank-list', selector: 'cc-rank-list',
@ -28,7 +29,8 @@ export class RankListComponent implements OnInit {
constructor(private rankService: RankService, constructor(private rankService: RankService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -60,10 +62,15 @@ export class RankListComponent implements OnInit {
deleteRank(rank) { deleteRank(rank) {
const fraction = rank.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR; const fraction = rank.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR;
if (confirm('Soll der Rang ' + rank.name + ' (' + fraction + ') wirklich gelöscht werden?')) { this.translate.get('ranks.list.delete.confirm', {
name: rank.name,
fraction: fraction
}).subscribe((confirmQuestion) => {
if (confirm(confirmQuestion)) {
this.rankService.deleteRank(rank) this.rankService.deleteRank(rank)
.subscribe((res) => { .subscribe((res) => {
}); });
} }
});
} }
} }

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,14 @@
import { Component } from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-ranks-root',
templateUrl: './ranks.component.html',
styleUrls: ['./ranks.component.scss']
})
export class RanksComponent {
constructor(private translate: TranslateService) {
translate.setDefaultLang('de');
}
}

View File

@ -4,11 +4,34 @@ import {SharedModule} from '../shared.module';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {RankService} from '../services/army-management/rank.service'; import {RankService} from '../services/army-management/rank.service';
import {RankStore} from '../services/stores/rank.store'; import {RankStore} from '../services/stores/rank.store';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {HttpClient} from '@angular/common/http';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/ranks/', '.json');
}
@NgModule({ @NgModule({
declarations: ranksRoutingComponents, declarations: ranksRoutingComponents,
imports: [CommonModule, SharedModule, rankRouterModule], imports: [
providers: [RankStore, RankService] CommonModule,
SharedModule,
rankRouterModule,
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
isolate: true
})
],
providers: [
RankStore,
RankService
]
}) })
export class RanksModule { export class RanksModule {
static routes = rankRouterModule; static routes = rankRouterModule;

View File

@ -3,8 +3,13 @@ import {RankListComponent} from './rank-list/rank-list.component';
import {EditRankComponent} from './edit-rank/edit-rank.component'; import {EditRankComponent} from './edit-rank/edit-rank.component';
import {RankItemComponent} from './rank-list/rank-item.component'; import {RankItemComponent} from './rank-list/rank-item.component';
import {ModuleWithProviders} from '@angular/core'; import {ModuleWithProviders} from '@angular/core';
import {RanksComponent} from './ranks.component';
export const ranksRoutes: Routes = [ export const ranksRoutes: Routes = [
{
path: '',
component: RanksComponent,
},
{ {
path: '', path: '',
component: RankListComponent, component: RankListComponent,
@ -23,5 +28,4 @@ export const ranksRoutes: Routes = [
export const rankRouterModule: ModuleWithProviders = RouterModule.forChild(ranksRoutes); export const rankRouterModule: ModuleWithProviders = RouterModule.forChild(ranksRoutes);
export const ranksRoutingComponents = [RankItemComponent, RankListComponent, EditRankComponent]; export const ranksRoutingComponents = [RanksComponent, RankItemComponent, RankListComponent, EditRankComponent];

View File

@ -1,8 +1,8 @@
<form #form="ngForm" class="overview"> <form #form="ngForm" class="overview">
<h3>Auszeichnung beantragen</h3> <h3>{{'request.award.headline' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="user">Teilnehmer</label> <label for="user">{{'request.award.field.user' | translate}}</label>
<select class="form-control" <select class="form-control"
name="user" name="user"
id="user" id="user"
@ -10,7 +10,7 @@
[compareWith]="equals" [compareWith]="equals"
(change)="toggleUser()" (change)="toggleUser()"
required> required>
<option [ngValue]="{_id: '0'}">Auswählen...</option> <option [ngValue]="{_id: '0'}">{{'request.award.field.user.placeholder' | translate}}</option>
<option *ngFor="let user of users" [ngValue]="user"> <option *ngFor="let user of users" [ngValue]="user">
{{user.username}} {{user.username}}
</option> </option>
@ -18,7 +18,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="decoration">Auszeichnung</label> <label for="decoration">{{'request.award.field.award' | translate}}</label>
<select class="form-control" <select class="form-control"
name="decoration" name="decoration"
id="decoration" id="decoration"
@ -26,7 +26,7 @@
[compareWith]="equals" [compareWith]="equals"
(change)="toggleDecoPreview(decoDescription, decoPreview)" (change)="toggleDecoPreview(decoDescription, decoPreview)"
required> required>
<option [ngValue]="{_id: '0'}">Auswählen...</option> <option [ngValue]="{_id: '0'}">{{'request.award.field.award.placeholder' | translate}}</option>
<option *ngFor="let deco of decorations" [ngValue]="deco"> <option *ngFor="let deco of decorations" [ngValue]="deco">
{{deco.name}} {{deco.name}}
</option> </option>
@ -44,35 +44,35 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="reason">Begründung</label> <label for="reason">{{'request.award.field.reason' | translate}}</label>
<textarea class="form-control center-block" name="reason" [(ngModel)]="reason" required <textarea class="form-control center-block" name="reason" [(ngModel)]="reason" required
id="reason" placeholder="Begründung eingeben..." rows="3"></textarea> id="reason" placeholder="{{'request.award.field.reason.placeholder' | translate}}" rows="3"></textarea>
</div> </div>
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'request.award.button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
(click)="addAwarding(decoPreview, decoDescription)" (click)="addAwarding(decoPreview, decoDescription)"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid || user._id === '0' || decoration._id === '0'"> [disabled]="!form.valid || user._id === '0' || decoration._id === '0'">
Bestätigen {{'request.award.button.submit' | translate}}
</button> </button>
<div class="table-container" *ngIf="showForm"> <div class="table-container" *ngIf="showForm">
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Bild</th> <th class="col-sm-1">{{'request.award.table.head.image' | translate}}</th>
<th class="col-sm-2">Bezeichnung</th> <th class="col-sm-2">{{'request.award.table.head.name' | translate}}</th>
<th class="col-sm-2">Begründung</th> <th class="col-sm-2">{{'request.award.table.head.reason' | translate}}</th>
<th class="col-sm-1 ">Antragsteller</th> <th class="col-sm-1 ">{{'request.award.table.head.requester' | translate}}</th>
<th class="col-sm-1 text-right">Datum</th> <th class="col-sm-1 text-right">{{'request.award.table.head.date' | translate}}</th>
<th class="col-sm-1 text-center">Status</th> <th class="col-sm-1 text-center">{{'request.award.table.head.status' | translate}}</th>
<th class="col-sm-2 text-right">Grund für Ablehnung</th> <th class="col-sm-2 text-right">{{'request.award.table.head.reject.reason' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let award of awards"> <tbody *ngFor="let award of awards">
@ -96,7 +96,15 @@
{{award.date | date: 'dd.MM.yyyy'}} {{award.date | date: 'dd.MM.yyyy'}}
</td> </td>
<td class="text-center"> <td class="text-center">
{{award.confirmed === 0? 'In Bearbeitung' : (award.confirmed === 1? 'Genehmigt' : 'Abgelehnt')}} <span *ngIf="award.confirmed === 0">
{{'request.award.table.status.progressing' | translate}}
</span>
<span *ngIf="award.confirmed === 1">
{{'request.award.table.status.accepted' | translate}}
</span>
<span *ngIf="award.confirmed !== 0 && award.confirmed !== 1">
{{'request.award.table.status.rejected' | translate}}
</span>
</td> </td>
<td class="text-right"> <td class="text-right">
{{award.rejectReason ? award.rejectReason : ''}} {{award.rejectReason ? award.rejectReason : ''}}

View File

@ -82,10 +82,10 @@ export class RequestAwardComponent implements OnInit {
addAwarding(previewImage, descriptionField) { addAwarding(previewImage, descriptionField) {
if (this.decoration._id && this.reason.length > 0) { if (this.decoration._id && this.reason.length > 0) {
const award: Award = { const award: Award = {
'userId': this.user._id, userId: this.user._id,
'decorationId': this.decoration._id, decorationId: this.decoration._id,
'reason': this.reason, reason: this.reason,
'date': Date.now() date: Date.now()
}; };
this.awardingService.requestAwarding(award).subscribe(() => { this.awardingService.requestAwarding(award).subscribe(() => {
this.awardingService.getUserAwardings(this.user._id) this.awardingService.getUserAwardings(this.user._id)

View File

@ -1,18 +1,18 @@
<form #form="ngForm" class="overview"> <form #form="ngForm" class="overview">
<h3>Offene Anträge - Auszeichnungen</h3> <h3>{{'request.confirm.award.headline' | translate}}</h3>
<div class="table-container"> <div class="table-container">
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Teilnehmer</th> <th class="col-sm-1">{{'request.confirm.award.table.head.participant' | translate}}</th>
<th class="col-sm-1"></th> <th class="col-sm-1"></th>
<th class="col-sm-2">Auszeichnung</th> <th class="col-sm-2">{{'request.confirm.award.table.head.award' | translate}}</th>
<th class="col-sm-2">Begründung</th> <th class="col-sm-2">{{'request.confirm.award.table.head.reason' | translate}}</th>
<th class="col-sm-1 ">Antragsteller</th> <th class="col-sm-1 ">{{'request.confirm.award.table.head.requester' | translate}}</th>
<th class="col-sm-1 text-right">Datum</th> <th class="col-sm-1 text-right">{{'request.confirm.award.table.head.date' | translate}}</th>
<th class="col-sm-2 text-right"></th> <th class="col-sm-2 text-right"></th>
<th class="col-sm-1 text-right">Aktion</th> <th class="col-sm-1 text-right">{{'request.confirm.award.table.head.action' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let award of awards"> <tbody *ngFor="let award of awards">
@ -43,16 +43,19 @@
<td> <td>
<textarea style="width: 100%;" <textarea style="width: 100%;"
rows="3" rows="3"
placeholder="Begründung für Ablehnung (optional)" placeholder="{{'request.confirm.award.table.reject.reason.placeholder' | translate}}"
#rejectReason></textarea> #rejectReason></textarea>
</td> </td>
<td class="text-right"> <td class="text-right">
<a class="action" (click)="confirm(award, true, reason.value)">Bestätigen</a><br> <a class="action" (click)="confirm(award, true, reason.value)">
<a class="action" (click)="confirm(award, false, reason.value, rejectReason.value)">Ablehnen</a> {{'request.confirm.award.table.button.action.accept' | translate}}
</a><br>
<a class="action" (click)="confirm(award, false, reason.value, rejectReason.value)">
{{'request.confirm.award.table.button.action.reject' | translate}}
</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</form> </form>

View File

@ -1,18 +1,18 @@
<form #form="ngForm" class="overview"> <form #form="ngForm" class="overview">
<h3>Offene Anträge - Beförderung</h3> <h3>{{'request.confirm.promotion.headline' | translate}}</h3>
<div class="table-container"> <div class="table-container">
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Teilnehmer</th> <th class="col-sm-1">{{'request.confirm.promotion.table.head.participant' | translate}}</th>
<th class="col-sm-1">Alter Rang</th> <th class="col-sm-1">{{'request.confirm.promotion.table.head.rank.before' | translate}}</th>
<th class="col-sm-1">Neuer Rang</th> <th class="col-sm-1">{{'request.confirm.promotion.table.head.rank.after' | translate}}</th>
<th class="col-sm-1 ">Antragsteller</th> <th class="col-sm-1 ">{{'"request.confirm.promotion.table.head.requester' | translate}}</th>
<th class="col-sm-1 text-center">Datum</th> <th class="col-sm-1 text-center">{{'request.confirm.promotion.table.head.date' | translate}}</th>
<th class="col-sm-1 text-center">Status</th> <th class="col-sm-1 text-center">{{'request.confirm.promotion.table.head.status' | translate}}</th>
<th class="col-sm-2 text-right"></th> <th class="col-sm-2 text-right"></th>
<th class="col-sm-1 text-right">Aktion</th> <th class="col-sm-1 text-right">{{'request.confirm.promotion.table.head.action' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let promotion of promotions"> <tbody *ngFor="let promotion of promotions">
@ -33,17 +33,29 @@
{{promotion.timestamp | date: 'dd.MM.yyyy'}} {{promotion.timestamp | date: 'dd.MM.yyyy'}}
</td> </td>
<td class="text-center"> <td class="text-center">
{{promotion.confirmed === 0? 'In Bearbeitung' : (promotion.confirmed === 1? 'Genehmigt' : 'Abgelehnt')}} <span *ngIf="promotion.confirmed === 0">
{{'request.confirm.promotion.table.status.progressing' | translate}}
</span>
<span *ngIf="promotion.confirmed === 1">
{{'request.confirm.promotion.table.status.accepted' | translate}}
</span>
<span *ngIf="promotion.confirmed !== 0 && promotion.confirmed !== 1">
{{'request.confirm.promotion.table.status.rejected' | translate}}
</span>
</td> </td>
<td> <td>
<textarea style="width: 100%;" <textarea style="width: 100%;"
rows="3" rows="3"
placeholder="Begründung für Ablehnung (optional)" placeholder="{{'request.confirm.promotion.table.reject.reason.placeholder' | translate}}"
#rejectReason></textarea> #rejectReason></textarea>
</td> </td>
<td class="text-right"> <td class="text-right">
<a class="action" (click)="confirm(promotion, true)">Bestätigen</a><br> <a class="action" (click)="confirm(promotion, true)">
<a class="action" (click)="confirm(promotion, false, rejectReason.value)">Ablehnen</a> {{'request.confirm.promotion.table.button.action.accept' | translate}}
</a><br>
<a class="action" (click)="confirm(promotion, false, rejectReason.value)">
{{'request.confirm.promotion.table.button.action.reject' | translate}}
</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -1,8 +1,8 @@
<form #form="ngForm" class="overview"> <form #form="ngForm" class="overview">
<h3>Beförderung beantragen</h3> <h3>{{'request.promotion.headline' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="user">Teilnehmer</label> <label for="user">{{'request.promotion.field.participant' | translate}}</label>
<select class="form-control" <select class="form-control"
name="user" name="user"
id="user" id="user"
@ -10,7 +10,7 @@
[compareWith]="equals" [compareWith]="equals"
required required
(change)="toggleUser()"> (change)="toggleUser()">
<option [ngValue]="{_id: '0'}">Auswählen...</option> <option [ngValue]="{_id: '0'}">{{'request.promotion.field.participant.placeholder' | translate}}</option>
<option *ngFor="let user of users" [ngValue]="user"> <option *ngFor="let user of users" [ngValue]="user">
{{user.username}} {{user.username}}
</option> </option>
@ -20,7 +20,7 @@
<div *ngIf="showForm"> <div *ngIf="showForm">
<div class="form-group"> <div class="form-group">
<label for="user">Aktueller Rang</label> <label for="user">{{'request.promotion.field.rank.before' | translate}}</label>
<input class="form-control" <input class="form-control"
[(ngModel)]="selectedUserRank" [(ngModel)]="selectedUserRank"
[ngModelOptions]="{standalone: true}" [ngModelOptions]="{standalone: true}"
@ -28,7 +28,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="decoration">Neuer Rang</label> <label for="decoration">{{'request.promotion.field.rank.after' | translate}}</label>
<select class="form-control" <select class="form-control"
name="decoration" name="decoration"
id="decoration" id="decoration"
@ -46,7 +46,7 @@
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'request.promotion.button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
@ -54,7 +54,7 @@
(click)="addPromotion()" (click)="addPromotion()"
class="btn btn-default" class="btn btn-default"
[disabled]="newLevel === user.rankLvl"> [disabled]="newLevel === user.rankLvl">
Bestätigen {{'request.promotion.button.submit' | translate}}
</button> </button>
<div class="table-container"> <div class="table-container">
@ -62,13 +62,13 @@
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Teilnehmer</th> <th class="col-sm-1">{{'request.promotion.table.head.participant' | translate}}</th>
<th class="col-sm-1">Alter Rang</th> <th class="col-sm-1">{{'request.promotion.table.head.rank.before' | translate}}</th>
<th class="col-sm-1">Neuer Rang</th> <th class="col-sm-1">{{'request.promotion.table.head.rank.after' | translate}}</th>
<th class="col-sm-1 ">Antragsteller</th> <th class="col-sm-1 ">{{'request.promotion.table.head.requester' | translate}}</th>
<th class="col-sm-1 text-center">Datum</th> <th class="col-sm-1 text-center">{{'request.promotion.table.head.date' | translate}}</th>
<th class="col-sm-1 text-center">Status</th> <th class="col-sm-1 text-center">{{'request.promotion.table.head.status' | translate}}</th>
<th class="col-sm-2 text-right">Grund für Ablehnung</th> <th class="col-sm-2 text-right">{{'request.promotion.table.head.reject.reason' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let promotion of uncheckedPromotions"> <tbody *ngFor="let promotion of uncheckedPromotions">
@ -89,10 +89,18 @@
{{promotion.timestamp | date: 'dd.MM.yyyy'}} {{promotion.timestamp | date: 'dd.MM.yyyy'}}
</td> </td>
<td class="text-center"> <td class="text-center">
{{promotion.confirmed === 0? 'In Bearbeitung' : (promotion.confirmed === 1? 'Genehmigt' : 'Abgelehnt')}} <span *ngIf="promotion.confirmed === 0">
{{'request.confirm.promotion.table.status.progressing' | translate}}
</span>
<span *ngIf="promotion.confirmed === 1">
{{'request.confirm.promotion.table.status.accepted' | translate}}
</span>
<span *ngIf="promotion.confirmed !== 0 && promotion.confirmed !== 1">
{{'request.confirm.promotion.table.status.rejected' | translate}}
</span>
</td> </td>
<td class="text-right"> <td class="text-right">
{{promotion.rejectReason ? promotion.rejectReason : ''}} <span *ngIf="promotion.rejectReason">{{promotion.rejectReason}}</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -98,5 +98,4 @@ export class RequestPromotionComponent implements OnInit {
return o1._id === o2._id; return o1._id === o2._id;
} }
} }
} }

View File

@ -1,11 +1,13 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'cc-request', selector: 'cc-request-root',
templateUrl: 'request.component.html', templateUrl: 'request.component.html',
styleUrls: ['request.component.css'] styleUrls: ['request.component.css']
}) })
export class RequestComponent { export class RequestComponent {
constructor() { constructor(private translate: TranslateService) {
translate.setDefaultLang('de');
} }
} }

View File

@ -9,11 +9,38 @@ import {ConfirmPromotionComponent} from './confirm-promotion/confirm-promotion.c
import {RequestAwardComponent} from './award/req-award.component'; import {RequestAwardComponent} from './award/req-award.component';
import {RequestPromotionComponent} from './promotion/req-promotion.component'; import {RequestPromotionComponent} from './promotion/req-promotion.component';
import {SqlDashboardComponent} from './sql-dashboard/sql-dashboard.component'; import {SqlDashboardComponent} from './sql-dashboard/sql-dashboard.component';
import {HttpClient} from '@angular/common/http';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/request/', '.json');
}
@NgModule({ @NgModule({
declarations: [RequestComponent, RequestPromotionComponent, RequestAwardComponent, ConfirmPromotionComponent, declarations: [
ConfirmAwardComponent, SqlDashboardComponent, FilterRankPipe], RequestComponent,
imports: [CommonModule, SharedModule, requestRouterModule] RequestPromotionComponent,
RequestAwardComponent,
ConfirmPromotionComponent,
ConfirmAwardComponent,
SqlDashboardComponent,
FilterRankPipe
],
imports: [
CommonModule,
SharedModule,
requestRouterModule,
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
isolate: true
})
]
}) })
export class RequestModule { export class RequestModule {
static routes = requestRouterModule; static routes = requestRouterModule;

View File

@ -11,9 +11,11 @@ import {LoginGuardHL, LoginGuardSQL} from '../login';
import {SqlDashboardComponent} from './sql-dashboard/sql-dashboard.component'; import {SqlDashboardComponent} from './sql-dashboard/sql-dashboard.component';
export const requestRoutes: Routes = [{ export const requestRoutes: Routes = [
path: '', component: RequestComponent {
}, path: '',
component: RequestComponent,
children: [
{ {
path: RouteConfig.requestAwardPath, path: RouteConfig.requestAwardPath,
component: RequestAwardComponent, component: RequestAwardComponent,
@ -39,6 +41,8 @@ export const requestRoutes: Routes = [{
component: ConfirmPromotionComponent, component: ConfirmPromotionComponent,
canActivate: [LoginGuardHL] canActivate: [LoginGuardHL]
}, },
]
},
]; ];
export const requestRouterModule: ModuleWithProviders = RouterModule.forChild(requestRoutes); export const requestRouterModule: ModuleWithProviders = RouterModule.forChild(requestRoutes);

View File

@ -1,16 +1,16 @@
<div class="overview"> <div class="overview">
<h3>SQL Dashboard</h3> <h3>{{'request.sql.dashboard.headline' | translate}}</h3>
<div class="table-container"> <div class="table-container">
<label>Beförderungsanträge</label> <label>{{'request.confirm.promotion.headline' | translate}}</label>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Teilnehmer</th> <th class="col-sm-1">{{'request.confirm.promotion.table.head.participant' | translate}}</th>
<th class="col-sm-1">Alter Rang</th> <th class="col-sm-1">{{'request.confirm.promotion.table.head.rank.before' | translate}}</th>
<th class="col-sm-1">Neuer Rang</th> <th class="col-sm-1">{{'request.confirm.promotion.table.head.rank.after' | translate}}</th>
<th class="col-sm-1 ">Antragsteller</th> <th class="col-sm-1 ">{{'request.confirm.promotion.table.head.requester' | translate}}</th>
<th class="col-sm-1 text-center">Datum</th> <th class="col-sm-1 text-center">{{'request.confirm.promotion.table.head.date' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let promotion of promotions"> <tbody *ngFor="let promotion of promotions">
@ -36,16 +36,16 @@
</div> </div>
<div class="table-container"> <div class="table-container">
<label>Anträge für Orden/ Auszeichnungen</label> <label>{{'request.confirm.award.headline' | translate}}</label>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Teilnehmer</th> <th class="col-sm-1">{{'request.confirm.award.table.head.participant' | translate}}</th>
<th class="col-sm-1">Bild</th> <th class="col-sm-1"></th>
<th class="col-sm-2">Bezeichnung</th> <th class="col-sm-2">{{'request.confirm.award.table.head.award' | translate}}</th>
<th class="col-sm-2">Begründung</th> <th class="col-sm-2">{{'request.confirm.award.table.head.reason' | translate}}</th>
<th class="col-sm-1 ">Antragsteller</th> <th class="col-sm-1 ">{{'request.confirm.award.table.head.requester' | translate}}</th>
<th class="col-sm-1 text-right">Datum</th> <th class="col-sm-1 text-right">{{'request.confirm.award.table.head.date' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngFor="let award of awards"> <tbody *ngFor="let award of awards">

View File

@ -1,44 +1,43 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3 *ngIf="squad._id">Squad editieren</h3> <h3 *ngIf="squad._id">{{'squad.submit.edit.headline' | translate}}</h3>
<h3 *ngIf="!squad._id">Neues Squad hinzufügen</h3> <h3 *ngIf="!squad._id">{{'squad.submit.new.headline' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="title">Name</label> <label for="title">{{'squad.submit.field.name' | translate}}</label>
<input type="text" class="form-control" <input type="text" class="form-control"
[(ngModel)]="squad.name" [(ngModel)]="squad.name"
name="title" name="title"
id="title" id="title"
required maxlength="50"/> required maxlength="50"/>
<show-error displayName="{{'squad.submit.field.name' | translate}}" controlPath="title"></show-error>
<show-error displayName="Name" controlPath="title"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="fraction">Fraktion</label> <label for="fraction">{{'squad.submit.field.fraction' | translate}}</label>
<select id="fraction" name="fraction" class="form-control btn dropdown-toggle" <select id="fraction" name="fraction" class="form-control btn dropdown-toggle"
required required
[(ngModel)]="squad.fraction"> [(ngModel)]="squad.fraction">
<option value="OPFOR">{{fraction.OPFOR}}</option> <option value="OPFOR">{{fraction.OPFOR}}</option>
<option value="BLUFOR">{{fraction.BLUFOR}}</option> <option value="BLUFOR">{{fraction.BLUFOR}}</option>
</select> </select>
<show-error displayName="Fraktion" controlPath="fraction"></show-error> <show-error displayName="{{'squad.submit.field.fraction' | translate}}" controlPath="fraction"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="sort">Sortierung</label> <label for="sort">{{'squad.submit.field.sort' | translate}}</label>
<input id="sort" name="sort" type="number" class="form-control btn dropdown-toggle" <input id="sort" name="sort" type="number" class="form-control btn dropdown-toggle"
[(ngModel)]="squad.sortingNumber"> [(ngModel)]="squad.sortingNumber">
<show-error displayName="Sortierung" controlPath="sort"></show-error> <show-error displayName="{{'squad.submit.field.sort' | translate}}" controlPath="sort"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="logo">Logo</label> <label for="logo">{{'squad.submit.field.logo' | translate}}</label>
<input id="logo" name="logo" class="ui-button form-control" type="file" <input id="logo" name="logo" class="ui-button form-control" type="file"
#fileInput #fileInput
accept="image/png" accept="image/png"
(change)="fileChange($event)"> (change)="fileChange($event)">
<span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError"> <span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showImageError">
Bild muss im PNG Format vorliegen {{'squad.submit.error.logo.type' | translate}}
</span> </span>
<img class="preview-image" src="{{imagePreviewSrc}}"> <img class="preview-image" src="{{imagePreviewSrc}}">
@ -47,7 +46,7 @@
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'squad.submit.button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
@ -55,6 +54,6 @@
(click)="saveSquad(fileInput)" (click)="saveSquad(fileInput)"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
Bestätigen {{'squad.submit.button.submit' | translate}}
</button> </button>
</form> </form>

View File

@ -7,6 +7,7 @@ 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 {Message} from '../../i18n/de.messages';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
@ -34,7 +35,8 @@ export class EditSquadComponent implements OnInit, OnDestroy {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private squadService: SquadService, private squadService: SquadService,
private snackBarService: SnackBarService) { private snackBarService: SnackBarService,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -73,7 +75,12 @@ export class EditSquadComponent implements OnInit, OnDestroy {
this.router.navigate(['..'], {relativeTo: this.route}); this.router.navigate(['..'], {relativeTo: this.route});
}); });
} else { } else {
return window.alert(`Bild ist ein Pflichtfeld`); this.translate.get('squad.submit.field.logo').subscribe((fieldNameLogo) => {
this.translate.get('public.error.message.required',
{fieldName: fieldNameLogo}).subscribe((message) => {
this.snackBarService.showError(message, 4000);
})
});
} }
} else { } else {
if (this.fileList) { if (this.fileList) {
@ -95,12 +102,4 @@ export class EditSquadComponent implements OnInit, OnDestroy {
this.router.navigate([this.squad._id ? '../..' : '..'], {relativeTo: this.route}); this.router.navigate([this.squad._id ? '../..' : '..'], {relativeTo: this.route});
return false; return false;
} }
canDeactivate(): boolean {
if (this.saved || !this.form.dirty) {
return true;
}
return window.confirm(`Ihr Formular besitzt ungespeicherte Änderungen, möchten Sie die Seite wirklich verlassen?`);
}
} }

View File

@ -12,7 +12,9 @@
<div class="col-xs-4"> <div class="col-xs-4">
<img src="{{imageSrc}}" height="50px" class="squad-list-preview"> <img src="{{imageSrc}}" height="50px" class="squad-list-preview">
<span (click)="delete(); $event.stopPropagation()" matTooltip="Löschen" class="glyphicon glyphicon-trash trash"></span> <span (click)="delete(); $event.stopPropagation()"
matTooltip="{{'squad.modify.delete' | translate}}"
class="glyphicon glyphicon-trash trash"></span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,7 +2,7 @@
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}]" {label: fraction.OPFOR, value: 'OPFOR'}]"
[addButton]="{svgIcon: 'add', tooltip: 'Neues Squad hinzufügen'}" [addButton]="{svgIcon: 'add', tooltip: 'squad.list.tooltip.new'}"
(executeSearch)="filterSquads($event)" (executeSearch)="filterSquads($event)"
(openAddFrom)="openNewSquadForm()"> (openAddFrom)="openNewSquadForm()">
</cc-list-filter> </cc-list-filter>

View File

@ -8,6 +8,7 @@ import {SquadService} from '../../services/army-management/squad.service';
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {UIHelpers} from '../../utils/global.helpers'; import {UIHelpers} from '../../utils/global.helpers';
import {MatButtonToggleGroup} from '@angular/material'; import {MatButtonToggleGroup} from '@angular/material';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'cc-squad-list', selector: 'cc-squad-list',
@ -28,7 +29,8 @@ export class SquadListComponent implements OnInit {
constructor(private squadService: SquadService, constructor(private squadService: SquadService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -54,11 +56,16 @@ export class SquadListComponent implements OnInit {
deleteSquad(squad) { deleteSquad(squad) {
const fraction = squad.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR; const fraction = squad.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR;
if (confirm('Soll das Squad "' + squad.name + '" (' + fraction + ') wirklich gelöscht werden?')) { this.translate.get('squad.list.delete.confirm', {
name: squad.name,
fraction: fraction
}).subscribe((confirmQuestion) => {
if (confirm(confirmQuestion)) {
this.squadService.deleteSquad(squad) this.squadService.deleteSquad(squad)
.subscribe((res) => { .subscribe((res) => {
}); });
} }
});
} }
filterSquads(group?: MatButtonToggleGroup) { filterSquads(group?: MatButtonToggleGroup) {

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,14 @@
import {Component} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-squads-root',
templateUrl: './squads.component.html',
styleUrls: ['./squads.component.scss']
})
export class SquadsComponent {
constructor(private translate: TranslateService) {
this.translate.setDefaultLang('de');
}
}

View File

@ -4,11 +4,36 @@ import {SharedModule} from '../shared.module';
import {squadRouterModule, squadsRoutingComponents} from './squads.routing'; import {squadRouterModule, squadsRoutingComponents} from './squads.routing';
import {SquadStore} from '../services/stores/squad.store'; import {SquadStore} from '../services/stores/squad.store';
import {SquadService} from '../services/army-management/squad.service'; import {SquadService} from '../services/army-management/squad.service';
import {HttpClient} from '@angular/common/http';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/squads/', '.json');
}
@NgModule({ @NgModule({
declarations: squadsRoutingComponents, declarations: squadsRoutingComponents,
imports: [CommonModule, SharedModule, squadRouterModule],
providers: [SquadStore, SquadService] imports: [
CommonModule,
SharedModule,
squadRouterModule,
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
isolate: true
})
],
providers: [
SquadStore,
SquadService
]
}) })
export class SquadsModule { export class SquadsModule {
static routes = squadRouterModule; static routes = squadRouterModule;

View File

@ -3,8 +3,13 @@ import {SquadListComponent} from './squad-list/squad-list.component';
import {EditSquadComponent} from './edit-squad/edit-squad.component'; import {EditSquadComponent} from './edit-squad/edit-squad.component';
import {ModuleWithProviders} from '@angular/core'; import {ModuleWithProviders} from '@angular/core';
import {SquadItemComponent} from './squad-list/squad-item.component'; import {SquadItemComponent} from './squad-list/squad-item.component';
import {SquadsComponent} from './squads.component';
export const squadsRoutes: Routes = [ export const squadsRoutes: Routes = [
{
path: '',
component: SquadsComponent
},
{ {
path: '', path: '',
component: SquadListComponent, component: SquadListComponent,
@ -19,9 +24,10 @@ export const squadsRoutes: Routes = [
path: 'edit/:id', path: 'edit/:id',
component: EditSquadComponent, component: EditSquadComponent,
outlet: 'right' outlet: 'right'
}]; }
];
export const squadRouterModule: ModuleWithProviders = RouterModule.forChild(squadsRoutes); export const squadRouterModule: ModuleWithProviders = RouterModule.forChild(squadsRoutes);
export const squadsRoutingComponents = [SquadItemComponent, SquadListComponent, EditSquadComponent]; export const squadsRoutingComponents = [SquadsComponent, SquadItemComponent, SquadListComponent, EditSquadComponent];

View File

@ -5,6 +5,7 @@ import {PlayerUtils} from '../../../utils/player-utils';
import {saveAs} from 'file-saver/FileSaver'; import {saveAs} from 'file-saver/FileSaver';
import {MatSort} from '@angular/material'; import {MatSort} from '@angular/material';
import {SortUtils} from '../../../utils/sort-utils'; import {SortUtils} from '../../../utils/sort-utils';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'cc-scoreboard', selector: 'cc-scoreboard',
@ -37,7 +38,8 @@ export class ScoreboardComponent implements OnChanges {
displayedColumns = this.tableHead.map(head => head.prop); displayedColumns = this.tableHead.map(head => head.prop);
constructor(private elRef: ElementRef) { constructor(private elRef: ElementRef,
private translate: TranslateService) {
this.displayedColumns.push('interact'); this.displayedColumns.push('interact');
} }
@ -93,12 +95,13 @@ export class ScoreboardComponent implements OnChanges {
exportCSV() { exportCSV() {
let csvOut = ''; let csvOut = '';
for (let i = 0; i < this.tableHead.length; i++) { for (let i = 0; i < this.tableHead.length; i++) {
csvOut += this.tableHead[i].head; this.translate.get(this.tableHead[i].head).subscribe((translated) => {
csvOut += translated;
if (i !== this.tableHead.length - 1) { if (i !== this.tableHead.length - 1) {
csvOut += ','; csvOut += ',';
} }
});
} }
for (let j = 0; j < this.war.players.length; j++) { for (let j = 0; j < this.war.players.length; j++) {
const player = this.war.players[j]; const player = this.war.players[j];
csvOut += '\r\n'; csvOut += '\r\n';

View File

@ -26,11 +26,11 @@
</div> </div>
<div class="form-group" *ngIf="!war._id"> <div class="form-group" *ngIf="!war._id">
<label for="log">Logfile</label> <label for="log">{{'stats.war.submit.logfile' | translate}}</label>
<input id="log" name="log" class="ui-button form-control" type="file" <input id="log" name="log" class="ui-button form-control" type="file"
(change)="fileChange($event)"> (change)="fileChange($event)">
<span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showFileError"> <span class="label label-bg label-danger center-block" style="font-size:small" *ngIf="showFileError">
Logfile muss im Format RPT, LOG oder TXT vorliegen {{'stats.war.submit.error.file.format' | translate}}
</span> </span>
</div> </div>

View File

@ -8,6 +8,7 @@ import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-
import {SpinnerService} from '../../../services/user-interface/spinner/spinner.service'; import {SpinnerService} from '../../../services/user-interface/spinner/spinner.service';
import {Subscription} from 'rxjs'; import {Subscription} from 'rxjs';
import {Fraction} from '../../../utils/fraction.enum'; import {Fraction} from '../../../utils/fraction.enum';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
@ -38,6 +39,7 @@ export class WarSubmitComponent {
private warService: WarService, private warService: WarService,
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
private spinnerService: SpinnerService, private spinnerService: SpinnerService,
private translate: TranslateService,
public campaignService: CampaignService) { public campaignService: CampaignService) {
this.subscription = this.route.params this.subscription = this.route.params
.map(params => params['id']) .map(params => params['id'])
@ -61,7 +63,12 @@ export class WarSubmitComponent {
saveWar() { saveWar() {
if (!this.fileList) { if (!this.fileList) {
return window.alert(`Logfile ist ein Pflichtfeld`); this.translate.get('stats.war.submit.logfile').subscribe((fieldNameLogfile) => {
this.translate.get('public.error.message.required',
{fieldName: fieldNameLogfile}).subscribe((message) => {
this.snackBarService.showError(message, 4000);
})
})
} }
const file: File = this.fileList[0]; const file: File = this.fileList[0];
this.loading = true; this.loading = true;

View File

@ -1,8 +1,8 @@
<form #form="ngForm" class="overview"> <form #form="ngForm" class="overview">
<h3>Teilnehmer auszeichnen</h3> <h3>{{'users.award.headline' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="decoration">Auszeichnung</label> <label for="decoration">{{'users.award.field.decoration' | translate}}</label>
<select class="form-control" <select class="form-control"
name="decoration" name="decoration"
id="decoration" id="decoration"
@ -11,14 +11,13 @@
[ngModel]="0" [ngModel]="0"
required required
style="min-width: 200px;"> style="min-width: 200px;">
<option [value]="0">Auswählen...</option> <option [value]="0">{{'users.award.field.decoration.placeholder' | translate}}</option>
<option *ngFor="let deco of decorations" [value]="deco._id"> <option *ngFor="let deco of decorations" [value]="deco._id">
{{deco.fraction == 'BLUFOR'? fraction.BLUFOR : deco.fraction == 'OPFOR'? fraction.OPFOR : 'Global'}}: {{deco.fraction == 'BLUFOR'? fraction.BLUFOR : deco.fraction == 'OPFOR'? fraction.OPFOR : 'Global'}}:
{{deco.name}} {{deco.name}}
</option> </option>
</select> </select>
<show-error displayName="{{'users.award.field.decoration' | translate}}" controlPath="decoration"></show-error>
<show-error displayName="Auszeichnung" controlPath="decoration"></show-error>
</div> </div>
<div class="div-table-row" [style.display]="decoPreviewDisplay" style="margin-top: 5px; margin-bottom:10px"> <div class="div-table-row" [style.display]="decoPreviewDisplay" style="margin-top: 5px; margin-bottom:10px">
@ -38,37 +37,40 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="reason">Begründung</label> <label for="reason">{{'users.award.field.reason' | translate}}</label>
<textarea class="form-control center-block" name="reason" [ngModel]="undefined" required <textarea class="form-control center-block" name="reason" [ngModel]="undefined" required
id="reason" placeholder="Begründung eingeben..." rows="3" #awardTextArea></textarea> id="reason" placeholder="{{'users.award.field.reason.placeholder' | translate}}"
<show-error displayName="Begründung" controlPath="reason"></show-error> rows="3" #awardTextArea>
</textarea>
<show-error displayName="{{'users.award.field.reason' | translate}}" controlPath="reason"></show-error>
</div> </div>
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'users.award.button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
(click)="addAwarding(decorationField, awardTextArea, decoPreview, decoDescription)" (click)="addAwarding(decorationField, awardTextArea, decoPreview, decoDescription)"
class="btn btn-default" class="btn btn-default"
[disabled]="decorationField.value === '0' || !form.valid"> [disabled]="decorationField.value === '0' || !form.valid">
Bestätigen {{'users.award.button.submit' | translate}}
</button> </button>
<div class="table-container"> <div class="table-container">
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1">Bild</th> <th class="col-sm-1">{{'users.award.table.head.image' | translate}}</th>
<th class="col-sm-2">Bezeichnung</th> <th class="col-sm-2">{{'users.award.table.head.name' | translate}}</th>
<th class="col-sm-2">Begründung</th> <th class="col-sm-2">{{'users.award.table.head.reason' | translate}}</th>
<th class="col-sm-1 text-right">Datum</th> <th class="col-sm-1 text-right">{{'users.award.table.head.date' | translate}}</th>
<th class="col-sm-1 text-center">Status</th> <th class="col-sm-1 text-center">{{'users.award.table.head.status' | translate}}</th>
<th class="col-sm-1 text-center"> <th class="col-sm-1 text-center">
<span class="btn btn-default" (click)="deleteAwarding()">Löschen</span> <span class="btn btn-default" (click)="deleteAwarding()">
{{'users.award.table.button.delete' | translate}}
</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -90,7 +92,9 @@
<a class="small text-nowrap">{{award.date | date: 'dd.MM.yyyy'}}</a> <a class="small text-nowrap">{{award.date | date: 'dd.MM.yyyy'}}</a>
</td> </td>
<td class="text-center"> <td class="text-center">
{{award.confirmed === 0 ? 'In Bearbeitung' : (award.confirmed === 1 ? 'Genehmigt' : 'Abgelehnt')}} {{award.confirmed === 0 ?
awardStatus['users.award.table.status.in.progress'] : (award.confirmed === 1 ?
awardStatus['users.award.table.status.approved']: awardStatus['users.award.table.status.rejected'])}}
</td> </td>
<td class="text-center"> <td class="text-center">
<label> <label>

View File

@ -7,6 +7,7 @@ import {DecorationService} from '../../services/army-management/decoration.servi
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 {Message} from '../../i18n/de.messages';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
@ -23,6 +24,8 @@ export class AwardUserComponent implements OnInit {
awards: Award[]; awards: Award[];
awardStatus = {};
decoPreviewDisplay = 'none'; decoPreviewDisplay = 'none';
readonly fraction = Fraction; readonly fraction = Fraction;
@ -31,10 +34,18 @@ export class AwardUserComponent implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private awardingService: AwardingService, private awardingService: AwardingService,
private decorationService: DecorationService, private decorationService: DecorationService,
private snackBarService: SnackBarService) { private snackBarService: SnackBarService,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
['users.award.table.status.in.progress',
'users.award.table.status.approved',
'users.award.table.status.rejected'].forEach((i18n) => {
this.translate.get(i18n).subscribe((translated) => {
this.awardStatus[i18n] = translated;
})
});
this.decorationService.findDecorations().subscribe(decorations => { this.decorationService.findDecorations().subscribe(decorations => {
this.decorations = decorations; this.decorations = decorations;

View File

@ -1,38 +1,36 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3 *ngIf="user._id">Teilnehmer editieren</h3> <h3 *ngIf="user._id">{{'user.submit.headline.edit' | translate}}</h3>
<h3 *ngIf="!user._id">Neuen Teilnehmer hinzufügen</h3> <h3 *ngIf="!user._id">{{'user.submit.headline.new' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="title">Name</label> <label for="title">{{'user.submit.field.name' | translate}}</label>
<input class="form-control" <input class="form-control"
[(ngModel)]="user.username" [(ngModel)]="user.username"
name="title" name="title"
id="title" id="title"
required required
maxlength="50"/> maxlength="50"/>
<show-error displayName="{{'user.submit.field.name' | translate}}" controlPath="title"></show-error>
<show-error displayName="Name" controlPath="title"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="squad">Squad</label> <label for="squad">{{'user.submit.field.squad' | translate}}</label>
<select class="form-control" <select class="form-control"
name="squad" name="squad"
id="squad" id="squad"
[(ngModel)]="user.squadId" [(ngModel)]="user.squadId"
[compareWith]="equals" [compareWith]="equals"
(change)="toggleRanks()"> (change)="toggleRanks()">
<option [value]="0">Ohne Fraktion/ Squad</option> <option [value]="0">{{'user.submit.field.squad.not.assigned' | translate}}</option>
<option *ngFor="let squad of squads" [ngValue]="squad"> <option *ngFor="let squad of squads" [ngValue]="squad">
{{squad.fraction == 'BLUFOR'? fraction.BLUFOR : fraction.OPFOR}}: {{squad.name}} {{squad.fraction == 'BLUFOR'? fraction.BLUFOR : fraction.OPFOR}}: {{squad.name}}
</option> </option>
</select> </select>
<show-error displayName="{{'user.submit.field.squad' | translate}}" controlPath="squad"></show-error>
<show-error displayName="Squad" controlPath="squad"></show-error>
</div> </div>
<div class="form-group" [style.display]="ranksDisplay"> <div class="form-group" [style.display]="ranksDisplay">
<label for="rank">Rang</label> <label for="rank">{{'user.submit.field.rank' | translate}}</label>
<select class="form-control" <select class="form-control"
name="rank" name="rank"
id="rank" [ngModel]="user.rankLvl" id="rank" [ngModel]="user.rankLvl"
@ -40,14 +38,13 @@
style="min-width: 200px;"> style="min-width: 200px;">
<option *ngFor="let rank of ranks" [value]="rank.level">{{rank.name}}</option> <option *ngFor="let rank of ranks" [value]="rank.level">{{rank.name}}</option>
</select> </select>
<show-error displayName="{{'user.submit.field.rank' | translate}}" controlPath="rank"></show-error>
<show-error displayName="Rang" controlPath="rank"></show-error>
</div> </div>
<button id="cancel" <button id="cancel"
(click)="cancel()" (click)="cancel()"
class="btn btn-default"> class="btn btn-default">
Abbrechen {{'user.submit.button.cancel' | translate}}
</button> </button>
<button id="save" <button id="save"
@ -55,6 +52,6 @@
(click)="saveUser(rankLevel.value)" (click)="saveUser(rankLevel.value)"
class="btn btn-default" class="btn btn-default"
[disabled]="!form.valid"> [disabled]="!form.valid">
Bestätigen {{'user.submit.button.submit' | translate}}
</button> </button>
</form> </form>

View File

@ -130,5 +130,4 @@ export class EditUserComponent implements OnInit {
return o1._id === o2._id; return o1._id === o2._id;
} }
} }
} }

View File

@ -9,12 +9,14 @@
<small *ngIf="user.squadId && user.squadId.fraction == 'OPFOR'">{{fraction.OPFOR}} - {{user.squadId.name}}</small> <small *ngIf="user.squadId && user.squadId.fraction == 'OPFOR'">{{fraction.OPFOR}} - {{user.squadId.name}}</small>
<small *ngIf="user.squadId && user.squadId.fraction == 'BLUFOR'">{{fraction.BLUFOR}} - {{user.squadId.name}} <small *ngIf="user.squadId && user.squadId.fraction == 'BLUFOR'">{{fraction.BLUFOR}} - {{user.squadId.name}}
</small> </small>
<small *ngIf="!user.squadId">ohne Squad/Fraktion</small> <small *ngIf="!user.squadId">{{'users.list.item.label.no.squad' | translate}}</small>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<mat-icon (click)="delete(); $event.stopPropagation()" matTooltip="Löschen" class="pull-right" style="margin-top: 8px;" svgIcon="delete"></mat-icon> <mat-icon (click)="delete(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.delete' | translate}}"
<mat-icon (click)="award(); $event.stopPropagation()" matTooltip="Auszeichnungen" class="icon-award pull-right" svgIcon="award"></mat-icon> class="pull-right" style="margin-top: 8px;" svgIcon="delete"></mat-icon>
<mat-icon (click)="award(); $event.stopPropagation()" matTooltip="{{'users.list.tooltip.awards' | translate}}"
class="icon-award pull-right" svgIcon="award"></mat-icon>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,8 +2,8 @@
<cc-list-filter <cc-list-filter
[filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'}, [filterButtons]="[{label: fraction.BLUFOR, value: 'BLUFOR'},
{label: fraction.OPFOR, value: 'OPFOR'}, {label: fraction.OPFOR, value: 'OPFOR'},
{label: 'Ohne Squad', value: 'UNASSIGNED'}]" {label: 'users.list.filter.no.squad', value: 'UNASSIGNED'}]"
[addButton]="{svgIcon: 'add-user', tooltip: 'Neuen Teilnehmer hinzufügen'}" [addButton]="{svgIcon: 'add-user', tooltip: 'users.list.tooltip.new'}"
(executeSearch)="filterUsers(undefined, $event)" (executeSearch)="filterUsers(undefined, $event)"
(openAddFrom)="openNewUserForm()"> (openAddFrom)="openNewUserForm()">
</cc-list-filter> </cc-list-filter>

View File

@ -9,6 +9,7 @@ import {ADD, LOAD} from '../../services/stores/user.store';
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {MatButtonToggleGroup} from '@angular/material'; import {MatButtonToggleGroup} from '@angular/material';
import {UIHelpers} from '../../utils/global.helpers'; import {UIHelpers} from '../../utils/global.helpers';
import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'cc-user-list', selector: 'cc-user-list',
@ -37,7 +38,8 @@ export class UserListComponent implements OnInit {
constructor(private userService: UserService, constructor(private userService: UserService,
private router: Router, private router: Router,
private route: ActivatedRoute) { private route: ActivatedRoute,
private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
@ -67,11 +69,13 @@ export class UserListComponent implements OnInit {
} }
deleteUser(user: User) { deleteUser(user: User) {
if (confirm('Soll der Teilnehmer "' + user.username + '" wirklich gelöscht werden?')) { this.translate.get('squad.list.delete.confirm', {name: user.username}).subscribe((confirmQuestion) => {
if (confirm(confirmQuestion)) {
this.userService.deleteUser(user) this.userService.deleteUser(user)
.subscribe((res) => { .subscribe((res) => {
}); });
} }
});
} }
filterUsers(action?, group?: MatButtonToggleGroup) { filterUsers(action?, group?: MatButtonToggleGroup) {

View File

@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@ -0,0 +1,14 @@
import {Component} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-users-root',
templateUrl: './users.component.html',
styleUrls: ['./users.component.scss']
})
export class UsersComponent {
constructor(private translate: TranslateService) {
this.translate.setDefaultLang('de');
}
}

View File

@ -3,10 +3,32 @@ import {usersRouterModule, usersRoutingComponents} from './users.routing';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {SharedModule} from '../shared.module'; import {SharedModule} from '../shared.module';
import {InfiniteScrollModule} from 'ngx-infinite-scroll'; import {InfiniteScrollModule} from 'ngx-infinite-scroll';
import {HttpClient} from '@angular/common/http';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/users/', '.json');
}
@NgModule({ @NgModule({
declarations: usersRoutingComponents, declarations: usersRoutingComponents,
imports: [CommonModule, SharedModule, InfiniteScrollModule, usersRouterModule],
imports: [
CommonModule,
SharedModule,
InfiniteScrollModule,
usersRouterModule,
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
isolate: true
})
],
}) })
export class UsersModule { export class UsersModule {
static routes = usersRouterModule; static routes = usersRouterModule;

View File

@ -4,8 +4,13 @@ import {UserListComponent} from './user-list/user-list.component';
import {AwardUserComponent} from './award-user/award-user.component'; import {AwardUserComponent} from './award-user/award-user.component';
import {ModuleWithProviders} from '@angular/core'; import {ModuleWithProviders} from '@angular/core';
import {UserItemComponent} from './user-list/user-item.component'; import {UserItemComponent} from './user-list/user-item.component';
import {UsersComponent} from './users.component';
export const usersRoutes: Routes = [ export const usersRoutes: Routes = [
{
path: '',
component: UsersComponent,
},
{ {
path: '', path: '',
component: UserListComponent, component: UserListComponent,
@ -30,4 +35,5 @@ export const usersRoutes: Routes = [
export const usersRouterModule: ModuleWithProviders = RouterModule.forChild(usersRoutes); export const usersRouterModule: ModuleWithProviders = RouterModule.forChild(usersRoutes);
export const usersRoutingComponents = [UserItemComponent, UserListComponent, EditUserComponent, AwardUserComponent]; export const usersRoutingComponents = [UsersComponent, UserItemComponent, UserListComponent, EditUserComponent,
AwardUserComponent];

View File

@ -1,4 +1,13 @@
{ {
"public.error.headline": "Oops, diese Seite kennen wir nicht...",
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen",
"navigation.top.board": "Zum Forum", "navigation.top.board": "Zum Forum",
"navigation.top.overview": "Armeeübersicht", "navigation.top.overview": "Armeeübersicht",
"navigation.top.ranks": "Ränge", "navigation.top.ranks": "Ränge",
@ -34,5 +43,11 @@
"public.army.headline": "Übersicht über alle Spieler, Squads und Armeen", "public.army.headline": "Übersicht über alle Spieler, Squads und Armeen",
"public army.squad.members": "Mitglieder:", "public army.squad.members": "Mitglieder:",
"public.army.members": "Armeemitglieder:", "public.army.members": "Armeemitglieder:",
"public.error.headline": "Oops, diese Seite kennen wir nicht..."
"public.army.member.button.back": "Zurück",
"public.army.member.button.copy": "kopieren",
"public.army.member.headline": "Auszeichnungen von {{name}}",
"public.army.member.awards.title": "Bezeichnung",
"public.army.member.awards.reason": "Begründung",
"public.army.member.awards.date": "Verliehen am"
} }

View File

@ -0,0 +1,31 @@
{
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen",
"decorations.list.button.add": "Neue Auszeichnung hinzufügen",
"decorations.list.button.delete": "Löschen",
"decorations.list.filter.global": "Global",
"decorations.list.delete.confirm": "Soll die Auszeichnung '{{name}}' ({{fraction}}) wirklich gelöscht werden?",
"decorations.item.label.sort": " - Sortierung {{value}}",
"decorations.submit.headline.edit": "Auszeichnung bearbeiten",
"decorations.submit.headline.new": "Neue Auszeichnung hinzufügen",
"decorations.submit.field.name": "Name",
"decorations.submit.field.fraction": "Fraktion",
"decorations.submit.field.fraction.global": "Global",
"decorations.submit.field.type": "Art",
"decorations.submit.field.type.ribbon": "Ordensband",
"decorations.submit.field.type.medal": "Orden",
"decorations.submit.field.sort": "Sortierung",
"decorations.submit.field.description": "Beschreibung",
"decorations.submit.field.image": "Bild",
"decorations.submit.field.image.error.type": "Bild muss im PNG Format vorliegen",
"decorations.submit,button.submit": "Bestätigen",
"decorations.submit,button.cancel": "Abbrechen"
}

View File

@ -0,0 +1,3 @@
{
}

View File

@ -0,0 +1,24 @@
{
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen",
"ranks.list.button.add": "Neuen Rank hinzufügen",
"ranks.list.button.delete": "Löschen",
"ranks.list.delete.confirm": "Soll der Rang '{{name}}' ({{fraction}}) wirklich gelöscht werden?",
"ranks.list.item.label.level": " - Stufe {{level}}",
"ranks.submit.headline.new": "Neuen Rang hinzufügen",
"ranks.submit.headline.edit": "Rang bearbeiten",
"ranks.submit.field.name": "Name",
"ranks.submit.field.fraction": "Fraktion",
"ranks.submit.field.level": "Stufe",
"ranks.submit.field.image": "Bild",
"ranks.submit.field.image.error.format": "Bild muss im PNG Format vorliegen",
"ranks.submit.button.submit": "Bestätigen",
"ranks.submit.button.cancel": "Abbrechen"
}

View File

@ -0,0 +1,3 @@
{
}

View File

@ -0,0 +1,72 @@
{
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen",
"request.confirm.award.headline": "Offene Anträge - Auszeichnungen",
"request.confirm.award.table.head.participant": "Teilnehmer",
"request.confirm.award.table.head.award": "Auszeichnung",
"request.confirm.award.table.head.reason": "Begründung",
"request.confirm.award.table.head.requester": "Antragsteller",
"request.confirm.award.table.head.date": "Datum",
"request.confirm.award.table.head.action": "Aktion",
"request.confirm.award.table.reject.reason.placeholder": "Begründung für Ablehnung (optional)",
"request.confirm.award.table.button.action.accept": "Bestätigen",
"request.confirm.award.table.button.action.reject": "Ablehnen",
"request.confirm.promotion.headline": "Offene Anträge - Beförderungen",
"request.confirm.promotion.table.head.participant": "Teilnehmer",
"request.confirm.promotion.table.head.rank.before": "Alter Rang",
"request.confirm.promotion.table.head.rank.after": "Neuer Rang",
"request.confirm.promotion.table.head.requester": "Antragsteller",
"request.confirm.promotion.table.head.date": "Datum",
"request.confirm.promotion.table.head.status": "Status",
"request.confirm.promotion.table.head.action": "Aktion",
"request.confirm.promotion.table.reject.reason.placeholder": "Begründung für Ablehnung (optional)",
"request.confirm.promotion.table.button.action.accept": "Bestätigen",
"request.confirm.promotion.table.button.action.reject": "Ablehnen",
"request.confirm.promotion.table.status.progressing": "In Bearbeitung",
"request.confirm.promotion.table.status.accepted": "Genehmigt",
"request.confirm.promotion.table.status.rejected": "Abgelehnt",
"request.award.headline": "Auszeichnung beantragen",
"request.award.field.user": "Teilnehmer",
"request.award.field.user.placeholder": "Auswählen...",
"request.award.field.award": "Auszeichnung",
"request.award.field.award.placeholder": "Auswählen...",
"request.award.field.reason": "Begründung",
"request.award.field.reason.placeholder": "Begründung eingeben...",
"request.award.button.cancel": "Abbrechen",
"request.award.button.submit": "Bestätigen",
"request.award.table.head.image": "Bild",
"request.award.table.head.name": "Bezeichnung",
"request.award.table.head.reason": "Begründung",
"request.award.table.head.requester": "Antragsteller",
"request.award.table.head.date": "Datum",
"request.award.table.head.status": "Status",
"request.award.table.head.reject.reason": "Grund für Ablehnung",
"request.award.table.status.progressing": "In Bearbeitung",
"request.award.table.status.accepted": "Genehmigt",
"request.award.table.status.rejected": "Abgelehnt",
"request.promotion.headline": "Beförderung beantragen",
"request.promotion.field.participant": "Teilnehmer",
"request.promotion.field.participant.placeholder": "Auswählen...",
"request.promotion.field.rank.before": "Aktueller Rang",
"request.promotion.field.rank.after": "Neuer Rang",
"request.promotion.button.submit": "Bestätigen",
"request.promotion.button.cancel": "Abbrechen",
"request.promotion.table.head.participant": "Teilnehmer",
"request.promotion.table.head.rank.before": "Alter Rang",
"request.promotion.table.head.rank.after": "Neuer Rang",
"request.promotion.table.head.requester": "Antragsteller",
"request.promotion.table.head.date": "Datum",
"request.promotion.table.head.status": "Status",
"request.promotion.table.head.reject.reason": "Grund für Ablehnung",
"request.sql.dashboard.headline":"SQL Dashboard"
}

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,22 @@
{
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen",
"squad.list.tooltip.delete": "Löschen",
"squad.list.delete.confirm": "Soll das Squad '{{name}}' ({{fraction}}) wirklich gelöscht werden?",
"squad.list.tooltip.new": "Neues Squad hinzufügen",
"squad.submit.new.headline": "Neues Squad hinzufügen",
"squad.submit.edit.headline": "Squad bearbeiten",
"squad.submit.field.name": "Name",
"squad.submit.field.fraction": "Fraktion",
"squad.submit.field.sort": "Sortierung",
"squad.submit.field.logo": "Logo",
"squad.submit.error.logo.type": "Bild muss im PNG Format vorliegen",
"squad.submit.button.submit": "Bestätigen",
"squad.submit.button.cancel": "Abbrechen"
}

View File

@ -0,0 +1,3 @@
{
}

View File

@ -63,14 +63,24 @@
"stats.war.submit.headline.edit": "Schlacht bearbeiten", "stats.war.submit.headline.edit": "Schlacht bearbeiten",
"stats.war.submit.title": "Titel", "stats.war.submit.title": "Titel",
"stats.war.submit.campaign": "Kampagne", "stats.war.submit.campaign": "Kampagne",
"stats.war.submit.logfile": "Logfile",
"stats.war.submit.points": "Punkte", "stats.war.submit.points": "Punkte",
"stats.war.submit.final.budget": "Endbudget", "stats.war.submit.final.budget": "Endbudget",
"stats.war.submit.button.submit": "Bestätigen", "stats.war.submit.button.submit": "Bestätigen",
"stats.war.submit.button.cancel": "Abbrechen", "stats.war.submit.button.cancel": "Abbrechen",
"stats.war.submit.error.file.format": "Logfile muss im Format RPT, LOG oder TXT vorliegen",
"stats.campaign.submit.headline.new": "Neue Kampagne hinzufügen", "stats.campaign.submit.headline.new": "Neue Kampagne hinzufügen",
"stats.campaign.submit.headline.edit": "Kampagne editieren", "stats.campaign.submit.headline.edit": "Kampagne editieren",
"stats.campaign.submit.title": "Titel", "stats.campaign.submit.title": "Titel",
"stats.campaign.submit.button.submit": "Bestätigen", "stats.campaign.submit.button.submit": "Bestätigen",
"stats.campaign.submit.button.cancel": "Abbrechen" "stats.campaign.submit.button.cancel": "Abbrechen",
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen"
} }

View File

@ -0,0 +1,44 @@
{
"public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
"public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
"public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
"public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
"public.error.message.default": "{{fieldName}} ist nicht valide",
"public.common.search.button": "Suchen",
"users.list.tooltip.new": "Neuen Teilnehmer hinzufügen",
"users.list.tooltip.delete": "Löschen",
"users.list.tooltip.awards": "Auszeichnungen",
"users.list.filter.no.squad": "Ohne Squad",
"users.list.item.label.no.squad": "ohne Squad/Fraktion",
"ranks.list.delete.confirm": "Soll der Teilnehmer '{{name}}' wirklich gelöscht werden?",
"users.award.headline": "Teilnehmer auszeichnen",
"users.award.field.decoration": "Auszeichnung",
"users.award.field.decoration.placeholder": "Auswählen...",
"users.award.field.reason": "Begründung",
"users.award.field.reason.placeholder": "Begründung eingeben...",
"users.award.button.submit": "Bestätigen",
"users.award.button.cancel": "Abbrechen",
"users.award.table.head.image": "Bild",
"users.award.table.head.name": "Bezeichnung",
"users.award.table.head.reason": "Begründung",
"users.award.table.head.date": "Datum",
"users.award.table.head.status": "Status",
"users.award.table.button.delete": "Löschen",
"users.award.table.status.in.progress": "In Bearbeitung",
"users.award.table.status.approved": "Genehmigt",
"users.award.table.status.rejected": "Abgelehnt",
"user.submit.headline.new": "Neuen Teilnehmer hinzufügen",
"user.submit.headline.edit": "Teilnehmer bearbeiten",
"user.submit.field.name": "Name",
"user.submit.field.squad": "Squad",
"user.submit.field.squad.not.assigned": "Ohne Fraktion/ Squad",
"user.submit.field.rank": "Rang",
"user.submit.button.submit": "Bestätigen",
"user.submit.button.cancel": "Abbrechen"
}

View File

@ -0,0 +1,3 @@
{
}