-
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.
Merge pull request #73 from turecross321/master
Implement marking levels as re-uploads
- Loading branch information
Showing
7 changed files
with
265 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import {GameVersion} from "./game-version"; | ||
|
||
export interface LevelEditRequest { | ||
title: string | undefined; | ||
description: string | undefined; | ||
iconHash: string | undefined; | ||
gameVersion: string | undefined; | ||
originalPublisher: string | undefined; | ||
isReUpload: boolean | undefined; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,134 @@ | ||
<page-header-block *ngIf="level"> | ||
<div class="flex gap-3.5"> | ||
<level-avatar [level]="level" size="h-auto w-44 max-md:w-24"></level-avatar> | ||
<div class="flex-grow"> | ||
<div class="font-bold text-3xl mb-1"> | ||
{{ level.title.length == 0 ? 'Unnamed Level' : level.title }} | ||
<div class="flex gap-3.5"> | ||
<level-avatar [level]="level" size="h-auto w-44 max-md:w-24"></level-avatar> | ||
<div class="flex-grow"> | ||
<div class="font-bold text-3xl mb-1"> | ||
{{ level.title.length == 0 ? 'Unnamed Level' : level.title }} | ||
|
||
<tooltip text="This level has been team picked." *ngIf="level.teamPicked"> | ||
<fa-icon [icon]="faCircleCheck" class="text-xl pr-1"></fa-icon> | ||
</tooltip> | ||
<tooltip text="This level has been team picked." *ngIf="level.teamPicked"> | ||
<fa-icon [icon]="faCircleCheck" class="text-xl pr-1"></fa-icon> | ||
</tooltip> | ||
|
||
<div class="inline-block text-sm font-normal" *ngIf="level.publisher"> | ||
<span-gentle>by | ||
<user-link [user]="level.publisher" class="pl-1"></user-link> | ||
</span-gentle> | ||
</div> | ||
<div class="text-sm font-normal"> | ||
<span-gentle>Published for {{getGameVersion(level.gameVersion)}} </span-gentle> | ||
<span-gentle> | ||
<date [date]="level.publishDate"></date> | ||
</span-gentle> | ||
<span-gentle *ngIf="level.publishDate != level.updateDate">, | ||
last updated <date [date]="level.updateDate"></date></span-gentle> | ||
</div> | ||
</div> | ||
<div class="inline-block text-sm font-normal"> | ||
<span-gentle>by | ||
<user-link [user]="level.publisher" class="pl-1" *ngIf="level.publisher" | ||
[ngClass]="level.isReUpload ? 'line-through' : ''"></user-link> | ||
<tooltip *ngIf="level.isReUpload" class="pl-1" | ||
[text]="'This level is a re-upload, originally created by ' + level.originalPublisher + '.'"> | ||
<span>{{ level.originalPublisher }}</span> | ||
</tooltip> | ||
</span-gentle> | ||
</div> | ||
<div class="text-sm font-normal"> | ||
<span-gentle>Published for {{ getGameVersion(level.gameVersion) }}</span-gentle> | ||
<span-gentle class="pl-1"> | ||
<date [date]="level.publishDate"></date> | ||
</span-gentle> | ||
<span-gentle *ngIf="level.publishDate != level.updateDate">, | ||
last updated | ||
<date [date]="level.updateDate"></date> | ||
</span-gentle> | ||
</div> | ||
</div> | ||
|
||
<level-statistics [level]="level" class="inline-block ml-1 mb-1"></level-statistics> | ||
<level-statistics [level]="level" class="inline-block ml-1 mb-1"></level-statistics> | ||
|
||
<div class="bg-backdrop rounded px-5 py-2.5 drop-shadow-lg whitespace-pre-wrap text-foreground"> | ||
<p>{{ level.description.length == 0 ? 'No description was provided for this level.' : level.description }}</p> | ||
</div> | ||
<div class="bg-backdrop rounded px-5 py-2.5 drop-shadow-lg whitespace-pre-wrap text-foreground"> | ||
<p>{{ level.description.length == 0 ? 'No description was provided for this level.' : level.description }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</page-header-block> | ||
<page-header-block> <!-- controls row --> | ||
<div class="flex gap-x-2.5 text-foreground"> | ||
<primary-button text="Play Now!" [icon]="faPlay" (click)="setAsOverride()" *ngIf="isOwnUserOnline"></primary-button> | ||
<admin-link-button *ngIf="ownUser?.role == UserRoles.Admin" [routerLink]="'/admin/level/' + level?.levelId"></admin-link-button> | ||
<secondary-button *ngIf="ownUser && (ownUser?.userId == level?.publisher?.userId || ownUser?.role == UserRoles.Admin)" | ||
[routerLink]="'/level/' + level?.levelId + '/edit'" | ||
class="w-36" text="Edit Level" [icon]="faPencil"></secondary-button> | ||
</div> | ||
<div class="flex gap-x-2.5 text-foreground"> | ||
<primary-button text="Play Now!" [icon]="faPlay" (click)="setAsOverride()" | ||
*ngIf="isOwnUserOnline"></primary-button> | ||
<admin-link-button *ngIf="ownUser?.role == UserRoles.Admin" | ||
[routerLink]="'/admin/level/' + level?.levelId"></admin-link-button> | ||
<secondary-button | ||
*ngIf="ownUser && (ownUser?.userId == level?.publisher?.userId || ownUser?.role == UserRoles.Admin)" | ||
[routerLink]="'/level/' + level?.levelId + '/edit'" | ||
class="w-36" text="Edit Level" [icon]="faPencil"></secondary-button> | ||
</div> | ||
</page-header-block> | ||
|
||
<page-header-block *ngIf="!level"> | ||
<div class="flex gap-3.5 animate-pulse"> | ||
<div class="inline h-44 w-44 bg-secondary rounded-full"></div> | ||
<div> | ||
<div class="inline-block h-8 w-80 bg-secondary rounded-full"></div> | ||
<br> | ||
<div class="inline-block h-4 w-48 bg-secondary rounded-full"></div> | ||
<div class="flex gap-3.5 animate-pulse"> | ||
<div class="inline h-44 w-44 bg-secondary rounded-full"></div> | ||
<div> | ||
<div class="inline-block h-8 w-80 bg-secondary rounded-full"></div> | ||
<br> | ||
<div class="inline-block h-4 w-48 bg-secondary rounded-full"></div> | ||
|
||
<div class="bg-backdrop rounded px-5 py-2.5 flex"> | ||
<div class="inline-block h-4 w-96 bg-secondary rounded-full m-1"></div> | ||
<div class="inline-block h-4 w-48 bg-secondary rounded-full m-1"></div> | ||
</div> | ||
<div class="bg-backdrop rounded px-5 py-2.5 flex"> | ||
<div class="inline-block h-4 w-96 bg-secondary rounded-full m-1"></div> | ||
<div class="inline-block h-4 w-48 bg-secondary rounded-full m-1"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</page-header-block> | ||
|
||
<div class="flex flex-row gap-2.5 max-md:flex-col pt-5"> | ||
<container class="w-full"> | ||
<div class="flex"> | ||
<h2 class="text-3xl font-bold flex-grow">Leaderboard</h2> | ||
<form-dropdown *ngIf="level?.gameVersion !== 4" name="Score Type" [options]="scoreTypes" (change)="this.formChanged()" [(value)]="scoreType"></form-dropdown> | ||
</div> | ||
<divider></divider> | ||
<div *ngIf="scores === undefined"> | ||
<p>Loading scores...</p> | ||
</div> | ||
<div *ngIf="scores !== undefined && scores!.length === 0" class="text-center"> | ||
<p class="font-bold text-2xl">No {{scoreType}}-player scores</p> | ||
<p> | ||
Nobody has beaten this level with {{scoreType}} player{{scoreType == '1' ? '' : 's'}} yet. Go for it! | ||
</p> | ||
</div> | ||
<div *ngFor="let score of scores"> | ||
<div class="my-5 px-2.5"> | ||
<a [routerLink]="'/score/' + score.scoreId" class="flex items-center"> | ||
<div class="text-2xl"> | ||
<span *ngIf="score.rank == 1" class="text-rank-gold pr-2">#{{score.rank}}</span> | ||
<span *ngIf="score.rank == 2" class="text-rank-silver pr-2">#{{score.rank}}</span> | ||
<span *ngIf="score.rank == 3" class="text-rank-bronze pr-2">#{{score.rank}}</span> | ||
<container class="w-full"> | ||
<div class="flex"> | ||
<h2 class="text-3xl font-bold flex-grow">Leaderboard</h2> | ||
<form-dropdown *ngIf="level?.gameVersion !== 4" name="Score Type" [options]="scoreTypes" | ||
(change)="this.formChanged()" [(value)]="scoreType"></form-dropdown> | ||
</div> | ||
<divider></divider> | ||
<div *ngIf="scores === undefined"> | ||
<p>Loading scores...</p> | ||
</div> | ||
<div *ngIf="scores !== undefined && scores!.length === 0" class="text-center"> | ||
<p class="font-bold text-2xl">No {{ scoreType }}-player scores</p> | ||
<p> | ||
Nobody has beaten this level with {{ scoreType }} player{{ scoreType == '1' ? '' : 's' }} yet. Go for | ||
it! | ||
</p> | ||
</div> | ||
<div *ngFor="let score of scores"> | ||
<div class="my-5 px-2.5"> | ||
<a [routerLink]="'/score/' + score.scoreId" class="flex items-center"> | ||
<div class="text-2xl"> | ||
<span *ngIf="score.rank == 1" class="text-rank-gold pr-2">#{{ score.rank }}</span> | ||
<span *ngIf="score.rank == 2" class="text-rank-silver pr-2">#{{ score.rank }}</span> | ||
<span *ngIf="score.rank == 3" class="text-rank-bronze pr-2">#{{ score.rank }}</span> | ||
|
||
<span *ngIf="score.rank !== undefined && score.rank > 3" | ||
class="text-rank-other pr-2">#{{score.rank}}</span> | ||
</div> | ||
<span *ngIf="score.rank !== undefined && score.rank > 3" | ||
class="text-rank-other pr-2">#{{ score.rank }}</span> | ||
</div> | ||
|
||
<div class="flex flex-col"> | ||
<span class="text-lg">{{score.score.toLocaleString(undefined)}} points</span> | ||
<div class="flex flex-col"> | ||
<span class="text-lg">{{ score.score.toLocaleString(undefined) }} points</span> | ||
|
||
<span class="text-sm"> | ||
<span class="text-sm"> | ||
Achieved by | ||
<b><user-link [user]="score.players[0]"></user-link></b> | ||
<date [date]="score.scoreSubmitted" class="ml-1"></date> | ||
</span> | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div *ngIf="this.scores !== undefined && this.scores!.length % 10 == 0 && this.scores!.length !== 0"> | ||
<secondary-button text="Load more" (click)="loadMoreScores()"></secondary-button> | ||
</div> | ||
</container> | ||
<container class="w-full"> | ||
<h2 class="text-3xl font-bold">Recent Activity</h2> | ||
<divider></divider> | ||
<div *ngIf="this.scores !== undefined && this.scores!.length % 10 == 0 && this.scores!.length !== 0"> | ||
<secondary-button text="Load more" (click)="loadMoreScores()"></secondary-button> | ||
</div> | ||
</container> | ||
<container class="w-full"> | ||
<h2 class="text-3xl font-bold">Recent Activity</h2> | ||
<divider></divider> | ||
|
||
<div *ngIf="activity"> | ||
<div *ngFor="let event of activity.events"> | ||
<activity-event [event]="event" [page]="activity" [contextIsLevel]="true"></activity-event> | ||
</div> | ||
</div> | ||
<div *ngIf="activity"> | ||
<div *ngFor="let event of activity.events"> | ||
<activity-event [event]="event" [page]="activity" [contextIsLevel]="true"></activity-event> | ||
</div> | ||
</div> | ||
|
||
<div *ngIf="!activity"> | ||
<div *ngFor="let i of GenerateEmptyList(5)"> | ||
<activity-event></activity-event> | ||
</div> | ||
</div> | ||
</container> | ||
<div *ngIf="!activity"> | ||
<div *ngFor="let i of GenerateEmptyList(5)"> | ||
<activity-event></activity-event> | ||
</div> | ||
</div> | ||
</container> | ||
</div> |