Compare commits

..

No commits in common. "4cf2e627552b0d9cde160685f2820f822cffd467" and "fe7140afd9c89d836d90ddd64c5d2a41a9f66559" have entirely different histories.

11 changed files with 174 additions and 225 deletions

View File

@ -22,7 +22,7 @@ import {HttpClientModule} from '@angular/common/http';
import {SpinnerService} from './services/user-interface/spinner/spinner.service'; import {SpinnerService} from './services/user-interface/spinner/spinner.service';
import {SettingsService} from './services/settings.service'; import {SettingsService} from './services/settings.service';
import {HttpGateway} from './services/http-gateway'; import {HttpGateway} from './services/http-gateway';
import {MatListModule, MatMenuModule, MatSidenavModule, MatTableModule, MatToolbarModule} from '@angular/material'; import {MatListModule, MatMenuModule, MatSidenavModule, MatToolbarModule} from '@angular/material';
import {FlexLayoutModule} from '@angular/flex-layout'; import {FlexLayoutModule} from '@angular/flex-layout';
@NgModule({ @NgModule({
@ -38,7 +38,6 @@ import {FlexLayoutModule} from '@angular/flex-layout';
MatToolbarModule, MatToolbarModule,
MatListModule, MatListModule,
MatMenuModule, MatMenuModule,
MatTableModule,
FlexLayoutModule, FlexLayoutModule,
], ],

View File

@ -25,35 +25,40 @@
</span> </span>
</div> </div>
<div class="pull-left" class="table-container"> <div class="pull-left" style="margin-top:20px;">
<mat-table [dataSource]="awards" class="mat-elevation-z8"> <div class="table-container" style="min-width: 500px">
<ng-container matColumnDef="award-graphics"> <table class="table">
<mat-header-cell *matHeaderCellDef></mat-header-cell> <thead>
<mat-cell *matCellDef="let element"> <tr class="table-head">
<img src="resource/decoration/{{element.decorationId._id}}.png"> <th class="col-sm-1" style="border-radius: 10px 0 0 0;"></th>
</mat-cell> <th class="col-sm-2">{{'public.army.member.awards.title' | translate}}</th>
</ng-container> <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;">
<ng-container matColumnDef="title"> {{'public.army.member.awards.date' | translate}}
<mat-header-cell *matHeaderCellDef>{{'public.army.member.awards.title' | translate}}</mat-header-cell> </th>
<mat-cell *matCellDef="let element">{{element.decorationId.name}}</mat-cell> </tr>
</ng-container> </thead>
<tbody *ngFor="let award of awards">
<ng-container matColumnDef="reason"> <tr *ngIf="award.confirmed === 1" class="cell-outline">
<mat-header-cell *matHeaderCellDef>{{'public.army.member.awards.reason' | translate}}</mat-header-cell> <td class="text-center" *ngIf="award.decorationId.isMedal">
<mat-cell *matCellDef="let element">{{element.reason}}</mat-cell> <img height="90px" src="resource/decoration/{{award.decorationId._id}}.png">
</ng-container> </td>
<td class="text-center" *ngIf="!award.decorationId.isMedal">
<ng-container matColumnDef="date"> <img width="100px" src="resource/decoration/{{award.decorationId._id}}.png">
<mat-header-cell *matHeaderCellDef>{{'public.army.member.awards.date' | translate}}</mat-header-cell> </td>
<mat-cell *matCellDef="let element"> <td style="font-weight: bold">
<span class="small text-nowrap">{{element.date | date: 'dd.MM.yyyy'}}</span> {{award.decorationId.name}}
</mat-cell> </td>
</ng-container> <td>
{{award.reason}}
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> </td>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> <td class="text-right">
</mat-table> <span class="small text-nowrap">{{award.date | date: 'dd.MM.yyyy'}}</span>
</td>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -23,11 +23,10 @@
table-layout: fixed; table-layout: fixed;
} }
div.table-container { .table-container {
margin-top:20px; margin-top: 10px;
padding: 5px; padding: 5px;
overflow-x: auto; overflow-x: auto;
min-width: 500px;
} }
.table-head { .table-head {
@ -35,12 +34,8 @@ div.table-container {
color: white; color: white;
} }
mat-table.mat-table { tbody {
background: rgba(255, 255, 255, 0.70); background: rgba(255, 255, 255, 0.88);
}
mat-row.mat-row {
@extend mat-table.mat-table;
} }
.cell-outline { .cell-outline {

View File

@ -2,6 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {Award, User} from '../../models/model-interfaces'; import {Award, User} from '../../models/model-interfaces';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {UserService} from '../../services/army-management/user.service'; import {UserService} from '../../services/army-management/user.service';
import {Subscription} from 'rxjs/Subscription';
import {AwardingService} from '../../services/army-management/awarding.service'; import {AwardingService} from '../../services/army-management/awarding.service';
import {Fraction} from '../../utils/fraction.enum'; import {Fraction} from '../../utils/fraction.enum';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
@ -13,6 +14,8 @@ import {Location} from '@angular/common';
}) })
export class ArmyMemberComponent implements OnInit { export class ArmyMemberComponent implements OnInit {
subscription: Subscription;
user: User = {}; user: User = {};
awards: Award[] = []; awards: Award[] = [];
@ -23,8 +26,6 @@ export class ArmyMemberComponent implements OnInit {
readonly fraction = Fraction; readonly fraction = Fraction;
readonly displayedColumns = ['award-graphics', 'title', 'reason', 'date'];
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private userService: UserService, private userService: UserService,
@ -33,17 +34,17 @@ export class ArmyMemberComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.route.params this.subscription = this.route.params
.map(params => params['id']) .map(params => params['id'])
.filter(id => id !== undefined) .filter(id => id !== undefined)
.flatMap(id => this.userService.getUser(id)) .flatMap(id => this.userService.getUser(id))
.subscribe(user => { .subscribe(user => {
this.user = user; this.user = user;
this.signatureUrl = window.location.origin + '/resource/signature/' + user._id + '.png'; this.signatureUrl = window.location.origin + '/resource/signature/' + user._id + '.png';
this.awardingService.getUserAwardings(user._id).subscribe((awards => { this.awardingService.getUserAwardings(user._id).subscribe((awards => {
this.awards = awards; this.awards = awards;
})); }));
}); });
}; };
backToOverview() { backToOverview() {

View File

@ -1,6 +1,6 @@
<form class="form-signin" (ngSubmit)="login(userName.value, password.value)"> <form class="form-signin" (ngSubmit)="login(userName.value, password.value)">
<div class="row"> <div class="row">
<h2>{{'login.headline' | translate}}</h2> <h2 class="form-signin-heading">{{'login.headline' | translate}}</h2>
<label for="inputEmail" class="sr-only">{{'login.username' | translate}}</label> <label for="inputEmail" class="sr-only">{{'login.username' | translate}}</label>
<input #userName id="inputEmail" class="form-control" <input #userName id="inputEmail" class="form-control"
@ -11,10 +11,12 @@
<input #password type="password" id="inputPassword" class="form-control" <input #password type="password" id="inputPassword" class="form-control"
placeholder="{{'login.password' | translate}}" required=""> placeholder="{{'login.password' | translate}}" required="">
<button mat-stroked-button type="submit"> <div class="form-group">
<span *ngIf="!loading">{{'login.submit' | translate}}</span> <button mat-stroked-button type="submit">
<span *ngIf="loading" class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> <span *ngIf="!loading">{{'login.submit' | translate}}</span>
</button> <span *ngIf="loading" class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
</button>
</div>
</div> </div>
</form> </form>

View File

@ -2,31 +2,53 @@
width: 100%; width: 100%;
padding: 15px; padding: 15px;
margin: 0 auto; margin: 0 auto;
}
& > .row { .form-signin > .row {
max-width: 400px; max-width: 400px;
margin: auto; margin: auto;
}
& > h2 { .form-signin-heading {
text-align: center text-align: center;
} }
input.form-control { .form-signin .form-signin-heading, .form-signin .checkbox, #inputEmail {
margin-bottom: 10px; margin-bottom: 10px;
border-bottom-left-radius: 0; }
border-bottom-right-radius: 0;
font-size: 16px;
height: auto;
padding: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
button { .form-signin .checkbox {
width: 100%; font-weight: normal;
} }
}
.form-signin .form-control {
position: relative;
font-size: 16px;
height: auto;
padding: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="text"] {
margin-bottom: 5px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
button {
width: 100%;
} }
/* Loading Animation */ /* Loading Animation */

View File

@ -1,27 +1,26 @@
<form class="form-signin" (ngSubmit)="signup(userName.value, password.value, secret.value)"> <form class="form-signin" (ngSubmit)="signup(userName.value, password.value, secret.value)">
<div class="row"> <div class="row" style="position: absolute;width: 500px;left: 40%;">
<h2>{{'signup.headline' | translate}}</h2> <h2 style="text-align: center;" class="form-signin-heading">{{'signup.headline' | translate}}</h2>
<p [innerHtml]="'signup.description' | translate"></p> <p [innerHtml]="'signup.description' | translate"></p>
<label for="inputEmail" class="sr-only">{{'signup.username' | translate}}</label> <label for="inputEmail" class="sr-only">{{'signup.username' | translate}}</label>
<input #userName id="inputEmail" class="form-control" placeholder="{{'signup.username' | translate}}" required="" <input #userName id="inputEmail" class="form-control" placeholder="{{'signup.username' | translate}}" required="" autofocus="">
autofocus="">
<label for="inputPassword" class="sr-only">{{'signup.password' | translate}}</label> <label for="inputPassword" class="sr-only">{{'signup.password' | translate}}</label>
<input #password type="password" id="inputPassword" class="form-control" <input #password type="password" id="inputPassword" class="form-control" placeholder="{{'signup.password' | translate}}" required="">
placeholder="{{'signup.password' | translate}}" required="">
<label for="inputSecret" class="sr-only">{{'signup.secret' | translate}}</label> <label for="inputSecret" class="sr-only">{{'signup.secret' | translate}}</label>
<input #secret type="text" id="inputSecret" class="form-control" <input #secret type="text" id="inputSecret" class="form-control" placeholder="{{'signup.secret.placeholder' | translate}}"
placeholder="{{'signup.secret.placeholder' | translate}}"
required=""> required="">
<button mat-stroked-button type="submit"> <div class="form-group">
<span *ngIf="!loading">{{'signup.submit' | translate}}</span> <button type="submit" class="btn btn-lg btn-block btn-primary">
<span *ngIf="loading" class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> <span *ngIf="!loading">{{'signup.submit' | translate}}</span>
</button> <span *ngIf="loading" class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
</button>
</div>
</div> </div>
</form> </form>

View File

@ -1,45 +1,48 @@
<mat-table matSort <div class="fade-in scoreboard-table">
[dataSource]="sortedRows"
matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
(matSortChange)="sortScoreboardData($event)"
class="mat-elevation-z8 fade-in">
<ng-container matColumnDef="{{tableHead[0].prop}}" sticky> <mat-table matSort
<mat-header-cell *matHeaderCellDef [dataSource]="sortedRows"
mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell> matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
<mat-cell *matCellDef="let element" (matSortChange)="sortScoreboardData($event)"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> class="mat-elevation-z8">
{{element.name}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="{{tableHead[1].prop}}"> <ng-container matColumnDef="{{tableHead[0].prop}}">
<mat-header-cell *matHeaderCellDef <mat-header-cell *matHeaderCellDef
mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell> mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
<mat-cell *matCellDef="let element">{{element.fraction === <mat-cell *matCellDef="let element"
'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
</ng-container> {{element.name}}
</mat-cell>
</ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}"> <ng-container matColumnDef="{{tableHead[1].prop}}">
<mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}" matTooltip="{{column.head | translate}}"> <mat-header-cell *matHeaderCellDef
<mat-icon svgIcon="{{column.prop}}"> mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell>
</mat-icon> <mat-cell *matCellDef="let element">{{element.fraction ===
</mat-header-cell> 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
<mat-cell *matCellDef="let element">{{element[column.prop]}}</mat-cell> </ng-container>
</ng-container>
<ng-container matColumnDef="interact"> <ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">
<mat-header-cell *matHeaderCellDef></mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}" matTooltip="{{column.head | translate}}">
<mat-cell *matCellDef="let element"> <mat-icon svgIcon="{{column.prop}}">
<button mat-icon-button </mat-icon>
matTooltip="{{ 'stats.scoreboard.button.detail' | translate:{name: element.name} }}" </mat-header-cell>
(click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ? <mat-cell *matCellDef="let element">{{element[column.prop]}}</mat-cell>
</ng-container>
<ng-container matColumnDef="interact">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let element">
<button mat-icon-button
matTooltip="{{ 'stats.scoreboard.button.detail' | translate:{name: element.name} }}"
(click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ?
element['steamUUID'] : element['name'])"> element['steamUUID'] : element['name'])">
<mat-icon svgIcon="stats-detail"></mat-icon> <mat-icon svgIcon="stats-detail"></mat-icon>
</button> </button>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row> <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table> </mat-table>
</div>

View File

@ -1,12 +1,24 @@
@import url('../../../style/list-entry.scss'); @import url('../../../style/list-entry.scss');
@import url('../../../style/hide-scrollbar.scss'); @import url('../../../style/hide-scrollbar.scss');
mat-table.mat-table { .scoreboard-table {
width: 1058px; width: 1058px;
margin: auto;
height: 68vh;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
margin: auto; box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);
height: 70vh; border-bottom: 1px solid #dadada;
}
.mat-header-row {
width: 1058px;
position: absolute;
z-index: 100;
}
.mat-table > mat-row:first-of-type {
padding-top: 56px;
} }
.mat-column-name { .mat-column-name {
@ -38,27 +50,7 @@ mat-table.mat-table {
white-space: pre-wrap; white-space: pre-wrap;
} }
.mat-header-row, mat-table.mat-table { .mat-header-row, .scoreboard-table {
width: 768px; width: 768px;
} }
} }
@media all and (max-width: 599px) {
.mat-column-name {
flex: 0 0 130px;
padding-left: 1vw;
word-wrap: break-word;
white-space: pre-wrap;
}
.mat-header-row {
width: 755px;
}
mat-table.mat-table {
width: 100%;
overflow-x: auto;
display: grid;
}
}

View File

@ -1,6 +1,6 @@
<div *ngIf="war" class="war-header fade-in" xmlns="http://www.w3.org/1999/html"> <div *ngIf="war" class="war-header fade-in" xmlns="http://www.w3.org/1999/html">
<div class="war-header-container"> <div class="war-header-container">
<div class="pull-left head-field"> <div class="pull-left head-field" style="width: 250px">
<h4>{{'stats.scoreboard.standings' | translate}}</h4> <h4>{{'stats.scoreboard.standings' | translate}}</h4>
<span [style.color]="fraction.COLOR_BLUFOR" <span [style.color]="fraction.COLOR_BLUFOR"
style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span> style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span>

View File

@ -16,13 +16,10 @@
font-size: 22px; font-size: 22px;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
width: 250px;
} }
.head-field-pie-chart { .head-field-pie-chart {
font-size: 22px; @extend .head-field;
margin-top: 10px;
margin-bottom: 10px;
padding-left: 100px; padding-left: 100px;
} }
@ -122,69 +119,3 @@ span.tab-control {
padding-left: 57px; padding-left: 57px;
} }
} }
@media all and (max-width: 599px) {
.war-header {
position: relative;
overflow: auto;
margin-bottom: 34px; /*do not cover anything with back to top bar*/
}
.nav-tabs {
width: 100%;
padding-top: 0;
}
.war-header-container {
width: 100%;
padding-top: 0;
h4 {
font-size: 16px;
margin-bottom: 0;
}
div.btn-clean-log {
padding-left: 0;
padding-top: 38px;
& > a {
margin: 0 !important;
}
}
}
.head-field {
width: calc(100% - 1.5vw);
text-align: center;
margin-top: 1vh;
margin-bottom: 0;
& > span {
font-size: 16px;
}
}
.head-field-pie-chart {
width: calc(54% - 1.5vw);
padding-left: 10%;
margin-bottom: -8px;
}
.nav-tabs > li {
width: 25%;
font-size: 12px;
mat-icon {
display: block;
}
}
/* radio box fraction select */
.nav-tabs > li:last-child {
width: fit-content;
position: absolute;
margin-top: -48px;
margin-left: 46%;
}
}