Compare commits

..

No commits in common. "15ea13e225f2a270b542be67dadacf2cecb7dab6" and "88861e595cebc1f60ec9a7b257a46a6015769924" have entirely different histories.

5 changed files with 9 additions and 51 deletions

View File

@ -1,12 +1,3 @@
### Get Campaigns [GET /campaigns]
Get all campaigns information
+ Response 200 (application/json; charset=utf-8)
+ Attributes (array[Campaign], fixed-type)
### Get Campaign [GET /campaigns/{id}] ### Get Campaign [GET /campaigns/{id}]
Get single campaign information Get single campaign information

View File

@ -26,6 +26,10 @@ h1 {
background-color: #222222; background-color: #222222;
} }
:host /deep/ .mat-tab-list {
margin-left: 10%;
}
:host /deep/ .mat-tab-label { :host /deep/ .mat-tab-label {
font-size: 16px; font-size: 16px;
color: #dadada; color: #dadada;
@ -39,10 +43,6 @@ h1 {
background-color: #222222; background-color: #222222;
} }
:host /deep/ div.mat-tab-body-wrapper {
box-shadow: #666666 2px 2px 8px;
}
:host /deep/ .mat-tab-body-content { :host /deep/ .mat-tab-body-content {
background-color: rgba(255, 255, 255, 0.35); background-color: rgba(255, 255, 255, 0.35);
height: calc(100vh - 241px); height: calc(100vh - 241px);
@ -54,9 +54,8 @@ h1 {
float: left; float: left;
width: 10%; width: 10%;
min-width: 100px; min-width: 100px;
height: calc(100vh - 192px); height: calc(100vh - 188px);
background: #222222;; background: #222222;;
box-shadow: #666666 2px 2px 8px;
} }
.fraction-side-bar > div { .fraction-side-bar > div {

View File

@ -7,7 +7,7 @@
<div [ngClass]="{active: active === 'GLOBAL'}" (click)="switchFraction('GLOBAL')">GLOBAL</div> <div [ngClass]="{active: active === 'GLOBAL'}" (click)="switchFraction('GLOBAL')">GLOBAL</div>
</div> </div>
<mat-tab-group [selectedIndex]="selectedType" (selectedIndexChange)="switchTab($event)"> <mat-tab-group>
<mat-tab label="Orden"> <mat-tab label="Orden">
<ng-template matTabContent> <ng-template matTabContent>
<cc-decoration-panel *ngFor="let decoration of medals" <cc-decoration-panel *ngFor="let decoration of medals"

View File

@ -6,7 +6,6 @@ import {Decoration} from '../../models/model-interfaces';
import {DecorationService} from '../../services/army-management/decoration.service'; import {DecorationService} from '../../services/army-management/decoration.service';
import {MatBottomSheet} from '@angular/material'; import {MatBottomSheet} from '@angular/material';
import {UserListSheetComponent} from '../user-list-sheet/user-list-sheet.component'; import {UserListSheetComponent} from '../user-list-sheet/user-list-sheet.component';
import {Location} from '@angular/common';
@Component({ @Component({
@ -24,13 +23,10 @@ export class DecorationOverviewComponent implements OnInit {
active: string; active: string;
selectedType = 0;
readonly fraction = Fraction; readonly fraction = Fraction;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private location: Location,
private decorationService: DecorationService, private decorationService: DecorationService,
private bottomSheet: MatBottomSheet) { private bottomSheet: MatBottomSheet) {
} }
@ -40,45 +36,17 @@ export class DecorationOverviewComponent implements OnInit {
this.decorationService.findDecorations() this.decorationService.findDecorations()
.subscribe(decorations => { .subscribe(decorations => {
this.decorations = decorations; this.decorations = decorations;
const queryParams = this.route.snapshot.queryParams; this.switchFraction('BLUFOR');
if (queryParams.type < 2) {
this.selectedType = queryParams.type;
}
const fract = queryParams.fraction;
if (fract && (fract === 'BLUFOR' || fract === 'OPFOR' || fract === 'GLOBAL')) {
this.switchFraction(queryParams.fraction);
} else {
this.switchFraction('BLUFOR');
}
}); });
}; };
switchFraction(value: any) { switchFraction(value: string) {
this.medals = this.decorations.filter(d => d.fraction === value && d.isMedal); this.medals = this.decorations.filter(d => d.fraction === value && d.isMedal);
this.ribbons = this.decorations.filter(d => d.fraction === value && !d.isMedal); this.ribbons = this.decorations.filter(d => d.fraction === value && !d.isMedal);
this.active = value; this.active = value;
this.adjustBrowserUrl(value)
}
switchTab(tabIndex) {
this.selectedType = tabIndex;
this.adjustBrowserUrl(this.active)
} }
select(decoration: Decoration) { select(decoration: Decoration) {
this.bottomSheet.open(UserListSheetComponent, {data: {decoration: decoration}}); this.bottomSheet.open(UserListSheetComponent, {data: {decoration: decoration}});
} }
adjustBrowserUrl(fractionKey = '') {
const absoluteUrl = this.location.path().split('?')[0];
if (fractionKey === 'BLUFOR' && this.selectedType === 0) {
this.location.replaceState(absoluteUrl);
return;
}
const queryPart = fractionKey !== '' ? 'fraction='.concat(fractionKey)
.concat('&type=' + this.selectedType) : 'type=0';
this.location.replaceState(absoluteUrl, queryPart);
}
} }

View File

@ -1,6 +1,6 @@
.decoration-card { .decoration-card {
background: rgba(255, 255, 255, 0.87); background: rgba(255, 255, 255, 0.87);
width: 213px; width: 229px;
height: 258px; height: 258px;
margin: 7px 12px; margin: 7px 12px;
padding: 0; padding: 0;