-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
DFWC integration
- Loading branch information
Showing
36 changed files
with
3,386 additions
and
2,569 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<div class="shadowed-main-block"> | ||
<h1 class="h1-block-header">DFWC 2019 Results</h1> | ||
|
||
<div style="display: flex;"> | ||
<div style="flex-grow:1;margin-right:20px;"> | ||
<div class="physics-header"> | ||
VQ3 | ||
</div> | ||
<div class="cup-results-row"> | ||
<div class="place-column">#</div> | ||
<div class="player-column">Player</div> | ||
<div class="points-column">Points</div> | ||
<div class="rating-column">Rating</div> | ||
</div> | ||
<div *ngFor="let result of vq3TableWithChange; let i = index" class="cup-results-row"> | ||
<div class="place-column"> | ||
<app-player-place [place]="result.place"></app-player-place> | ||
</div> | ||
<div class="player-column"> | ||
<app-player-cell | ||
[class.transparent]="!result.playerId" | ||
[country]="result.country" | ||
[nick]="result.nick" | ||
[playerId]="result.playerId"> | ||
</app-player-cell> | ||
</div> | ||
<div class="points-column">{{ result.points }}</div> | ||
<div class="rating-column"> | ||
<app-rating-change [change]="result.change" [zeroIfNull]="false"></app-rating-change> | ||
</div> | ||
</div> | ||
</div> | ||
<div style="flex-grow:1;"> | ||
<div class="physics-header"> | ||
CPM | ||
</div> | ||
<div class="cup-results-row"> | ||
<div class="place-column">#</div> | ||
<div class="player-column">Player</div> | ||
<div class="points-column">Points</div> | ||
<div class="rating-column">Rating</div> | ||
</div> | ||
<div *ngFor="let result of cpmTableWithChange; let i = index" class="cup-results-row"> | ||
<div class="place-column"> | ||
<app-player-place [place]="i + 1"></app-player-place> | ||
</div> | ||
<div class="player-column"> | ||
<app-player-cell | ||
[class.transparent]="!result.playerId" | ||
[country]="result.country" | ||
[nick]="result.nick" | ||
[playerId]="result.playerId"> | ||
</app-player-cell> | ||
</div> | ||
<div class="points-column">{{ result.points }}</div> | ||
<div class="rating-column"> | ||
<app-rating-change [change]="result.change" [zeroIfNull]="false"></app-rating-change> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.physics-header { | ||
text-transform: uppercase; | ||
font-weight: bold; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: #eeeeee; | ||
border: 1px solid #cccccc; | ||
height: 32px; | ||
} | ||
|
||
.cup-results-row { | ||
display: flex; | ||
height: 32px; | ||
border: 1px solid #ccc; | ||
border-top: 0px; | ||
|
||
.place-column { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 32px; | ||
border-right: 1px solid #ccc; | ||
} | ||
|
||
.player-column { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-grow: 1; | ||
border-right: 1px solid #ccc; | ||
position: relative; | ||
} | ||
|
||
.points-column { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 80px; | ||
border-right: 1px solid #ccc; | ||
} | ||
|
||
.rating-column { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 80px; | ||
position: relative; | ||
} | ||
} | ||
|
||
.transparent { | ||
opacity: 0.5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { SharedModule } from '../../modules/shared.module'; | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { Dfwc2019PageComponent } from './dfwc2019.page'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: Dfwc2019PageComponent, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [Dfwc2019PageComponent], | ||
imports: [SharedModule, CommonModule, RouterModule.forChild(routes)], | ||
}) | ||
export class Dfwc2019PageModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { Dfwc2019PageComponent } from './dfwc2019.page'; | ||
import { Dfwc2019PageModule } from './dfwc2019.page.module'; | ||
|
||
describe('Dfwc2019PageComponent', () => { | ||
let component: Dfwc2019PageComponent; | ||
let fixture: ComponentFixture<Dfwc2019PageComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [Dfwc2019PageModule], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(Dfwc2019PageComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { LanguageService } from '../../services/language/language.service'; | ||
import { Translations } from '../../components/translations/translations.component'; | ||
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core'; | ||
import { DfwcResultInterface } from './interfaces/dfwc-result.interface'; | ||
import { MAX_DFWC_RATING, vq3Table, cpmTable } from './constants/results.constants'; | ||
|
||
@Component({ | ||
templateUrl: './dfwc2019.page.html', | ||
styleUrls: ['./dfwc2019.page.less'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class Dfwc2019PageComponent extends Translations implements OnInit { | ||
public vq3TableWithChange: DfwcResultInterface[]; | ||
public cpmTableWithChange: DfwcResultInterface[]; | ||
|
||
constructor(protected languageService: LanguageService) { | ||
super(languageService); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.vq3TableWithChange = vq3Table.map((result: DfwcResultInterface) => ({ | ||
...result, | ||
change: Math.round((MAX_DFWC_RATING * result.points) / vq3Table[0].points), | ||
})); | ||
|
||
this.cpmTableWithChange = cpmTable.map((result: DfwcResultInterface) => ({ | ||
...result, | ||
change: Math.round((MAX_DFWC_RATING * result.points) / cpmTable[0].points), | ||
})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface DfwcResultInterface { | ||
place: number; | ||
country: string; | ||
nick: string; | ||
points: number; | ||
playerId?: number; | ||
change?: number; | ||
} |
6 changes: 6 additions & 0 deletions
6
src/app/pages/main/components/news-dfwc-results/dto/dfwc-results.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { DfwcSingleResultDtoInterface } from './dfwc-single-result.dto'; | ||
|
||
export interface DfwcResultsDtoInterface { | ||
vq3: Record<string, DfwcSingleResultDtoInterface>; | ||
cpm: Record<string, DfwcSingleResultDtoInterface>; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/app/pages/main/components/news-dfwc-results/dto/dfwc-single-result.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export interface DfwcSingleResultDtoInterface { | ||
rank: string; | ||
flag: string; | ||
name: string; | ||
demo: string; | ||
time: string; | ||
points: string; | ||
pid: string; | ||
ref_id: string; | ||
time_ms: string; | ||
status: string; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/app/pages/main/components/news-dfwc-results/news-dfwc-results.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<app-news-offline-results *ngIf="mappedOfflineNews" [news]="mappedOfflineNews" [customTable]="true"></app-news-offline-results> | ||
<div style="font-weight: bold;margin-top: 12px;font-size: 16px;"> | ||
<a [href]="news.cup.customNews">>> {{ translations?.fullResultsTable }} <<</a> | ||
</div> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/pages/main/components/news-dfwc-results/news-dfwc-results.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { NewsDfwcResultsComponent } from './news-dfwc-results.component'; | ||
|
||
describe('NewsDfwcResultsComponent', () => { | ||
let component: NewsDfwcResultsComponent; | ||
let fixture: ComponentFixture<NewsDfwcResultsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ NewsDfwcResultsComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(NewsDfwcResultsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
src/app/pages/main/components/news-dfwc-results/news-dfwc-results.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { LanguageService } from '../../../../services/language/language.service'; | ||
import { Translations } from '../../../../components/translations/translations.component'; | ||
import { NewsOfflineResultsInterface } from '../../../../services/news-service/interfaces/news-offline-results.interface'; | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { DfwcResultsService } from './services/dfwc-results.service'; | ||
|
||
@Component({ | ||
selector: 'app-news-dfwc-results', | ||
templateUrl: './news-dfwc-results.component.html', | ||
styleUrls: ['./news-dfwc-results.component.less'], | ||
}) | ||
export class NewsDfwcResultsComponent extends Translations implements OnInit { | ||
@Input() | ||
news: NewsOfflineResultsInterface; | ||
|
||
public mappedOfflineNews: NewsOfflineResultsInterface; | ||
|
||
constructor(protected languageService: LanguageService, private dfwcResultsService: DfwcResultsService) { | ||
super(languageService); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.mappedOfflineNews = this.dfwcResultsService.mapDfwcResultsToOfflineNews(this.news); | ||
super.ngOnInit(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/app/pages/main/components/news-dfwc-results/services/dfwc-results.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import { DfwcResultsService } from './dfwc-results.service'; | ||
|
||
describe('DfwcResultsService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: DfwcResultsService = TestBed.get(DfwcResultsService); | ||
|
||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.